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 / rohitbedi
Shortest answer: Copy the dataset and create a new field using difn function on avg where n=3 as shown below.
data abc2;
set abc;
diff = dif3(avg);
run;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain the use of proc print and proc contents?
What is the SAS data set?
why a stop statement is needed for the point= option on a set statement?
Describe the function and untility of the most difficult SAS macro that you have written.
What is the difference between class statement and by statement in proc means?
Explain the purpose of retain statement.
What commands are used in the case of including or excluding any specific variables in the data set?
What is the basic structure of a sas program?
What is factor analysis?
Explain the difference between informat and format with an example.
Hello, I have PROC SQLs results group by 3 fields and I use SUM and COUNT functions in SQL. The problem is when I try to display my result with PROC TABULATE. I am getting very big numbers. I believe I make a mistake some where in Tabulate. Here is my Proc Tabulate. PROC TABULATE DATA=OUT04_05 FORMAT=12.; CLASS YR CENTRE VISA / PRELOADFMT EXCLUSIVE; VAR NEWUSER FRAUD TRANSFER AUTUSER REISSUE; TABLE CENTRE ALL, (YR ALL)*VISA, (NEWUSER*F=COMMA12. AUTUSER*F=COMMA12. FRAUD*F=COMMA12. TRANSFER*F=COMMA12. REISSUE*F=COMMA12.) / MISSTEXT={LABEL='0'} PRINTMISS RTS=20; FORMAT VISA VISAFMT.; KEYLABEL SUM = ' ' ALL = 'TOTAL'; LABEL YR = 'DATE YEAR' NEWUSER = 'TOTAL NEW ACCT' TRANSFER = 'TOTAL TRANSFER' FRAUD = 'TOTAL FRAUD TRANSFER' AUTUSER = 'TOTAL AUTH USERS' REISSUE = 'TOTAL REISSUE'; When I code it like : NEWUSER*N*F=COMMA12. AUTUSER*N*F=COMMA12. I get same amount numbers but to find a NEWUSER I use COUNT(*) and to find AUTUSER I use SUM(xxxx) function so both result shouldn’t be the same my problem is in this point. Could you tell me where the problem in code is. How can I display my result? TX.
What is the function of Stop statement in a SAS Program?
How to create a permanent sas data set?
Tell me more about the parameters in macro? : sas-macro
hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?