BookmarkSubscribeRSS Feed
Mark7807
Calcite | Level 5

How do I change a numeric grade to a letter grade?

There are 4 sets of data that needs to be given a letter ranking

3 REPLIES 3
ballardw
Super User

Do you actually need to "change" or just generate an associated text value? A custom format would allow you to display a grade for the given numeric value. Assume the values are integers in the range 0 to 100 something like this:

Proc format;

value grade

91 - 100 = 'A'

81 - 90   = 'B'

71 - 80   = 'C'

61 - 70   = 'D'

low - 60  = 'F'

. = 'NA'

;

run;

Data test;

     do grade = 1 to 100;

     output;

     end;

run;

/* to see a summary of the above data*/

proc freq data=test;

     tables grade;

     format grade grade.;

run;

Mark7807
Calcite | Level 5

I can generate a new value but there are different weights on the 5 different, sorry not 4, sets and I am VERY new at this.

Thanks for the help.

art297
Opal | Level 21

Nothing wrong with being new, but explicitly describe what you want.  The best way, I think, is to provide two files, both in the format of data step code: one showing an example of what you have; and the other showing what you want to achieve based on your sample data set.

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 3 replies
  • 1264 views
  • 0 likes
  • 3 in conversation