DATA ABC;
INPUT TDATE DATE9. AVG;
CARDS;
18APR2008 150.00
19APR2008 167.00
20APR2008 123.00
21APR2008 145.00
;
RUN
HOW CAN I FIND THE DIFFERENCE BETWEEN AVG OF 18APR2008 ANF
21APR2008??
IF ANY ONE GETS IT PLS TRY TO POST IT.
Answer Posted / abhilash
Use symgetfunction to resolve a macro variable with in same
data step while creating macro variable using call symput.
DATA test;
SET ABC;
IF TDATE='18APR2008'D THEN
CALL SYMPUT('A2',AVG);
ELSE IF TDATE='21APR2008'D THEN
CALL SYMPUT('B2',AVG);
diff = symget('a2') - symget('b2');
RUN;
Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
If you use a symput in a data step, when and where can you use the macro variable? : sas-macro
What are types of transport files?
Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro
What do you understand by the term Normal Distribution?
What are the difference between sas functions and procedures?
how does sas handle missing values in sort order? : Sas programming
what are some good sas programming practices for processing very large data sets? : Sas programming
Which are the statements whose placement in the data step is critical?
WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?
Hi,by usining ptf how we have to combine (likr merge)10 datasets at a time in the oracle database(and write a macro code also)?Like this i have a douts a lot if you dont mind may please send one text mail for me(madhusudhanap16@gmail.com)?
How do dates work in SAS data?
explain the proc in sas? : Sas-administrator
What would be the result of the following SAS function (given that 31 Dec, 2000 is Sunday)?
how do you want missing values handled? : Sas programming
how are numeric and character missing values represented internally? : Sas programming