By admin | July 28, 2009

SAS Certified Base Programmer 50 Questions (10)

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?

a. 0
b. 1
c. 2
d. 4

2 comments | Add One

  1. SAS Tutor - 08/5/2009 at 3:15 pm

    C

  2. pranil - 04/20/2014 at 7:50 am

    Plz explain sas guru

Leave a Comment

Leave a Reply

Your email address will not be published.