DATA Step, Macro, Functions and more

Proc format

Reply
Super Contributor
Posts: 673

Proc format


I'm looking to format fico score difference between the months and categorize. I'm using the proc format to do it. but the issue I'm facing is the negative or decrease in fico between current and previous months ,the proc format doesnt seem to take my negative scores properly. the first category -10 - <0 is not taking properly. I woiuld like to define other negative scores as well.

proc format;

  value diff

      -10 - <0      = '-10'

     0 -  <15     = '0-14'

    15 -  <30     = '15-29'

    30 -  <50     = '30-49'

    50 -  <100    = '50-99'

    100 -  High    = '100+';

run;

data t;
input score;
cards;
100
-20
-30
-10
10
20
0
;
run;

data y;
set t;
format score diff.;
run;

Super User
Posts: 3,261

Re: Proc format

What do you expect to happen with the -10 - < 0 range? The only test value matching this range is -10 and when I run your code it displays as -10 which is exactly what you specified: -10 - <0      = '-10'

Super User
Posts: 11,343

Re: Proc format

Default behavior for custom formats: If you have a data value that is not in the range given it will display with a BEST value.

So -20 and -30, since there is no specific instruction for them will display as -20 and -30 exactly as expected.

If you want ALL negative values to show in the same range then use

LOW - < 0

Ask a Question
Discussion stats
  • 2 replies
  • 208 views
  • 2 likes
  • 3 in conversation