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

how can you import .csv file in to sas? : Sas programming

636


Explain how merging helps to combine data sets.

613


what is treatment emergent events and treatment emregent adverse event

1939


what is SAS OPTIMIZATION?

1816


Explain the difference between using drop = data set option in set and data statement?

680






What is a pdv and what are its functions?

599


What are the features of SAS?

576


hi here is a problem can anybody solve this? i want to report the data through third party file. by using data _null_ or proc report or macro automation process. but i want to insert the 'titles and footnotes' in between the data and also starting of 2nd and ending of 2nd and starting of 3rd and ending of the 3rd page. tell me how and write the code?

1686


What are common programming errors committed in sas

673


what is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming

608


what are some differences between proc summary and proc means? : Sas programming

505


Mention what are the data types does SAS contain?

695


explain the difference between alternate key, business key, foreign key, generated key, primary key, retained key and surrogate key ? : Sas-di

542


i have a dataset with 100 obs i want to generate title from 20th obs onwards with total observations. that should contain 100 obs.dont use firstobs and dnt split the data. use dataset block or proc report? how can we genarate;

1967


Which are the statements whose placement in the data step is critical?

759