Certification Summary---Reading SAS Data Sets

User:Ywang10/Work

Points to remember

 * When you perform By-group processing, the data sets that are listed in the SET statement must either be sorted by the values of the BY variables, or they must have an appropriate index.


 * When using direct access to read data, you must prevent continuous looping. Add a STOP statement to the DATA step, or use programming logic that checks for an invalid value of the POINT=variable.


 * Do not specify the END=option with the POINT=option in a SET statement.

1.
Assuming that the data set Company.USA has five or more observations, what is the result of submitting the following program?

data work.getobs5(drop=obsnum); obsnum=5; set company.usa(keep=manager payroll) point=obsnum; output; stop; run;

a. an error

b. an empty data set

c. a continous loop

d. a data set that contains one observation

Correct answer:d

By combinig the POINT=option with the OUTPUT and STOP statements, your program can write a single observation to output.

2.
Which of the following programs correctly reads the data set Orders and creates the data set FastOrdr?

a.data catalog.fastordr(drop=ordrtime); set july.orders(keep=product units price); if ordrtime<4; Total=units*price; Run; b.data catalog.orders(drop=ordrtime); set july. fastordr( (keep=product units price);  if ordrtime<4; Total=units*price; Run; c. data catalog. fastordr( (drop=ordrtime); set july.orders(keep=product units price ordrtime); if ordrtime<4; Total=units*price; Run; d. none of the above

Correct answer:c.

3.
There are 500 observations in the data set Company.USA. What is the result of submitting the following program?

Data work.getobs5(drop=obsnum); Obsunm=5; Set company.usa(keep=manager payroll) point=obsnum; Stop; Run;

a.an error

b.an empty data set

c.a continous loop

d.a data set that contains one observation

Correct answer:b