Quiz

Select the best answer for each question. After completing the quiz, check your answers using the answer key in the appendix.
  1. Which of the following statements about the %INCLUDE statement is correct?
    1. It can be used to insert the contents of an external file into a program.
    2. It causes a macro definition that is stored in an external file to be compiled when the contents of that file are inserted into a program and submitted.
    3. It can be specified with the SOURCE2 option in order to write to the SAS log the contents of the external file that is inserted into a program.
    4. All of the above.
  2. What happens if you store a macro definition in a SAS catalog SOURCE entry?
    1. The macro definition can be submitted for compilation by using the FILENAME and %INCLUDE statements.
    2. The SOURCE entry will be deleted at the end of the session.
    3. You do not need to compile the macro before you invoke it in a program.
    4. All of the above.
  3. Which of the following programs correctly sets the appropriate system options and calls the macro Prtlast? Assume that Prtlast is stored in an autocall library as a text file and that it has not been compiled during the current SAS session.
    1. libname mylib 'c:mylib';
      filename macsrc 'mylib.macsrc';
      options mautosource sasautos=(macsrc, sasautos);
      %prtlast
    2. libname mylib 'c:mylib';
      filename macsrc catalog 'mylib.macsrc';
      %prtlast
    3. filename mylib 'c:mylib';
      options mautosource sasautos=(sasautos,mylib);
      %prtlast
    4. libname mylib 'c:mylib';
      options mautosource sasautos=mylib;
      %prtlast
  4. When you submit the following code, what happens?
    %macro prtlast;
       proc print data=&syslast (obs=5);
          title "Listing of &syslast data set";
       run;
    %mend;
    1. A session compiled macro named Prtlast is stored in Work.Sasmacr.
    2. A macro named Prtlast is stored in the autocall library.
    3. The Prtlast macro is stored as a stored compiled macro.
    4. The Prtlast macro is stored as a SOURCE entry in a permanent SAS catalog.
  5. Why would you want to store your macros in external files?
    1. You could easily share your macros with others.
    2. You could edit your macros with any text editor.
    3. Your macros would be available for use in later SAS sessions.
    4. All of the above.
  6. Which of the following is not true?
    1. The autocall macro facility stores compiled SAS macros in a collection of external files called an autocall library.
    2. Autocall libraries can be concatenated together.
    3. One disadvantage of the autocall facility is that the first time you call an autocall macro in a SAS session, the macro processor must use system resources to compile it.
    4. The autocall facility can be used with the stored compiled macro facility.
  7. Suppose you had the program below, and you wanted to concatenate the values from the libname and memname columns to create a call to %Report3 for each row of data read. Which option would correctly run the program below and generate a result?
    data _null_;
       set sashelp.vtable;
       where libname='MC1' and memtype='DATA';
       rc=_______________________;
    run;
    1. rc=dosubl(cats('%Report3(',catx(',',libname,memname),')')); 
    2. rc=dosubl(catx(%Report3(',catx(',',libname,memname),')'));
    3. rc=dosubl(catx(%Report3,',libname,memname),')');
    4. rc=dosubl(cats(%Report3,',libname,memname),')');
  8. When does the DOSUBL function execute the text string?
    1. The function executes the text string during the compilation phase.
    2. The function executes the text string immediately.
    3. The function does not execute the text string. The text string is stored as a macro.
    4. The function executes the text string, but does not return any values.
Last updated: October 16, 2019
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.134.109.14