SAS Certified Base Programmer 123 Questions (116)
The following SAS program is submitted:
data work.totalsales; set work.monthlysales(keep=year product sales); retrain montnsales {12}; array montnsales {12}; doi=1 to 12; monthsales{i}=sales; end; ent+1; monthsales{ent}=sales; run;
The data set named WORK.MONTHLYSALES has one observation per month for each of five years for a total of 60 observations.
Which one of the following is the result of the above program?
A. The program fails execution due to data errors.
B. The program fails execution due to syntax errors.
C. The program runs with warnings and creates the WORK.TOTALSALES data set with 60 observations.
D. The program runs without errors or warnings and creates the WORK.TOTALSALES data set with 60 observations.
SAS Certified Base Programmer 123 Questions (115)
The following SAS program is submitted:
data work.january; set work.allmonths (keep=product month num_sold cost); if month='jan'then output work.january; sales=cost*num_sold; keep=product sales; run;
Which variables does the WORK.JANUARY data set contain?
A. PRODUCT and SALES only
B. PRODUCT, MONTH, NUM_SOLD and COST only
C. PRODUCT, SALES, MONTH, NUM_SOLD and COST only
D. An incomplete output data set is created due to syntax errors.
SAS Certified Base Programmer 123 Questions (114)
The contents of the raw data file CALENDAR are listed below:
----|----10---|----20---|----30 01012000
The following SAS program is submitted:
data test; infile,calendar'; input@1 data mmddyy10.; if date='01012000'd then event='january 1st'; run;
Which one of the following is the value of the EVENT variable?
A. 01012000
B. January 1st
C. . (missing numeric value)
D. The value can not be determined as the program fails to execute due to errors.
SAS Certified Base Programmer 123 Questions (113)
A SAS program is submitted and the following SAS log is produced:
2 data gt100; 3 set ia.airplanes 4 if mpg gt 100 then output; 22 202 ERROR: File WORK.IF.DATA does not exist. ERROR: File WORK.MPG.DATA does not exist. ERROR: File WORK.GT.DATA does not exist. ERROR: File WORK.THEN.DATA does not exist. ERROR: File WORK.OUTPUT.DATA does not exist. ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, (,;.END,KEY,KEYS,NOBS,OPEN,POINT,_DATA_,_LAST_, _NULL_. ERROR 202-322: The option or parameter is not recognized and will be ignored. 5 run; The IA libref was previously assigned in this SAS session.
Which one of the following corrects the errors in the LOG?
A. Delete the word THEN on the IF statement.
B. Add a semicolon at the end of the SET statement.
C. Place quotes around the value on the IF statement.
D. Add an END statement to conclude the IF statement.
SAS Certified Base Programmer 123 Questions (112)
The contents of the raw data file SIZE are listed below:
----|----10---|----20---|----30 72 95
The following SAS program is submitted:
data test; infile 'size'; input@ 1 height 2. @ 4 weight 2; run;
Which one of the following is the value of the variable WEIGHT in the output data set?
A. 2
B. 72
C. 95
D. . (missing numeric value)