Practice for the SAS advance certification exam
A %LET statement causes the macro processor to create a macro variable before the program is compiled.
To create a macro variable that is based on data calculated by the DATA step, you use the SYMPUT function.
Macro functions are always processed during the execution of the DATA step.
Macro variable references in a DATA step are always resolved prior to DATA step execution.
Rate this question:
data new; set sasuser.all; if location='Boston' then do; call symput('region', 'East'); end; else do; call symput('region', 'West'); end; run;
data new; set sasuser.all; if location='Boston' then do; %let region=East; end; else %let region=West; end; run;
data new; set sasuser.all; if location='Boston' then do; call symput(region, "East"); end; else call symput(region, "West"); end; run;
data new; set sasuser.all; if location='Boston' then do; symput(region, East); end; else symput(region, West); end; run;
Rate this question:
Be used to assign a data set variable as a value to a macro variable.
Create a series of macro variables in one DATA step.
Automatically convert a numeric value to a character value when used to assign a value to a macro variable in a DATA step.
Be used to assign a numeric value to a macro variable in an SCL program.
Rate this question:
data _null_; set sasuser.courses; call symput(course_code, trim(course_title)); %let crsid=C005; proc print data=sasuser.schedule noobs label; where course_code="&crsid"; var location begin_date teacher; title1 "Schedule for &c005"; run;
data _null_; set sasuser.courses; call symput(course_code, trim(course_title)); run; %let crsid=C005; proc print data=sasuser.schedule noobs label; where course_code="&crsid"; var location begin_date teacher; title1 "Schedule for &&&crsid"; run;
data _null_; set sasuser.courses; call symput('course_code', trim(course_title)); run; %let crsid=C005; proc print data=sasuser.schedule noobs label; where course_code="&crsid"; var location begin_date teacher; title1 "Schedule for &&&crsid"; run;
data _null_; set sasuser.courses; call symget(course_code, trim(course_title)); run; %let crsid=C005; proc print data=sasuser.schedule noobs label; where course_code="&crsid"; var location begin_date teacher; title1 "Schedule for &&&crsid"; run;
Rate this question:
Two ampersands resolve to one ampersand.
If more than four consecutive ampersands precede a name token, the macro processor generates an error message.
Re-scanning continues until there are no remaining macro triggers that the macro processor can resolve.
The macro processor always re-scans a name token that is preceded by multiple ampersands or by multiple percent signs.
Rate this question:
To create a DATA step variable from a macro variable value during the execution of the DATA step
To include a macro variable reference in a PROC SQL view
To access the value of a macro variable during the execution of an SCL program
All of the above
Rate this question:
Call symput(daily_fee, put(fee/days, dollar8.);
%let daily_fee=put(fee/days, dollar8.)
Select fee/days format=dollar8. into :daily_fee from sasuser.all;
Select fee/days format=dollar8. into daily_fee from sasuser.all;
Rate this question:
&TEACH3
TEACH3
Forest, Mr. Peter
None of the above
Rate this question:
Price=&daily_fee;
Price=symget(daily_fee);
Price=symget(&daily_fee);
Price=symget("daily_fee");
Rate this question:
The SYMPUT routine can be used to create a macro variable during execution of the DATA step or during execution of an SCL program.
In the DATA step, the SYMPUT routine automatically converts to a character value any numeric value that you attempt to assign as the value of a macro variable.
PROC SQL automatically converts to a numeric value any macro variable value that you attempt to compare to a numeric value.
In an SCL program, the SYMPUTN routine can be used to assign a numeric value to a macro variable.
Rate this question:
Quiz Review Timeline +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.