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
The Above can be done in a single data step as
follows.Actually this is suggestable.
data _null_;
set abc;
retain z;
if tdate='18APR2008'D then
z=avg;
if tdate='21APR2008'D then
do;
diff=Z-avg;
put 'the difference=' diff;
stop;
end;
run;
Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
What are the features of SAS?
Are you sensitive to code walk-throughs peer review or QC review?
what is sas metadata server? : Sas-di
what is function of retain statment
what can you learn from the sas log when debugging? : Sas programming
How to convert a numeric variable to a character variable?
Did you used proc test? when?
How to test the debugging in sas?
what are several options for creating reports in web report studio? : Sas-bi
What are the difference between ceil and floor functions in sas?
How to read an input file in sas?
What is a pdv and what are its functions?
What are the default statistics that proc means produce?
How many data types are there in SAS?
How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?