Question 54 : The SAS data set Sashelp.Prdsale contains the variables Region and Salary with 4 observations per Region.
Sashelp.Prdsale is sorted primarily by Region and with Region by Salary in descending order.
The following program is submitted:
data one;
set sashelp.prdsale;
retain temp;
by region descending salary;
if first.region then
do;
temp=salary;
output;
end;
if last.region then
do;
range=salary-temp;
output;
end;
run;
For each region, what is the number of observations(s) written to the output data set?
- 0
- Get all Questions and Answer from here
- You need to have paid subscription to access all questions
- Thanks for considering SAS Certification Material
Ans : 3
Exp : The expression first.region is true once for each region group. The expression last.region is true once for each region group. Therefore, each OUTPUT statement executes once
for a total of 2 observations in the output data set.
You can access to full explanation to question and answer from this page.