I have this existing code. But it does not display negative values.
All negative values show up as positive value.
What can be an alternative way here?
proc Format ;
picture NumFmt
0 = ' '
other = '000,000,009'
;Quit;
Negative values falls under "Other".
Try this:
proc format ;
picture numfmt
low-<0='0,000,000,009' (prefix='-')
0 = ' '
0<-high= '000,000,009';
run;
That should work, but you don't really need picture formats here.
proc format;
value numfmt 0=' ' other=[comma12.0];
run;
Negative values falls under "Other".
Try this:
proc format ;
picture numfmt
low-<0='0,000,000,009' (prefix='-')
0 = ' '
0<-high= '000,000,009';
run;
That should work, but you don't really need picture formats here.
proc format;
value numfmt 0=' ' other=[comma12.0];
run;
9 prints zeroes, zeroes print blanks.
It's called a digit selector in SAS.
See page 6/7 of this document for an example that clarifies it more:
https://support.sas.com/resources/papers/proceedings/proceedings/sugi31/243-31.pdf
Thank You @Reeza
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.