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 / nagesh sriram

Hi,
I am think that the difference between the first and last
records value?

data _null_;
set abc end=last;
retain first;
if _n_=1 then first=avg;
if last=1 then do;
diff=first - avg;
put 'The difference is =' diff;
stop;
end;
run;

here _n_=1 is hold the first record in the abc dataset.
Last=1 means is hold the last record in the dataset.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the Population you used in your project, is it ITT or PP?

2163


What are the advantages of using sas?

596


Mention what are the data types does SAS contain?

684


Given an unsorted data set, how to read the last observation to a new data set?

818


What are the difficulties u faced while doing vital signs table or dataset?

1916






how will you location sas platform applications available from web browser? : Sas-bi

534


What do the put and input function do?

568


How does proc sql work?

601


what is slowly changing dimension? : Sas-di

607


What is SAS informats?

618


What are the special input delimiters used in SAS?

642


Of all your work, where have you been the most successful?

4188


Do you need to compute new variables? If so,should you do this before you execute the report-writing procedure?

1458


How many data types are there in SAS?

617


Explain data step in SAS

612