WORK.TWO
N BeginDate Day - --------- ---
1 09JAN2010 1 2 12JAN2010 4
Which expression successfully completed the program and creates the variable Day?
A. day(BeginDate)
B. weekday(BeginDate) C. dayofweek(BeginDate) D. getday(BeginDate,today())
Answer: B
------------------------------------------------------------------
58.The following program is submitted:
proc format; value salfmt.
0 -< 50000 = 'Less than 50K' 50000 - high = '50K or Greater';
options fmterr nodate pageno=1; title 'Employee Report';
proc print data=work.employees noobs; var fullname salary hiredate; format
salary salfmt. hiredate date9.; label
fullname='Name of Employee' salary='Annual Salary' hiredate='Date of Hire'; run;
Why does the program fail?
A. The PAGENO option is invalid in the OPTIONS statement. B. The RUN statement is missing after the FORMAT procedure. C. The format name contains a period in the VALUE statement. D. The LABEL option is missing from the PROC PRINT statement.
Answer: C
------------------------------------------------------------------
59.Given the contents of the raw data file TYPECOLOR.DAT:
----+----10---+----20---+----30 daisyyellow
The following SAS program is submitted:
data FLOWERS;
infile 'TYPECOLOR.DAT' truncover; length
Type $ 5 Color $ 11; input
Type $ Color $; run;
What are the values of the variables Type and Color?
A. Type=daisy, Color=yellow B. Type=daisy, Color=w
C. Type=daisy, Color=daisyyellow D. Type=daisy, Color=
Answer: D
------------------------------------------------------------------
60.Given the SAS data set WORK.PRODUCTS:
ProdId Price ProductType Sales Returns ------ ----- ----------- ----- -------
K12S 95.50 OUTDOOR 15 B132S 2.99 CLOTHING 300 R18KY2 51.99 EQUIPMENT 25 3KL8BY 6.39 OUTDOOR 125 DY65DW 5.60 OUTDOOR 45 DGTY23 34.55 EQUIPMENT 67
The following SAS program is submitted:
data WORK.REVENUE(drop=Sales Returns Price);
2 5 15 5 2 10 set WORK.PRODUCTS(keep=ProdId Price Sales Returns); Revenue=Price*(Sales-Returns); run;
How many variables does the WORK.REVENUE data set contain?
A. 2 B. 3 C. 4 D. 6
Answer: A
------------------------------------------------------------------
61.Consider the data step:
data WORK.TEST;
infile 'c:\\class1.csv' dsd;
input Name $ Sex $ Age Height Weight;
if Age NE 16 and Age NE 15 then Group=1; else Group=2; run;
Which statement produces a functionally equivalent result for assigning Group a value?
A. if Age not in(15,16) then Group=1; else Group=2;
B. if (Age NE 16) or (Age NE 15) then Group=1; else Group=2; C. where Age not between 15 and 16 then Group=1; else Group=2; D. both A or C will work.
Answer: A
------------------------------------------------------------------
62.The following SAS program is submitted:
<_insert_ods_code_>
proc means data=SASUSER.SHOES;
where Product in ('Sandal' , 'Slipper' , 'Boot'); run;
<_insert_ods_code_>
Which ODS statements, inserted in the two locations above, create a report stored in an html file?
A.
ods html open='sales.html'; ods html close;
B.
ods file='sales.html' / html; ods file close;
C.
ods html file='sales.html'; ods html close;
D.
ods file html='sales.html'; ods file close;
Answer: C
------------------------------------------------------------------
63.The following SAS program is submitted:
data WORK.OUTDS; do until(Prod GT 6); Prod + 1; end; run;
What is the value of the variable Prod in the output data set?
A. . (missing) B. 6 C. 7
D. Undetermined, infinite loop.
Answer: C
------------------------------------------------------------------
65.The following SAS program is submitted:
data WORK.ACCOUNTING; set WORK.DEPARTMENT; label Jobcode='Job Description'; run;
Which statement is true about the output dataset?
A. The label of the variable Jobcode is Job (only the first word).
B. The label of the variable Jobcode is Job Desc (only the first 8 characters). C. The label of the variable Jobcode is Job Description.
D. The program fails to execute due to errors. Labels must be defined in a PROC step.
Answer: C
------------------------------------------------------------------
66.The following SAS program is submitted:
data WORK.SALES; do Year=1 to 5;
do Month=1 to 12; X + 1; end; end; run;
How many observations are written to the WORK.SALES data set?
A. 0 B. 1 C. 5 D. 60
Answer: B
------------------------------------------------------------------
67.Consider the following data step:
data WORK.NEW;
set WORK.OLD(keep=X); if X < 10 then X=1;
else if X >= 10 AND X LT 20 then X=2; else X=3; run;
In filtering the values of the variable X in data set WORK.OLD, what new value would be assigned to X if its original value was a missing value?