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
How many data types are there in SAS?
What are the default statistics for means procedure?
what is the function of catx syntax? : Sas-administrator
Where do you use proc means over proc freq?
How is character variable converted into numeric variable and vice versa?
How to sort in descending order?
what is scheduling and how will u implement it. In scheduling 5 jobs r running if there is an error occured at 3rd job and how will u check and waht necessary steps will u take not to repeat the same mistake
What is program data vector (pdv)?
what is the use of proc contents and proc print in sas? : Sas-administrator
How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data?
what is data governance? : Sas-di
What is a method to debug and test your SAS program?
how can you put a "trace" in your program? : Sas programming
What would be the result of the following SAS function (given that 31 Dec, 2000 is Sunday)?
What system options would you use to help debug a macro? : sas-macro