Quiz

Select the best answer for each question. After completing the quiz, check your answers using the answer key in the appendix.
  1. The %INCLUDE statement
    1. can be used to insert the contents of an external file into a program.
    2. can cause 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. can be specified with the SOURCE2 option in order to write the contents of the external file that is inserted into a program to the SAS log.
    4. all of the above
  2. 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. you can use the PROC CATALOG statement to compile the macro.
    3. the SOURCE entry is deleted at the end of the session.
    4. you do not need to compile the macro before you invoke it in a program.
  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. If you use the Stored Compiled Macro Facility,
    1. the macro processor does not compile a macro every time it is used.
    2. the only compiled macros that the Stored Compiled Macro Facility can access are those that are stored in the Sasmacr catalog.
    3. you need to specify the MSTORED and SASMSTORE= system options.
    4. all of the above
  5. Which of the following correctly creates a permanently stored compiled macro?
    1. libname macrolib 'c:mylib';
      options sasmstore;
      %macro prtlast; / store
         proc print data=&syslast (obs=5);
            title "Listing of &syslast data set";
         run;
      %mend;
    2. libname macrolib 'c:mylib';
      options mstored sasmstore=macrolib;
      %macro prtlast / store;
         proc print data=&syslast (obs=5);
            title "Listing of &syslast data set";
         run;
      %mend;
    3. libname macrolib 'c:mylib';
      options mstored sasmstore=macrolib;
      %macro prtlast;
         proc print data=&syslast (obs=5);
            title "Listing of &syslast data set";
         run;
      %mend;
    4. libname macrolib 'c:mylib';
      %macro prtlast / store;
         proc print data=&syslast (obs=5);
            title "Listing of &syslast data set";
         run;
      %mend;
  6. 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.
  7. 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
  8. What does the following PROC CATALOG step do?
    proc catalog cat=mylib.sasmacr;
       contents;
    quit;
    1. Copy the contents of the Sasmacr catalog to a temporary data set.
    2. List the contents of the Sasmacr catalog as output.
    3. Copy the contents of the output window to the Sasmacr catalog.
    4. none of the above
  9. Which of the following is not true about stored compiled macros?
    1. Because these stored macros are compiled, you should save and maintain the source for the macro definitions in a different location.
    2. The Stored Compiled Macro Facility compiles and saves compiled macros in a permanent catalog, in a library that you specify.
    3. You do not need to specify any system options in order to use the Stored Compiled Macro Facility.
    4. You cannot move a stored compiled macro to another operating system.
  10. 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 in conjunction with the Stored Compiled Macro Facility.
..................Content has been hidden....................

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