SAS Chapter 4: Creating List Reports

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,578
Questions: 10 | Attempts: 411

SettingsSettingsSettings
SAS Chapter 4: Creating List Reports - Quiz

Preparation for the SAS basic certification exam.


Questions and Answers
  • 1. 

    Which PROC PRINT step below creates the following output

    • A.

      Proc print data=flights.laguardia noobs;      var on changed flight;      where on>=160; run;

    • B.

      Proc print data=flights.laguardia;      var date on changed flight;      where changed>3; run;

    • C.

      proc print data=flights.laguardia label;      id date;      var boarded transferred flight;      label boarded='On' transferred='Changed';      where flight='219'; run;

    • D.

      Proc print flights.laguardia noobs;      id date;      var date on changed flight;      where flight='219'; run;

    Correct Answer
    C. proc print data=flights.laguardia label;      id date;      var boarded transferred flight;      label boarded='On' transferred='Changed';      where flight='219'; run;
    Explanation
    The DATA= option specifies the data set that you are listing, and the ID statement replaces the Obs column with the specified variable. The VAR statement specifies variables and controls the order in which they appear, and the WHERE statement selects rows based on a condition. The LABEL option in the PROC PRINT statement causes the labels specified in the LABEL statement to be displayed.

    Rate this question:

  • 2. 

    Which of the following PROC PRINT steps is correct if labels are not stored with the data set?

    • A.

      Proc print data=allsales.totals label;      label region8='Region 8 Yearly Totals'; run;

    • B.

      Proc print data=allsales.totals;      label region8='Region 8 Yearly Totals'; run;

    • C.

      Proc print data allsales.totals label noobs; run;

    • D.

      Proc print allsales.totals label; run;

    Correct Answer
    A. Proc print data=allsales.totals label;      label region8='Region 8 Yearly Totals'; run;
    Explanation
    You use the DATA= option to specify the data set to be printed. The LABEL option specifies that variable labels appear in output instead of variable names.

    Rate this question:

  • 3. 

    Which of the following statements selects from a data set only those observations for which the value of the variable Style is RANCH, SPLIT, or TWOSTORY?

    • A.

      Where style='RANCH' or 'SPLIT' or 'TWOSTORY';

    • B.

      Where style in 'RANCH' or 'SPLIT' or 'TWOSTORY';

    • C.

      Where style in (RANCH, SPLIT, TWOSTORY);

    • D.

      Where style in ('RANCH','SPLIT','TWOSTORY');

    Correct Answer
    D. Where style in ('RANCH','SPLIT','TWOSTORY');
    Explanation
    In the WHERE statement, the IN operator enables you to select observations based on several values. You specify values in parenthesis ans separated by spaces or commas. Character values must be enclosed in quotation marks and must be in the same case as in the data set.

    Rate this question:

  • 4. 

    If you want to sort your data and create a temporary data set named Calc to store the sorted data, which of the following steps should you submit?

    • A.

      Proc sort data=work.calc out=finance.dividend; run;

    • B.

      Proc sort dividend out=calc;       by account; run;

    • C.

      Proc sort data=finance.dividend out=work.calc;      by account; run;

    • D.

      Proc sort from finance.dividend to calc;      by account; run;

    Correct Answer
    C. Proc sort data=finance.dividend out=work.calc;      by account; run;
    Explanation
    In a PROC SORT step, you specify the DATA= option to specify the data set to sort. The OUT= option specifies an output data set. The required BY statement specifies the variable(s) to use in sorting the data.

    Rate this question:

  • 5. 

    Which options are used to create the following PROC PRINT output?

    • A.

      The DATE system option and the label option in PROC PRINT

    • B.

      The DATE and NONUMBER system option and the DOUBLE and NOOBS options in PROC PRINT

    • C.

      The DATE and NONUMBER system options and the DOUBLE option in PROC PRINT

    • D.

      The DATE and the NONUMBER system options and the NOOBS option in PROC PRINT

    Correct Answer
    B. The DATE and NONUMBER system option and the DOUBLE and NOOBS options in PROC PRINT
    Explanation
    The DATE and NONUMBER system options cause the output to appear with the date but without page numbers. In the PROC PRINT step, the DOUBLE option specifies double spacing, and the NOOBS option removes the default Obs column.

    Rate this question:

  • 6. 

    Which of the following statements can you use in a PROC PRINT step to create this output?

    • A.

      Var month instructors; sum instructors aerclass walkjogrun swim;

    • B.

      Var month; sum instructors aerclass walkjogrun swim;

    • C.

      Var month instructors aerclass; sum instructors aerclass walkjogrun swim;

    • D.

      All of the above

    Correct Answer
    D. All of the above
    Explanation
    You do not need to name the variables in a VAR statement if you specify them in the SUM statement, but you can. If you choose not to name the variables in the VAR statement as well, then the SUM statement determines their order in the output.

    Rate this question:

  • 7. 

    What happens if you submit the following program? proc sort data=clinic.diabetes; run; proc print data=clinic.diabetes;      var age height weight pulse;      where sex='F'; run;

    • A.

      The PROC PRINT step runs successfully, printing observations in their sorted order.

    • B.

      The PROC SORT step permanently sorts the input data set.

    • C.

      The PROC SORT step generates errors and stops processing, but the PROC PRINT step runs successfully, printing observations in their original (unsorted) order.

    • D.

      The PROC SORT step runs successfully, but the PROC PRINT step generates errors and stops processing.

    Correct Answer
    C. The PROC SORT step generates errors and stops processing, but the PROC PRINT step runs successfully, printing observations in their original (unsorted) order.
    Explanation
    The BY statement is required in PROC SORT. Without it, the PROC SORT step fails. However, the PROC PRINT step prints the original data set as requested.

    Rate this question:

  • 8. 

    If you submit the following program, which output does it create? proc sort data=finance.loans out=work.loans;      by months amount; run; proc print data=work.loans noobs;      var months;      sum amount payment;      where months<360; run;

    Correct Answer
    A.
    Explanation
    Column totals appear at the end of the report in the same format as the values of the variables, so b is incorrect. Work.Loans is sorted by the Month and Amount, so c is incorrect. The program sums both Amount and Payment, so d is incorrect.

    Rate this question:

  • 9. 

    Choose the statement below that selects rows in which 
    • the amount is less than or equal to $5000
    • the account is 101-1092 or the rate equals 0.095.

    • A.

      Where amount <= 5000 and       account='101-1092' or rate =0.095;

    • B.

      Where (amount le 5000 and account='101-1092')      or rate =0.095;

    • C.

      Where amount <= 5000 and       (account='101-1092' or rate eq 0.095);

    • D.

      Where amount <= 5000 or account='101-1092'      or rate = 0.095;

    Correct Answer
    C. Where amount <= 5000 and       (account='101-1092' or rate eq 0.095);
    Explanation
    To ensure that the compound expression is evaluated correctly, you can use parentheses to group (account='101-1092' or rate eq 0.095)

    Rate this question:

  • 10. 

    What does PROC PRINT display by default?

    • A.

      PROC PRINT does not create a default report; you must specify the rows and columns to be displayed.

    • B.

      PROC PRINT displays all observations and variables in the data set. If you want an additional column for observation numbers, you can request it.

    • C.

      PROC PRINT displays columns in the following order: a column for observation numbers, all character variables, and all numeric variables.

    • D.

      PROC PRINT displays all observations and variables in the data set, a column for observation numbers on the far left, and variables in the order in which they occur in the data set.

    Correct Answer
    D. PROC PRINT displays all observations and variables in the data set, a column for observation numbers on the far left, and variables in the order in which they occur in the data set.
    Explanation
    You can remove the column for observation numbers. You can also specify the variables you want, and you can select observations according to conditions.

    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
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Jan 14, 2013
    Quiz Created by
    Moxleyv

Related Topics

Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.