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


Please Help Members By Posting Answers For Below Questions

What is the difference between %local and %global? : sas-macro

769


what are the categories that sas informats are used to the place the data? : Sas-administrator

710


How to limit decimal places for variable using proc means?

689


what is the effect of the options statement errors=1? : Sas programming

687


What is a put statement?

777






What versions of SAS have you used (on which platforms)?

1128


Do you know the features of sas?

695


How do you connect the desktop application to metadata server? : sas-grid-administration

694


How you can read the variables that you need?

749


what is hierarchy flattening? : Sas-di

719


How do dates work in sas?

738


how to create the AE dataset by using SDTMIG specifications and SAP plan by using UNIX platform?

2387


what is the primary data source for the wrs? : Sas-bi

764


How we can call macros with in data step? : sas-macro

723


If money were no object, what would you like to do?

2789