Question
Question
Ans:
DATA FACTORIAL;
DO N = 1 TO 12;
OUTPUT;
END;
RUN;
RUN;
2.What is the smallest length for a numeric and character variable respectively ?
observation.
Exp:
data average ;
set temp ;
run ;
proc sort ;
by month ;
run ;
proc means ;
by month ;
var avgtemp ;
run ;
5. Can you execute macro within another macro? If so, how would SAS know
where the current macro ended and the new one began?
6. When reading a NON SAS external file what is the best way of reading the file?
Ans: Use the INPUT statement with pointer control - ex: INPUT @1 dateextr
mmddyy8. etc.
7. If you use a SYMPUT in a DATA step, when and where can you use the macro
variable?
Ans:
data _null_;
run;
var &varlist;
run;
Ans:
SYMPUT provides a way to turn DATA step variables into macro variables, and
SYMGET does the converse,
grabbing macro variable values and assigning them to DATA step variables.
Comparisons
SYMGET returns values of macro variables during program execution,
whereas the SYMPUT function assigns values that are produced by a
program to macro variables during program execution.
SYMGET accepts fewer types of arguments than the RESOLVE function.
SYMGET resolves only a single macro variable. Using RESOLVE may result
in the execution of macros and further resolution of values.
SYMGET is available in all SAS programs, but SYMGETN is available only in
SCL programs.
9. Describe the validation procedure? How would you perform the validation for
TLG as well as analysis data set?