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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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