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 order and group variable in proc report?
Briefly explain input and put function?
How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?
Tell me more about the parameters in macro? : sas-macro
what is metadata? : Sas-bi
In proc transpose and data step with arrays which one you pick?
What is the function of Stop statement in a SAS Program?
what is function of retain statment
how many types of prompts are there? : Sas-bi
If you have a dataset that contains 100 variables, but you need only five of those, what is the code to force SAS to use only those variables?
how can you create zero observation dataset? : Sas programming
What does the trace option do?
Explain why double trailing @@ is used in input statement?
I am preparing SAS Certified Advanced Programmer for SAS 9 in 2014. If anybody has the latest dumps for this exam, please mail me at dhiman.mukherjee@gmail.com
Describe the function and untility of the most difficult SAS macro that you have written.