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
What is PDV?
Which command is used to save logs in the external file?
What would be the result of the following SAS function (given that 31 Dec, 2000 is Sunday)?
Describe 5 ways to do a “table lookup” in SAS?
Are you involved in writing the inferential analysis plan? Tables specfications?
What function CATX syntax does?
What is data _null_?
what are the types of interactive display types? : Sas-bi
what are some good sas programming practices for processing very large data sets? : Sas programming
Are you involved in writing the inferential analysis plan? Tables specifications?
What are the implications?
For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration
what is factor analysis? : Sas-administrator
What is the maximum and minimum length of macro variable
Explain proc univariate?