The SAS Output Delivery System and reporting techniques

Proc Report missing and formats

Posts: 37

Proc Report missing and formats


I have a strange behavior in proc report when using formatted across columns.

When I run proc report without the missing statement (as below), I get the correct output in that my hospitals are listed in the proper order, and then the group 'Other' catches the remaining hospitals (see below). When I use the missing statement, the 'Other' group comes first, and I would like it to come last in the list.

proc format ;
value $across_inpatient (notsorted)
Other = 'Other';

ods html;
proc report data= inpatient_join3 nowd ;

column closest_hospital tx_hospital real_separations , sum ;

define tx_hospital/ group across "Treatment Site" order=internal Center format= $across_inpatient. ;
define closest_hospital/ group order=internal format=bri_inpatient. "Closest Hospital" left;
define real_separations/ analysis sum format=comma12.0 '' center;
define sum / "Total" center format=comma12.0 center;

rbreak after / summarize ;
ods html close;

Without Missing:
Closest Hospital H1 H2 H3 H4 Other

With Missing :
Closest Hospital Other H1 H2 H3 H4

How can this be fixed.

Super Contributor
Posts: 394

Re: Proc Report missing and formats

Try ORDER=FORMATTED on the DEFINE TX_HOSPITAL statement. Edited by Tim@SAS

Message was edited by: Tim@SAS
Posts: 37

Re: Proc Report missing and formats

The order =formatted changes the order to alphabetical order, also not desired.
Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation