You might also be interested in how SAS works with p-value and odds ratio formats behind-the-scenes - @Rick_SAS wrote a blog post about this.
Sample code that demonstrates:
data FmtExample(drop=d);
do d = -5 to 3;
raw = 10**d;
oddsRatio = raw;
if d<=0 then pVal = raw; /* a p-value must be less than 1 */
else pVal = .;
output;
end;
format raw BEST8. oddsRatio ODDSR8.3 pVal PVALUE6.4;
run;
options missing=" "; /* display missing values as blanks */
proc print noobs; run;
options missing="."; /* reset display of missing values */
... View more