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
how can you import .csv file in to sas? : Sas programming
Explain how merging helps to combine data sets.
what is treatment emergent events and treatment emregent adverse event
what is SAS OPTIMIZATION?
Explain the difference between using drop = data set option in set and data statement?
What is a pdv and what are its functions?
What are the features of SAS?
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?
What are common programming errors committed in sas
what is the difference between: x=a+b+c+d; and x=sum (of a, b, c ,d);? : Sas programming
what are some differences between proc summary and proc means? : Sas programming
Mention what are the data types does SAS contain?
explain the difference between alternate key, business key, foreign key, generated key, primary key, retained key and surrogate key ? : Sas-di
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;
Which are the statements whose placement in the data step is critical?