BookmarkSubscribeRSS Feed
RajReddy
Calcite | Level 5

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

2 REPLIES 2
art297
Opal | Level 21

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;

Ksharp
Super User

your output and data is ambiguous.

1 is not in their right palce for output.

Ksharp

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1110 views
  • 0 likes
  • 3 in conversation