Quiz Yourself Now

Have fun with some MACRO mania:

A) What value will be stored in macro variable total?

%let total = 111+222;
  1. 111
  2. 333
  3. 222
  4. 111+222

B) How would you store value 333 in macro variable total?

  1. %let total = %eval(111+222);
  2. %let total = (111+222);
  3. %let total = “111+222";
  4. %let = add(111, 222);

C) What delimiter is used to recognize end of macro reference?

  1. Ampersand &
  2. Period .
  3. Percent %

D) What is the data structure called where macro variables along with their values are stored?

  1. Input stack
  2. Symbol table
  3. Macro Processor
  4. Word scanner
  5. Compiler

E) Following options can be used with which % statement to display names of macro variables: _ALL_ _AUTOMATIC_  _GLOBAL_ _LOCAL_ _USER_

  1. %mend
  2. %let
  3. %put
  4. %macro

F) What is the appropriate way to invoke macro named checkdates?

  1. %let checkdates
  2. %checkdates
  3. %macro checkdates

G) How would you insert comments in macro?

  1. /* Insert Comment Here */
  2. %* Insert Comment Here ;
  3. None of the above
  4. Both first and second option

H) Some advantages of using parameters in macro definition is

  1. It results in fewer  %LET statements
  2. Ensures that variables never interfere with parts of your program outside macro
  3. Both of the above

I) What is printed in SAS Log?
%macro names(first= ,last= );
%put Your first name is &first;
%mend
 

%names(first=Jim,last=Goodnight);

  1. Jim
  2. Jim Goodnight
  3. Your first name is Jim
  4. Nothing

J) Which system option would you use to display resolution of macro variables?

  1. Options gen ;
  2. Options symbolgen;
  3. Options symbol;


Scroll down for answers
A - 4 ; B - 1 ; C - 2 ; D - 2 ; E - 3 ; F - 2 ; G - 4 ; H - 3 ; I - 3 ; J - 2

No comments:

Post a Comment