If you need the value of a variable rather than the
variable itself what would you use to load the value to a
macro variable?
Answers were Sorted based on User's Feedback
Answer / chaitanya
If we need a value of a macro variable then we must define
it in such terms so that we can call them everywhere in the
program. Define it as Global. There are different ways of
assigning a global variable. Simplest method is %LET.
Ex: A, is macro variable. Use following statement to assign
the value of a rather than the variable itselfe.g.
%Let A=xyz x="&A";
This will assign "xyz" to x, not the variable xyz to x.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / damwal
Use CALL SYMPUT routine.
Below I show how to assign the value of 3rd observation of
variable name (94) to a macro variable named "macrovar1"
data test;
input name @@;
datalines;
1 21 94 444 5
;
data _null_;
set test (firstobs=3 obs=3);
call symput("macrovar1",name);
run;
%put ¯ovar1; /*display*/
| Is This Answer Correct ? | 1 Yes | 0 No |
calculate the sum of value using only DATA STEP. data count_; input year name $ value; cards; 2006 xxx 10 2007 yyy 12 2006 xxx 20 2008 yyy 15 2007 xxx 15 ; out put should be like this year name T_value ----------------------- 2006 xxx 30 2007 xxx 15 2007 yyy 12 2008 xxx 15
what are the validation tools in sas?
How we can create SAS USER DEFINED CODE?
Explain the main difference between the sas procedures and functions? : Sas-administrator
how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?
Name and describe three SAS functions that you have used, if any?
Are you involved in writing the inferential analysis plan? Tables specifications?
Mention the difference between ceil and floor functions in sas?
when we are using the PROC TRANSPOSE? OBSERVATIONS are repeated then what will happen and what it will show in log window.
If you?re not wanting any SAS output from a data step, how would you code the data statement to prevent SAS from producing a set?
I have 2 data sets A & B. Both have a variable called Age in them, each of them specifying a different functionality. In my program I use bot these data sets. How do I specify which Age variable I want to use?
how we can call macros with in data step?