One way of creating a new variable in Macros is by %
Let....What is the other way..?
Answers were Sorted based on User's Feedback
Answer / prem krishnan
1) %macro <macroname> ( );
%mend (<macroname>;
a DATA step that contains a SYMPUT routine within a macro
definition
a DATA step that contains a SYMPUTX routine within a macro
definition
a SELECT statement that contains an INTO clause in PROC SQL
within a macro
definition
a %LOCAL statement.
%global statement
| Is This Answer Correct ? | 8 Yes | 0 No |
Answer / satyanand
•A %LET statement (used outside a macro definition)
•A DATA step that contains a SYMPUT routine
•A DATA step that contains a SYMPUTX routine (beginning in
SAS 9)
•A SELECT statement that contains an INTO clause in PROC SQL
•A %GLOBAL statement.
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / aruna
Use Callsymput(<variable>, <Value>) for version lessthan
SAS9
Use Callsymputx(<variable>, <Value>) for SAS9
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / xxx
%Global;
%Local;
%let;
call symput in datastep;
into clause in proc sql;
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / lavanya
In addition to the %LET statement, other features of the macro language that create macro variables are
iterative %DO statement
%GLOBAL statement
%INPUT statement
INTO clause of the SELECT statement in SQL
%LOCAL statement
%MACRO statement
SYMPUT routine and SYMPUTN routine in SCL
%WINDOW statement.
| Is This Answer Correct ? | 0 Yes | 0 No |
Describe the ways in which you can create macro variables? : sas-macro
how many types of prompts are there? : Sas-bi
how to write code for left outer join in SAs using datastep?
In the following DATA step, what is needed for ‘fraction’ to print to the log? data _null_; x=1/3; if x=.3333 then put ‘fraction’; run;
what are the differences between proc report and proc tabulate?
What is the difference between %put and symbolgen? : sas-macro
what do the mod and int function do? What do the pad and dim functions do? : Sas programming
When looking for data contained in a character string of 150 bytes, which function is the best to locate that data: scan, index, or indexc?
Can you use a macro within another macro? If so how would SAS know where the current acro ended and the new one began?
How do you generate random samples?
How do you read in the variables that you need?
data voter; input Age Party : $1. (Ques1-Ques4)($1. + 1); datalines; 23 D 1 1 2 2 45 R 5 5 4 1 67 D 2 4 3 3 39 R 4 4 4 4 19 D 2 1 2 1 75 D 3 3 2 3 57 R 4 3 4 4 ; Idont understand what the (Ques1-Ques4)($1. + 1) means. I have seen (Ques1-Ques4)(4*$1.), but what is (Ques1-Ques4)($1. + 1)? Appreciate all help Thanks