Anda di halaman 1dari 14

1. Which two elements does a SAS program have?

a) b) o c) d) e) Variables and h c t i o n s Data and instructions Data step and procedure step Data step and variables Data step and Proc Print

data

seasons; SET temps; IF Temperature > 100 THEN ELSE Status = 'Cold' ;

Status

'Hot';

Given the above code and a Temperature value of 67, what would the value of Status be: a) b) c) Cd) e) Hot Cold 99 Col 67

3 Which of the following is a valid SAS name?

' 0
d)

a) b)

Sdatamon data#5 monthssdata five months data

4 Given that the data set named ONE contains 10 observations and the data set named TWO contains 10 observations, how many observations will be contained in the data set named COMBINE that is created in the following DATA step?
data combine; set one two; run;

020
c) d)

0, the DATA step will fail due to syntax errors. 10 to 20, depending on how many observations match.

Length Name $6; INPUT Name $1 - 6;

Given the above merit of code, what value would Name have given the data 'Albert' as input:

c) d) None of the above e) A


6. The following code is submitted: data test; average=mean ( 6,4, ,2) ; run;

What is the value of average? .

4:
el 5

.(missing numeric value)

7. Which X variable has a value of 1 at the end of an input file?

8. The following is an example of. ... (choose one)


data employee; infile 'employee.datl; input id $6. name $20. 1330 locale $10.; run;

Column only
d) e)

Mixed Standard

9. The fsflowbg SAS program is submitted at the start of a new SAS session:

libname sasdata 'SAS-da t a - l i b r a r y data sasdata. sales; set sasdata.salesdata; profit-expenses-revenues; run# proc print data-sales; run;

';

The SAS data set Sdata.Salesdata has ten observations. Which one of the following explains why a report fails to generate?

&
c)

The DATA step fails execution. SAS data set Sales does not exist. The SAS data set Sales has no observations.

d)

The PRINT procedure contains a syntax error

10. The following SAS program is submitted:


data newstaf f; set sta,ff; < & s e r t WHERE s t a t e m e n t here> run;

Which one of the following WHERE statements completes the program and selects only observations with a Hire-date of February 23, 20001 where hire_date=23feb20001d; where hiredate='23 febZM)(Y1; where hire_date='O2/23/2000'd; where hire-date='02/23/2000';

c) d)

11. The following SAS program is submitted:


proc sort data=work.test; by fname descending salary; run;

Which one of the following represents how the observations are sorted? The data set WorkTest is stored in ascending order by both Fname and Salary values. The data set WortTest is stored in descending order by both Fname and Salary values. The data set WorkTest is &wed in descending order by Fname and ascending order by

2ZtZbrk.Test i s& m i in ascending order by Fname and in descending order by Salary values.

f.glCXppunu : a l a p w q $ amu-lsry $ uo!lalaJ lndy f-galap : alapqwq $ amuU1sry $ uo!lalai lndy I.gMppunu alapqnq $ amuUlsry $ uo!)alaJ lndy 1-galapa)epytrIq $ amu-lsn~$ uoyajaJ indu! jsanlv~ alap svs

ifs3> ! s
(a
\

(P

a w p q n a aIqegah ayl JOJ sanplr ay) spaal Lp3a.1.103 luawalvls J . ~ W gym


! unx

<axaq quama3 e3s LndNI w a s u F > !, u o r ~ e 3 ~ ~ ~ 3 a d sa-T a T j~ uT ~. j, !ATTu~ 'y ~ l O M eqep

.Molaq pals!~s!

sly QV M ~ J

'El

ilas s v p )n&no aw q uo!s!A!a alqapA ayljo anlar\ ayl q u a s a ~ d %u;r~o(loj a~ ayljo auo 9 3 1 ~ .

~ ~ l l o w i program n g is submitted:
data fitaten; input jobcode' $ salary name $; cards; FLAT1 70000 Bob FLAT2 60000 Joe FLAT3 30090 Ann
I

run; data desc; set fltaten; if salary>60000 then description-'Over 60'; else description='Under 60'; run;

What is value of the variable named description when the value for salary is 300001 (&under 6 b) Under 60 c) Over 60 d) " (Missing character value) e) . (Missing numeric value)

15.

The following SAS program is submitted:


ods html file='newfile.html'; proc print data=sasuser.houses; run; proc means data=sasuser.houses; run; proc freq data=sasuser.shoes; run; ods html close; proc print data-sasuser.shoes; run;

How many PflUL files are created?

16. The following SAS program is submitted:


data work.building; code='DAL523'; code='SANFRAN604'; code='HOUS7311; length code $ 20; run; Which one of the following is the length of the code variable?

17. A SAS report currently flows over two pages because it is too long to fit within the specified display dimension. Which one of the following actions would change the display dimension so that the report fits on one page?

@r

a) b) c)

Increase the value of the LINEN0 option Decrease the value of the PAGENO option Decrease the value of the LINESIZE option. Increase the value of the PAGESIZE option.

18. Which of the following is NOT created at compile time?

a) b) d)

the program data vector (PDV) the data set descriptor the fmt observation , the -N- automatic variable

19. Which is an example of standard numeric data?

14. ,.

i.

following program is submitted:


data fitaten; input jobcode $ salary name $; cards; FLAT1 70000 Bob FLAT2 60000 Joe FLAT3 30000 Ann
;

run; data desc; set fltaten; if salary>60000 then description='Over 60'; else description='Under 60'; run;

What is value of the variable named description when the value for salary is 30000?

Q ~ h6 r
b) Under 60 c) Over 60 d) ' ' (Missing character value) e) . (Missing numeric value)

*
15.

The following SAS program is submitted:


ods html file='newfile.htmll; proc print data=sasuser.houses; run; proc means data=sasuser.houses; run; proc freq data=sasuser.shoes; run; ods html close; proc print data=sasuser.shoes; run;

How many HTML files are created?

16. The following SAS program i s submitted:

data work.building; code='DAL523'; code='SANFRAN604'; code='HOUS731'; length code $ 20; run; Which one of the following is the length of the code variable?

17. ' A SAS report currently flows over two pages because it is too long to fit within the specified display dimension. Which one of the following actions would change the display dimension so that the report fits on one page?

@I
18.

a) b) c)

Increase the value of the LINEN0 option Decrease the value of the PAGENO option Decrease the value of the LMESIZE option. Increase the value of the PAGESIZE option.

Which of the following is NOT created at compile time? the program data vector (PDV) the data set descriptor (c'C, the first observation d) the -N- automatic variable a) b)

19. Which is an example of standard numeric data?

20.

Consider the following program


data perm.update; infile invent; input Item $ 1-13 Idrum $ 15-19 InStock 21-22 BackOrd 24-25; Total=instock+backord;

How many cells are there in the input buffer?

21.

How many program steps are executed when the program below is processed?
data user.tables; infile jobs; input date name $ job $; run; proc sort data=user.tables;
by m e t

run; proc print data=user.tables; run;

@ zc.

five

d. six

22. Which procedure displays the descriptor portion of a SAS data set?

a)

PROCMEANS

23. Which of t4e following FORMAT procedures is written correctly? a) proc format lib=library value colorfmt; 1= \Redr 2= 'Green1 3= \Bluer run;
11

proc format lib=library; value colorfmt; 1- \Red1 2= 'Greenr 3- \Bluet; run; proc format lib=library; value colorfmt; 1= \Redr . 2= \Green1 3= \Bluer run; proc format lib=library; value colorfmt 1= \Red1; 2= \Greenr; 3= \Blue1; run;

24. What are the final titles resulting fiom the following program?

proc print data=work.march; title1 'The First Liner; title2 'The Second Line' ; run; proc print data=work.march; title \The Top Line1; run;
The First Line The Second Line The Top Line c) The Top Line The Second Line The First Line The Top Line

25. Below is part of the SAS data set ia.empdata.

whi& skmttnt must be added to the following code in order to print only the EmpIDYs and Salaries of the Pilots?
proc print data=ia.empdata noobs; var JobCode EmpID Salary; ( i n s e r t statement here> run;

@,where

Jobbode= VPILOT' ;

26. Which of the following SAS date formats displays the SAS date value for January 16 2002 in the form 16101/2002?

27. Which of the following procedures is NOT a report writing procedure? a)


b)

PROCMEANS PROCFREQ

d)

PROC TABULATE

28. Below is part of the SAS data set ia.empdata.

proc print data=ia.empdata noobs; var JobCode EmpID Salary; < i n s e r t statement here> run;

The above SAS program is submitted, producing the following output


Job Code
PILOT FLTAT FLTAT P I LOT FLTAT FLTAT P ILOT PILOT

Salary

Which of the,following statements should be added to the program to produce the correct output?
a) where Salary-sum;

0
C)

b) sum Salary; where Salary=sum Salary;

29. A raw data file, dfwlax. dat , is listed below

Description Flight number


Date

Column 1-3

Destination First Class I Economv

1 1

4-1 1

12-14 15-17 1 18-20

1
I

The following program is submitted using the above file as input:


data work.dfwlax; infile 'dfwlax.dat'; < i n s e r t i n p u t s t a t e m e n t here> run;

Which of the following MPUT statements reads the raw data file correctly?
a>

input

. Dest

1-3 Date 4-11 12-14 Firstclass 15-17 Economy 18-20;

Flight

Flight $ 1-3 Date $ 4-11 Dest $ 12-14 FirstClass 15-17 Economy 18-20;
c>

input

Flight 1-3 Date 4-11 Dest $ 12-14 FirstClass 15-17 Economy 18-20;

dl
input Flight $ 1-3 Date $ 4-11 Dest 12-14 FirstClass 15-17 Economy 18-20;

title2 'by JobCode'; proc tabulate data=ia.fltat; class Location JobCode; < i n s e r t statement here> run;

What statement must be added to the above code to output the table given below?
The SAS System by JobCode

a) table JobCode b) table Location, c g t a b l e JobCode,

Location; JobCode; Location; JobCode;

i .
d) table Location

END OF EXAMINATION

. A

. .'$ I. ,s

'"I

Anda mungkin juga menyukai