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 / rajaanku11
Hi, pls modify slight changes to the above prog.
data _null_ ;
set abc;
if tdate='18APR2008'D then
call symput('x',avg);
if tdate='21APR2008'D then
call symput('y',avg);
run;
%put _user_;
data _null_;
z=&x-&y;
put 'the difference=' z;
run;
Is This Answer Correct ? | 2 Yes | 3 No |
Post New Answer View All Answers
How we can call macros with in data step? : sas-macro
what are the softwares and applications that are used most frequently used by sas bi applications developers? : Sas-bi
What is the maximum and minimum length of macro variable
What is the difference between class statement and by statement in proc means?
how will you locate the sas platform applications? : Sas-bi
What is the difference between where and if statement?
What do you know about symput and symget?
What is the order of application for output data set options, input data set options and SAS statements?
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
How do you convert basic cube to transaction cube and transaction cube to basic cube?
Explain what is data step?
what is information maps?
how does sas handle missing values in sort order? : Sas programming
what techniques and/or procs do you use for tables? : Sas programming
I have a SCD Type 2 Dimention for Location In which A Sales Office in Having two Surrogate Keys just because of the change in it's Sales Group. SKey SalesGroup Sales Office BeginDate EndDate 280 SG1 SO1 01APR2000 01APR2010 281 SG2 SO1 02APR2010 31MAR2999 Now while loading the Fact, the Lookup ir returning SKey 280 for records before and after 01APR2010. I am not able to give WHERE condition in the Lookup Properties (TranDate between BeginDate and EndDate). Please help.