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
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.