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 / rajaanku11
DATA ABC;
INPUT TDATE DATE9. AVG;
CARDS;
18APR2008 150.00
19APR2008 167.00
20APR2008 123.00
21APR2008 145.00
;
RUN;
data _null_;
set abc;
if tdate='18APR2008'D then
call symput('x',avg);
if tdate='21APR2008'D then
call symput('y',avg);
z=&x-&y;
run;
data _null_;
z=&x-&y;
put 'the difference='z;
run;
Is This Answer Correct ? | 2 Yes | 4 No |
Post New Answer View All Answers
Explain what Proc glm does?
what has been your most common programming mistake? : Sas programming
Do you need to rearrange the order of the data for the report?
Which are the statements whose placement in the data step is critical?
what techniques and/or procs do you use for tables? : Sas programming
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 ...
What are all the problems you faced while validating tables and reports?
What is the difference between where and if statement?
Enlist the functions performed by sas.
Name types of category in which SAS Informats are placed?
Describe the function and untility of the most difficult SAS macro that you have written.
what are some good sas programming practices for processing very large data sets? : Sas programming
what is operational data and operational system? : Sas-di
What is the difference between %put and symbolgen? : sas-macro
what is the function of catx syntax? : Sas-administrator