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 many types prompting framework can be broken down to? : Sas-bi
What is the different between functions and PROCs that calculate the same simple descriptive statistics?
What are the table names in oracle database...?
what are the considerations when picking a SAS/STAT procedure?
Which are the statements whose placement in the data step is critical?
what is sas application server? : Sas-di
hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?
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
How you are maintaining sas programmes in your company...any specific version control software you are using? If so, tell me the name?
how can you create zero observation dataset? : Sas programming
How substr function works in sas?
What are the 3 components in sas programming?
how can you import .csv file in to sas? : Sas programming
How to include or exclude specific variables in a data set?
how does sas handle missing values in procs? : Sas programming