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
Difference between informat and format?
what is hash files in sas and why we are using this one in sas?
what is the difference between nodup and nodupkey options? : Sas programming
Explain the difference between using drop = data set option in set and data statement?
Differences between where and if statement?
What is the purpose of trailing @ and @@? How do you use them?
What are the ways to do a “table lookup” in sas?
Assuming {et} is randomly drawn from N(0,1) and e0 = 0, generate 200 observations of xt = et − 0.5e(t−1) and draw a line graph of xt.
How are numeric and character missing values represented internally?
what is the primary data source for the wrs? : Sas-bi
what are the scrubbing procedures in sas? : Sas programming
Name and describe few sas character functions that are used for data cleaning in brief.
what other sas products have you used and consider yourself proficient in using? : Sas programming
how would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable? : Sas programming
What is the good sas programming practices for processing large data sets?