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

If you use a symput in a data step, when and where can you use the macro variable? : sas-macro

585


What are types of transport files?

6776


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

671


What do you understand by the term Normal Distribution?

544


What are the difference between sas functions and procedures?

611






how does sas handle missing values in sort order? : Sas programming

501


what are some good sas programming practices for processing very large data sets? : Sas programming

490


Which are the statements whose placement in the data step is critical?

729


WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?

2241


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)?

1176


How do dates work in SAS data?

651


explain the proc in sas? : Sas-administrator

588


What would be the result of the following SAS function (given that 31 Dec, 2000 is Sunday)?

657


how do you want missing values handled? : Sas programming

511


how are numeric and character missing values represented internally? : Sas programming

596