SAS Macros Questions: Srikanth Potukuchi January 19, 2015
SAS Macros Questions: Srikanth Potukuchi January 19, 2015
Srikanth Potukuchi
January 19, 2015
1) The macro facility is a
and customizing SAS code.
(a) text
(b) word
(c) excel
(d) None
2) Macro programs support conditional construction of SAS code.
(a) True
(b) False
3) Macro programs support repetitive generation of SAS code.
(a) True
(b) False
4) Macro programs support dynamic data-driven generation of
SAS code.
(a) True
(b) False
5) When you submit a SAS program,it is copied to a memory
stack.
location called the
(a) output
(b) input
(c) subset
(d) pointer
Srikanth Potukuchi
symbol
(a) local
(b) global
11) Macro variables in the global symbol table store numeric tokens as text.
(a) True
(b) False
Page 2
Srikanth Potukuchi
12)The value of the macro variable created by the % LET statement, %let sum=3+4, is 7.
(a) True
(b) False
13)Which WHERE statement is correct?
(a) where City=&office;
(b) where City=&office;
(c) where City=&office;
14)Which system option writes macro variable values to the SAS
log as they are resolved?
(a) options all ;
(b) options symdel;
(c) options symbolgen;
(d) options nosymbolgen;
15)A macro variable reference can appear anywhere,but additional
syntax is sometimes required. Which of the following might pose a
problem?
(a) Leading text
(b) Adjacent macro variable references
(c) Trailing text
(d) None
(e) All
Page 3
Srikanth Potukuchi
Page 4
Srikanth Potukuchi
(a) A
(b) B
(c) C
Page 5
Srikanth Potukuchi
Page 6
Srikanth Potukuchi
Page 7
Srikanth Potukuchi
Page 8
option.
Srikanth Potukuchi
));
Page 9
Srikanth Potukuchi
Page 10
Srikanth Potukuchi
SITE4 IL
DATA orion.customer
COUNT 7
VAR country
SITE3 DE
SITE2 CA
SITE1 AU
SITE7 ZA
SITE6 US
SITE5 TR
Page 11
Srikanth Potukuchi
(a) DE
(b) AU
(c) ZA
(d) CA
47) Given the symbol table, what is the value of &&&SITE&COUNT?
SPLIT
SPLIT
SPLIT
SPLIT
SPLIT
SPLIT
SPLIT
SPLIT
SPLIT
SPLIT
SITE4 IL
DATA orion.customer
COUNT 7
VAR country
SITE3 DE
SITE2 CA
SITE1 AU
SITE7 ZA
SITE6 US
SITE5 TR
(a) DE
(b) AU
(c) ZA
(d) CA
(e) None
48) Given the symbol table, what is the value of &&&SITE&&COUNT?
SPLIT
SPLIT
SPLIT
SPLIT
SPLIT
SPLIT
SPLIT
SPLIT
SPLIT
SPLIT
SITE4 IL
DATA orion.customer
COUNT 7
VAR country
SITE3 DE
SITE2 CA
SITE1 AU
SITE7 ZA
SITE6 US
SITE5 TR
Page 12
Srikanth Potukuchi
(a) DE
(b) AU
(c) ZA
(d) CA
(e) None
49)How many local symbol tables are created when macro A is
called and begins to execute?
%macro a(value=);
%b
%mend a;
%macro b;
%put The value to write is: &value.;
%put user ;
%mend b;
%a(value=Today is Monday)
(a) 1
(b) 3
(c) 2
(d) None
50)Identify in which symbol table the macro variable dog is located?
%let dog=Paisley;
%macro whereisit;
%put My dog is &dog;
%mend whereisit;
%whereisit
(a) Global Symbol Table
(b) Local Symbol Table
(c) None
Page 13
Srikanth Potukuchi
Page 14
Srikanth Potukuchi
Page 15
Srikanth Potukuchi
References
R
[1] Jim Simon & Linda Mitterling, SAS
Macro Language 1: Essentials. SAS
Institute Inc., NC, 2013.
Page 16