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 is the order of application for output data set options, input data set options and SAS statements?
What is the difference between %local and %global? : sas-macro
Difference between nodup and nodupkey options?
what are some problems you might encounter in processing missing values? In data steps? Arithmetic? Comparisons? Functions? Classifying data? : Sas programming
What is the sas data set? : sas-grid-administration
what is snowflake schema? : Sas-di
Are you involved in writing the inferential analysis plan? Tables specfications?
what is factor analysis? : Sas-administrator
Describe crosslist option in tables statement?
WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?
Explain input and put function?
Tell me about % include and % eval? : sas-macro
What areas of SAS are you most interested in?
What is the difference between SAS functions and procedures?
what are _numeric_ and _character_ and what do they do? : Sas programming