SAS Training Self-Assessment

SAS/GRAPH 1: Essentials

Select the best answer for each question. When you are finished, click Submit Quiz.

  1. What are the components of a SAS data set?

     a.   row portion and column portion
     b.   value portion and format portion
     c.   data portion and descriptor portion
     d.   variable portion and observation portion

  2. What are the required attributes of a variable?

     a.   name, type, and length
     b.   name, type, and format
     c.   name, label, and length
     d.   name, label, and format

  3. What is the default justification for a numeric variable in a PROC PRINT report?

     a.   left-justified
     b.   right-justified
     c.   center-justified
     d.   decimal-justified

  4. By default, when do labels appear in a PROC PRINT report?

     a.   always
     b.   only when the labels are permanent
     c.   only when a LABEL statement is in the PROC PRINT step
     d.   only when the LABEL option or SPLIT= option is in the PROC PRINT statement

  5. What determines colors and fonts when you send a PROC PRINT report to the ODS HTML destination?

     a.   the SAS data set
     b.   an ATTRIBUTE statement
     c.   ODS COLOR and ODS FONT statements
     d.   the default ODS style template or the template name specified in the STYLE= option

  6. Which data set option selects variables?

     a.   COL=
     b.   VAR=
     c.   KEEP=
     d.   SELECT=

  7. Which statement selects observations in a procedure step?

     a.   IF
     b.   RETAIN
     c.   WHERE
     d.   INCLUDE

  8. What sort sequence does PROC SORT use by default?

     a.   ascending order
     b.   descending order
     c.   numeric variable values in descending order and character values in ascending order
     d.   numeric variable values in ascending order and character values in descending order

  9. How do you end a SAS/GRAPH device-based procedure, such as PROC GREPLAY, with the correct step boundary so that the procedure terminates processing?

     a.   run;
     b.   quit;
     c.   stop;
     d.   ods _all_ close;

  10. Which symbol or value must character format names begin with?

     a.   dollar sign ($)
     b.   percent sign (%)
     c.   pound or hash sign (#)
     d.   character value (a-z or A-Z)

  11. What happens to output from a SAS/GRAPH program if the LISTING destination is closed and no other ODS destinations are open?

     a.   The SAS/GRAPH output is written to a work file, and no image is displayed in the GRAPH window.
     b.   SAS opens the HTML destination automatically and sends the SAS/GRAPH output to an ODS HTML output file.
     c.   No SAS/GRAPH output is created, and the SAS log shows the warning message WARNING: No output destinations active.
     d.   SAS automatically opens the LISTING destination and displays a note that says NOTE: The LISTING destination was opened for SAS/GRAPH output.

  12. Which is a valid LIBNAME statement?

     a.   libname 'c:\sasfiles';
     b.   libname mylib 'c:\sasfiles';
     c.   libname 'c:\sasfiles' mylib;
     d.   libname 'c:\sasfiles' libref=mylib;

  13. Consider the following PROC SORT step:
    proc sort data=customers;
       <insert statement here>
    Which statement completes the step and sorts the observations in descending order by ID and, within ID, in ascending order by LastName?

     a.   by ID descending LastName;
     b.   by descending ID LastName;
     c.   by descending ID ascending LastName;
     d.   by ID descending LastName ascending;

  14. Which TITLE statement correctly codes the title Fred's Report?

     a.   title "Fred's Report";
     b.   title 'Fred' ''s Report';
     c.   title ' "Fred's Report" ';
     d.   title allowquote(Fred's Report);

  15. Which option identifies an input SAS data set to a SAS procedure?

     a.   SET=
     b.   DATA=
     c.   INPUT=
     d.   INFILE=

  16. Which procedure creates bar charts?

     a.   PROC BARS
     b.   PROC VBAR
     c.   PROC GCHART

  17. Which statement clears all titles?

     a.   title;
     b.   clear titles;
     c.   clear_titles;
     d.   title clear all;

  18. Which statement correctly closes the LISTING destination?

     a.   ods;
     b.   ods close;
     c.   ods listing close;
     d.   ods _listing_ close;

  19. Where can ODS reports be viewed?

     a.   a browser
     b.   a word processor
     c.   the Output window in the windowing environment
     d.   all of the above

  20. What happens when a DATA step or PROC step contains multiple WHERE statements?

     a.   Only the first WHERE statement is processed.
     b.   The WHERE conditions are combined with a logical AND operator.
     c.   The last WHERE statement replaces previous WHERE statements.
     d.   A syntax error is displayed in the log, and the program does not execute.