data ex1 ;
input group amount ;
cards ;
a 9848975
b 9457890
;
proc format ;
picture pic high-low='999,9999 -rs/-' ;
run;
data ex2 ;
set ex1 ;
format amount pic. ;
run;
if run above program it doesn't work can you give correct program
Maxim 2 - Read the log.
proc format; picture pic low-high='999,9999 -rs/-'; run;
Please use the code window, it is the {i} above post area, to post code, and please mark answered questions as answered.
Format ranges ALWAYS go from smaller to larger
Also, you might want to test your format with some other values to see if it does what you intend.
data ex1 ; input group $ amount ; cards ; a 9848975 b 9457890 c 1234567898 d 123 ; proc format library=work ; picture pic low-high='999,9999 -rs/-' ; run; data ex2 ; set ex1 ; format amount pic. ; run;
See if the results for group c and d match expectation.
PS you forgot the $ in your input statement so your example data has a missing group numeric value.
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.