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 / yuyin
a=123;
call symput("x",a);
a is a variable, 123 is the value of variable a, x is macro
variable, symput will assign 123 to macro variable x.
| Is This Answer Correct ? | 12 Yes | 0 No |
Answer / saurabh gupta
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
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / yuyin
a is macro variable. use following statment to assign the
value of a rather than the variable itself
e.g.
%let a=xyz
x="&a";
this will assign "xyz" to x, not the variable xyz to x
| Is This Answer Correct ? | 0 Yes | 3 No |
what is Enterprise Guide?what is the use of it?
We want to merge file A and B. File A has variable age, file B provide birthdate. How to merge the data according to age in file B
What is the difference between order and group variable in proc report?
How can sas program be validated?
What would the following datastep do? Data _null_; Set Dist end=eof; Call Symput("xx"!!left(put(_n_,2.)),&dimension); If EOF then Call Symput('numrows',left(put(_n_,2.))); Run; dimension is a macro variable that is being passed here
how do you want missing values handled? : Sas programming
What is the purpose of _error_?
how to get second highest salary from a employee table and how get a 5th highest salary from a employee table?
Name validation tools used in SAS
/* This is example of age caluculate wihtout to display perfect days and years in output window */ data age; retain dob "12jun2003"d now "24may2011"d; age1=now-dob; age=(now-dob)/365.25; years=int(age); days1=round((age-years)*365.25); months=month(now)-1; if days1 gt 30 and months in(12,10,8,6,4,2)then do; month1=days1/30.4375; month=int(days1/30.4375); if day(now)=1 then days=1; else days=round((month1-month)*30.4375)+1; drop days1 month1 month; end; else if days1 gt 30 and months in (1,3,5,7,9,11)then do; month1=days1/30.4375; month=int(days1/30.4375); if day(now)=1 then days=1; else days=round((month1-month) *30.4375); drop days1 month1 month; end; drop age age1; proc print data=age; format dob now date.; run;
Describe the types of SAS programming tasks that you performed like Tables? Listings? Graphics? Ad hoc reports? Other?
what is the basic structure sas administrator? : Sas-administrator