04-16-2012 03:39 AM
Is following allowed? looks ok, but 4 is defined twice in format, the result is using homie, not mid.
Can someone help explain?
low - 4 = 'homie'
4 - 8 = 'mid';
proc print data=t;
format amt ne.;
04-16-2012 04:29 AM
I thought Mid will be displayed in the place of 4.
Because 4-8='mid' is the recent value in proc format.
So this is going to apply to "4"..
04-16-2012 06:35 AM
The best response is to submit yours statements and consult the ouptut...
Another idea... submit these 2 statements
format cntlout=poub ;run;
print label ;var fmtname start end sexcl eexcl;run;
Format Starting value value for Start End
name for format format exclusion exclusion
NE LOW 4 N N
NE 4 8 Y N
04-16-2012 06:56 AM
Without testing I would have expected that an error gets thrown because of overlapping ranges. But no: Proc Format digests these overlapping values.
On my SAS9.3 Win64 installation the label from the lower range is taken independently in what order the ranges are defined with Proc Format (so it's always 'homie').
Wouldn't have thought about writing the format to a data set like RLC did. It's quite nice as it actually gives you an idea of what Proc Format does to deal with such an ambiguity.