ElearnSAS.com

ElearnSAS.com
SAS Learning Platform

Base SAS 96

The following SAS DATA step is submitted:
data sasdata.atlanta
sasdata.boston
work.portland
work.phoenix;
set company.prdsales;
if region = 'NE' then output boston;
if region = 'SE' then output atlanta;
if region = 'SW' then output phoenix;
if region = 'NW' then output portland;
run;
Which one of the following is true regarding the output data sets?
A. No library references are required.
B. The data sets listed on all the IF statements require a library reference.
C. The data sets listed in the last two IF statements require a library reference.
D. The data sets listed in the first two IF statements require a library reference.
Click Comment link to get answer

13 comments:

  1. Anonymous7:48 AM

    output boston; (sasdata.atlanta)
    output atlanta; (sasdata.boston)

    D. The data sets listed in the first two IF statements require a library reference.

    ReplyDelete
  2. Anonymous4:01 AM

    why not c?

    ReplyDelete
  3. Anonymous7:32 PM

    it cannot be C as the last 2 datasets are in work library, and its not compulsory to give lib reference for work lib..

    ReplyDelete
  4. sreelakshmi1:38 AM

    ans is "D"

    ReplyDelete
  5. Anonymous5:29 PM

    There is something missing here... Can anybody give perfect explanation. i dont believe with explanation
    output boston; (sasdata.atlanta)
    output atlanta; (sasdata.boston)

    ReplyDelete
    Replies
    1. Anonymous9:54 PM

      boston and atlanta are the permanent datasets as they are from the library sasdata. So, any references to these two datasets should be used with their library name. However, the other 2 - portland and phoenix are from work which is the default library. Any data sets in the work directory need not be referred with its libname. They can be accessed directly, as the default library is always work.

      Delete
  6. Anonymous9:44 PM

    Well SAS automatically assigns the lib Work when a lib is not specified. If you want to assign your data set to a libname other than Work, you must explicitly define (point to a location in a LIBNAME statement) the library before it can be assigned.
    Greg

    ReplyDelete
  7. D is the answer. Library references is a requirement if the output is required to be written to a permanent library or a library other than work library.

    ReplyDelete