The following SAS program is submitted:
data work.sales;
do year = 1 to 5;
do month = 1 to 12;
x + 1;
end;
end;
run;
do year = 1 to 5;
do month = 1 to 12;
x + 1;
end;
end;
run;
Which one of the following represents how many observations are written to the WORK.SALES data set?
A. 0
B. 1
C. 5
D. 60
A. 0
B. 1
C. 5
D. 60
5 comments:
Answer B
Since there is NO explicit OUTPUT statement the output will have 1 obs only
B.
data work.sales;
do year = 1 to 5;
do month = 1 to 12;
x + 1;
output; end; /*60 with this output statement 'D' */
output; end; /* 5 with this out put statement 'C"*/
run; /* 1 with no output statement 'B' */
What will be the value of x? 60?
@ Pooja: Yes X = 60
If there is no OUTPUT statament, SAS will automatically substitute an implicit OUTPUT statement just before the run. (Also a Return). I do not know if that occurs during compiletime or executing time.
Post a Comment