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 is false?
    1. A macro variable can be defined and referenced anywhere in a SAS program except within data lines.
    2. Macro variables are always user-defined, and their values remain constant until they are changed by the user.
    3. Macro variables are text strings that are independent of SAS data sets.
    4. The values of macro variables can be up to 65,534 characters long.
  2. Which of the following TITLE statements correctly references the macro variable month?
    1. title "Total Sales for '&month' ";
    2. title "Total Sales for 'month'";
    3. title "Total Sales for &month";
    4. title Total Sales for "&month";
  3. Which of the following statements generates an error message while trying to display the value of the macro variable month in the SAS log?
    1. options &month;
    2. %PUT &month;
    3. options symbolgen;
    4. %PUT the macro variable MONTH has the value &month.;
  4. Which statement creates a macro variable named location that has the value storage?
    1. &let location = storage;
    2. let &location = storage;
    3. %let location = "storage";
    4. %let location = storage;
  5. What value do these statements assign to the macro variable reptitle:
    %let area = "Southeast";
    %let reptitle = *  Sales Report for &area Area  *;
    1. Sales Report for Southeast Area
    2. Sales Report for "Southeast" Area
    3. *Sales Report for "Southeast" Area*
    4. * Sales Report for "Southeast" Area *
  6. Assuming that you began your SAS session today, which of the following statements correctly sets the macro variable currdate to today's date:
    1. %let currdate = %sysfunc(today(), worddate.);
    2. %let currdate = &sysdate9;
    3. %let currdate = %sysfunc(date());
    4. all of the above
  7. Macro character functions
    1. can be used to manipulate character strings in macro variable values.
    2. have the same basic syntax as the corresponding DATA step functions and yield similar results.
    3. all of the above
    4. none of the above
  8. The four types of tokens that SAS recognizes are
    1. expressions, literals, names, and special characters.
    2. literals, names, numbers, and special characters.
    3. expressions, names, numbers, and special characters.
    4. expressions, literals, numbers, and special characters.
  9. What are the resulting values for the macro variables that are defined here?
    	%let month1 = June;
    	%let month2 = July;
    	%let period1 = &month1&month2;
    	%let period2 = May&month1;
    	%let period3 = &month2.Aug;
    1. month1 Junemonth2 Julyperiod1 June Julyperiod2 May Juneperiod3 July Aug
    2. month1 Junemonth2 Julyperiod1 JuneJulyperiod2 MayJuneperiod3 July.Aug
    3. month1 Junemonth2 Julyperiod1 JuneJulyperiod2 MayJuneperiod3 JulyAug
    4. month1 Junemonth2 Julyperiod1 junejulyperiod2 Mayjuneperiod3 julyaug
  10. Which of the following correctly produces a title in which the current date is left-justified in order to remove extra blanks?
    1. title "Report for %sysfunc(left(%sysfunc(today(),worddate.)))";
    2. title "Report for %sysfunc(left(today(), worddate.))";
    3. title "Report for %sysfunc(left(%qsysfunc(today(), worddate.)))";
    4. title "Report for %left(today(), worddate.))";
..................Content has been hidden....................

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