I have account number and the ratings for the previous months and the current month like below
Account Number Aug Rating Account Number Sept Rating
100 A 100 A
200 D 123 F
300 C 400 B
400 A 500 C
500 D 300 C
-- -
-- -
I need the ouput in sas in such way that i need to know whether the how the ratings are moving compared to that previous month. I was able to get in this kind of excel , but need to write in SAS.
Any help is highly appreciated.
Sept Rating
Aug Rating A B C D E F
A 1 1
B
C 1
D 1
E
Thanks
Raj
From your description, the account numbers appear to be irrelevant. If so, I think creating a format and using proc tabulate will provide the output that you want. E.g.:
proc format;
value $rating
'A'='A'
'B'='B'
'C'='C'
'D'='D'
'F'='F'
;
run;
data have;
format Aug_Rating Sept_Rating $rating.;
input Account_Number (Aug_Rating Sept_Rating) ($);
cards;
100 A A
200 D F
300 C B
400 A C
500 D C
;
proc tabulate data=have ;
class Aug_Rating Sept_Rating /preloadfmt;
table Aug_Rating,Sept_Rating /printmiss ;
run;
your output and data is ambiguous.
1 is not in their right palce for output.
Ksharp
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.