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 do you use the do loop if you don’t know how many times you should execute the do loop?

870


What are the differences between proc means and proc summary?

692


do you need to know if there are any missing values? : Sas programming

663


Explain by-group processing?

692


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

1177






What are the different versions of sas that you have used until now? : sas-grid-administration

862


if a variable contain dates like "2015/01"---"2015/12" (yymm) ,How to add day to those dates,if them month is jan then 31 if the month is feb then 28 so on ...

1051


Which function is used to count the number of intervals between two sas dates?

674


How you can read the variables that you need?

749


How would you code a merge that will write the matches of both to one data set, the non-matches from the left-most data?

738


what are the categories that sas informats are used to the place the data? : Sas-administrator

710


What is the differnce between SDTM 3.1.2 to 3.1.1 version

4726


What is the basic structure of a sas program?

690


what is data access? : Sas-di

744


is data integration and etl programming is same? : Sas-di

678