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


Please Help Members By Posting Answers For Below Questions

What is the order of application for output data set options, input data set options and SAS statements?

1060


What is the difference between %local and %global? : sas-macro

641


Difference between nodup and nodupkey options?

615


what are some problems you might encounter in processing missing values? In data steps? Arithmetic? Comparisons? Functions? Classifying data? : Sas programming

695


What is the sas data set? : sas-grid-administration

548






what is snowflake schema? : Sas-di

668


Are you involved in writing the inferential analysis plan? Tables specfications?

1711


what is factor analysis? : Sas-administrator

585


Describe crosslist option in tables statement?

681


WHAT IS SAS WEB SERVICE and what are the steps to create an xml service ?

2241


Explain input and put function?

617


Tell me about % include and % eval? : sas-macro

650


What areas of SAS are you most interested in?

1037


What is the difference between SAS functions and procedures?

638


what are _numeric_ and _character_ and what do they do? : Sas programming

655