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 we can create SAS USER DEFINED CODE?
what is sas business intelligence? : Sas-bi
How will you react when, while consulting a SAS documentation manual to get an answer to a problem, someone says hey, I thought you were supposed to know all that stuff already, and not have to look it up in a book?
What is SAS?
How to limit decimal places for variable using proc means?
What is the difference between %put and symbolgen? : sas-macro
what are the new features included in the new version of sas i.e., Sas 9.1.3? : Sas programming
what is the different between functions and procs that calculate the same simple descriptive statistics? : Sas programming
how are numeric and character missing values represented internally? : Sas programming
What is the basic syntax of a sas program?
explain the function of substr in sas? : Sas-administrator
Have you ever used the SAS Debugger?
What is a pdv and what are its functions?
What does the trace option do?
how do you pull data from equifax?tell me the process?