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 many types prompting framework can be broken down to? : Sas-bi

782


What is the different between functions and PROCs that calculate the same simple descriptive statistics?

1447


What are the table names in oracle database...?

2426


what are the considerations when picking a SAS/STAT procedure?

3071


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

927






what is sas application server? : Sas-di

658


hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?

1803


If you need the value of a variable rather than the variable itself what would you use to load the value to a macro variable? : sas-macro

764


How you are maintaining sas programmes in your company...any specific version control software you are using? If so, tell me the name?

1747


how can you create zero observation dataset? : Sas programming

820


How substr function works in sas?

837


What are the 3 components in sas programming?

876


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

789


How to include or exclude specific variables in a data set?

823


how does sas handle missing values in procs? : Sas programming

804