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
What is the difference between %local and %global? : sas-macro
what are the categories that sas informats are used to the place the data? : Sas-administrator
How to limit decimal places for variable using proc means?
what is the effect of the options statement errors=1? : Sas programming
What is a put statement?
What versions of SAS have you used (on which platforms)?
Do you know the features of sas?
How do you connect the desktop application to metadata server? : sas-grid-administration
How you can read the variables that you need?
what is hierarchy flattening? : Sas-di
How do dates work in sas?
how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?
what is the primary data source for the wrs? : Sas-bi
How we can call macros with in data step? : sas-macro
If money were no object, what would you like to do?