Previous PageNext Page

Fixing the format
What is supposed to be done with the values that fall between the cracks? In our example, 89.1? Go back to the definition of the task:
"The task is to write a recoding algorithm that assigns below 65 to F, below 70 to D, below 80 to C, below 90 to B, and 90+ to A."
That is, "below 65" implies that 65.0 is a D and 64.9999 is an F.
The original PROC FORMAT is as follows.

PROC FORMAT;
VALUE SCORE  0-64  ='F'
            65-69  ='D'
            70-79  ='C'
            80-89  ='B'
            90-HIGH='A';

The revised VALUE statement is as follows:

VALUE SCORE  0-<65  ='F'
            65-<70  ='D'
            70-<80  ='C'
            80-<90  ='B'
            90-HIGH ='A';

The new Proc Print works as you'd want it to.

Example 3, with different data

OBS    ID    SCORE     GRADE    NOFORMAT

 1      1    F           F          0.0
 2      2        -1                -1.0
 3      3    A           A        101.0
 4      4    B           B         82.1
 5      5    B           B         89.1
 6      6         .                  .

Previous PageTable Of ContentsNext Page