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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.