SAS Certified Base Programmer 123 Questions (117)
The following SAS program is submitted:
data work.totalsales (keep=monthsales{12}); set work.monthlysales (keep=year product sales); array monthsales {12}; do i=1 to 12; monthsales{i}=sales; end; 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 executes with warnings and creates the WORK.TOTALSALES data set.
D. The program executes without errors or warnings and creates the WORK.TOTALSALES data set.
Topics:
SAS Base Questions |
8 Comments »
B
to get the appropiate result , wat whould be d correct syntax?
why syntax error
Ans -B
Arrays name can not be included in keep /drop options
Please explain
array does not stored with the data set.
Hi Admin,could you please explain??thanks
For the question why an array cannot be kept, my understanding is that the array in sas is only a way designed to manipulate data not store data. Variables stores data in sas.