SAS Training Self-Assessment

Creating Stored Processes Using SAS 2: Additional Topics

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

  1. Which of the following statements about SAS Stored Processes is true?

     a.   A SAS Stored Process consists of both SAS program code and SAS metadata.
     b.   A SAS Stored Process can be run only by the person who created it.
     c.   A SAS Stored Process is always static and creates the same results for every user every time it runs.
     d.   All SAS Stored Processes can be accessed by everyone regardless of security settings.


  2. Which of the following methods for populating a prompt is required when creating a cascading prompt?

     a.   User enters values
     b.   User selects values from a static list
     c.   User selects values from a dynamic list


  3. Cascading prompts can be created for any prompt type?

     a.   Yes
     b.   No


  4. Selection groups enable you to display different prompts based on a condition.

     a.   Yes
     b.   No


  5. The following is part of the SAS code for a stored process:
          %global year month;
          %let year=2011;
          %let month=12;
    These prompt values are specified when the stored process is run:

    Prompt Value
    year 2012
    month 5

    What happens if the %LET statements are not removed from the SAS code?

     a.   The stored process does not run and creates an error.
     b.   The stored process runs and creates results for May 2012.
     c.   The stored process runs and creates results for December 2011.


  6. Which is a valid LIBNAME statement?

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


  7. Which statement reads a SAS data set?

     a.   SET
     b.   READ
     c.   INPUT
     d.   INFILE


  8. Consider the following program:
        <insert statement here>          
            proc print data=customers;
            run;
         ods html close;
    Which statement correctly starts the capture of HTML output and names an HTML result file?

     a.   ods html;
     b.   ods html open;
     c.   ods html file='myfile.html';
     d.   ods html open file='myfile.html';


  9. Consider the following global symbol table:

    Global Symbol Table
    TEACH1 Hallis, Dr. George
    TEACH2 Wickam, Dr. Alice
    TEACH3 Forest, Mr. Peter
    CRS 3

    What value does a reference to &&TEACH&CRS resolve to?

     a.   TEACH3
     b.   &TEACH3
     c.   &TEACH&CRS
     d.   Forest, Mr. Peter


  10. Which example defines a macro named Print that correctly implements parameters named vars and total?

     a.  
    %macro Print(&vars,&total);
       proc print data=classes;
          var vars;
          sum total;
       run;
    %mend Print;
     b.  
    %macro Print(vars,total);
       proc print data=classes;
          var &vars;
          sum &total;
       run;
    %mend Print;
     c.  
    %macro Print('vars','total');
       proc print data=classes;
          var &vars;
          sum &total;
       run;
    %mend Print;
     d.  
    %macro Print(vars,total);
       proc print data=classes;
          var :vars;
          sum :total;
       run;
    %mend Print;


  11. Which example correctly compares the value of the macro variable MacVar to a null value?

     a.  
    %macro test;
       %if &MacVar = %then %do;
          %put value of MacVar is null;
       %end;
    %mend;
     b.  
    %macro test;
       %if &MacVar = _null_ %then %do;
          %put value of MacVar is null;
       %end;
    %mend;
     c.  
    %macro test;
       %if &MacVar = " " %then %do;
          %put value of MacVar is null;
       %end;
    %mend;
     d.  
    %macro test;
       %if "MacVar" = %then %do;
          %put value of MacVar is null;
       %end;
    %mend;


  12. Consider the following global symbol table:

    Global Symbol Table
    DSN1 employee
    DSN2 payroll
    DSN3 customer
    N 3

    Which macro program produces a listing report for each of the data set names stored in DSN1 through DSN3?

     a.  
    %macro Test;
      %do i=1 %to n;
        proc print data=&&DSN&i;
        run;
      %end;
    %mend;
     b.  
    %macro Test;
      %do i=1 %to &n;
        proc print data=&&DSN&i;
        run;
      %end;
    %mend;
     c.  
    %macro Test;
      %do i=1 %to &n;
        proc print data=&DSN&i;
        run;
      %end;
    %mend;
     d.  
    %macro Test;
      %do &i=1 %to &n;
        proc print data=&&DSN&i;
        run;
      %end;
    %mend;