Business Intelligence Quiz: Reading SAS Data Sets Overview

Approved & Edited by ProProfs Editorial Team
The editorial team at ProProfs Quizzes consists of a select group of subject experts, trivia writers, and quiz masters who have authored over 10,000 quizzes taken by more than 100 million users. This team includes our in-house seasoned quiz moderators and subject matter experts. Our editorial experts, spread across the world, are rigorously trained using our comprehensive guidelines to ensure that you receive the highest quality quizzes.
Learn about Our Editorial Process
| By Moxleyv
M
Moxleyv
Community Contributor
Quizzes Created: 38 | Total Attempts: 20,684
Questions: 10 | Attempts: 243

SettingsSettingsSettings
Business Intelligence Quiz: Reading SAS Data Sets Overview - Quiz

In the study of computing, the term “Statistical Analysis System” (or SAS) refers to a software suite developed by the SAS Institute for use in the fields of advanced analytics, multivariate analysis, business intelligence, predictive analytics, and data management. What do you know of SAS and how its data is recorded?


Questions and Answers
  • 1. 

    If you submit the following program, which variables appear in the new data set? data work.cardiac(drop=age group);    set clinic.fitness(keep=age weight group);    if group=2 and age>40; run;

    • A.

      None

    • B.

      Weight

    • C.

      Age, Group

    • D.

      Age, Weight, Group

    Correct Answer
    B. Weight
    Explanation
    The variables Age, Weight, and Group are specified using the KEEP= option in the SET statement. After processing, Age and Group are dropped in the DATA statement.

    Rate this question:

  • 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. Data catalog.fastordr(drop=ordrtime);    set july.orders(keep=product units price                    ordrtime);    if ordrtime<4;    Total=units*price; run;
    Explanation
    You specify the data set to be created in the DATA statement. The DROP= data set option prevents variables from being written to the data set. Because you use the variable OrdrTime when processing, you cannot drop OrdrTime in the SET statement. If you use the KEEP= option in the SET statement, then you must list OrdrTime as one of the variables to be kept.

    Rate this question:

  • 3. 

    Which of the following Statements is false about BY-group processing?      When you use the BY statement with the SET statement:

    • A.

      The data sets listed in the SET statement must be indexed or sorted by the values of the BY variable(s).

    • B.

      The DATA step automatically creates two variables, FIRST., and LAST., for each variable in the BY statement.

    • C.

      FIRST. and LAST. identify the first and last observation in each BY group, respectively.

    • D.

      FIRST. and LAST. are stored in the data set.

    Correct Answer
    D. FIRST. and LAST. are stored in the data set.
    Explanation
    When you use the BY statement with the SET statement, the DATA step creates the temporary variables FIRST. and LAST. They are not stored in the data set.

    Rate this question:

  • 4. 

    There are 500 observations in the data set Usa.  What is the result of submitting the following program? data work.getobs5(drop=obsnum);    obsnum=5;    set company.usa(keep=manager payroll) point=obsnum;    stop; run;

    • A.

      An error

    • B.

      An empty data set

    • C.

      Continuous loop

    • D.

      A data set that contains one observation

    Correct Answer
    B. An empty data set
    Explanation
    The DATA step writes observations to output at the end of the DATA step. However, in this program, the STOP statement stops processing before the end of the DATA step. An explicit OUTPUT statement is needed in order to produce observations.

    Rate this question:

  • 5. 

    There is no end-of-file condition when you use direct access to read data, so how can your program prevent a continuous loop?

    • A.

      Do not use a POINT= variable.

    • B.

      Check for an invalid value of the POINT= variable.

    • C.

      Do not use an END= variable.

    • D.

      Include an OUTPUT statement.

    Correct Answer
    B. Check for an invalid value of the POINT= variable.
    Explanation
    To avoid a continuous loop when using direct access, either include a STOP statement or use programming logic that checks for an invalid value of the POINT= variable. If SAS reads an invalid value of the POINT= variable, it sets the automatic variable _ERROR_ to 1. You can use this information to check for conditions that cause continuous processing.

    Rate this question:

  • 6. 

    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 continuous loop

    • D.

      A data set that contains one observation

    Correct Answer
    D. A data set that contains one observation
    Explanation
    By combining the POINT= option with the OUTPUT and STOP statements, your program can write a single observation to output.

    Rate this question:

  • 7. 

    Which of the statements is true regarding direct access of data sets?

    • A.

      You cannot specify END= with POINT=.

    • B.

      You cannot specify OUTPUT with POINT=.

    • C.

      You cannot specify STOP with END=.

    • D.

      You cannot specify FIRST. with LAST.

    Correct Answer
    A. You cannot specify END= with POINT=.
    Explanation
    The END= option and POINT= option are incompatible in the same SET statement. Use one or the other in your program.

    Rate this question:

  • 8. 

    What is the result of submitting the following program? data work.addtoend;    set clinic.stress2 end=last;    if last; run;

    • A.

      An error

    • B.

      An empty data set

    • C.

      A continuous loop

    • D.

      A data set that contains one observation

    Correct Answer
    D. A data set that contains one observation
    Explanation
    This program uses the END= option to name a temporary variable that contains an end-of-file marker. That variable _last_ is set to 1 when the set statement reads the last observation of the data set.

    Rate this question:

  • 9. 

    At the start of DATA step processing, during the compilation phase, variables are created in the program data vector (PDV), and observations are set to:

    • A.

      Blank

    • B.

      Missing

    • C.

      0

    • D.

      There are not observations

    Correct Answer
    D. There are not observations
    Explanation
    At the bottom of the DATA step, the compilation phase is complete and the descriptor portion of the new SAS data set is created. There are no observations because the DATA step has not yet executed.

    Rate this question:

  • 10. 

    The DATA step executes:

    • A.

      Continuously if you use the POINT= option and the STOP statement.

    • B.

      Once for each variable in the output data set.

    • C.

      Once for each observation in the input data set.

    • D.

      Until it encounters and OUTPUT statement.

    Correct Answer
    C. Once for each observation in the input data set.
    Explanation
    The DATA step executes once for each observation in the input data set. You use the POINT= option with the STOP statement to prevent continuous looping.

    Rate this question:

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Feb 15, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Feb 01, 2013
    Quiz Created by
    Moxleyv
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.