Help using Base SAS procedures

Proc Format - Other

Posts: 1

Proc Format - Other

I am trying to create a permanent format with the goal of changing how skipped values are displayed in Proc Print. The character variable "Reason" is currently coded as ".SK" for skipped values. I would like them to display as "Skipped" when printed. Here is my code:

proc format library = MyFmt;
value $ReasonFmt
'.SK' = 'Skipped';

proc print data = Data1;
var Reason;
format Reason $ReasonFmt.;

The problem is that non-skipped values (e.g. "No applicable insurance" and "Patient transferred care") get truncated to 3 characters (e.g. "No " and "Pat"). Is there a way to change the display of ".SK" while maintaining the way all other values are printed?

Thanks for your help.
Super User
Posts: 13,498

Re: Proc Format - Other

The default length of a format is the length of the longest formatted value.

You need to specify a DEFAULT= in the value statement:

value $ReasonFmt (default=15)
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation