I am a SAS novice. I have two fields called P_ADJ_INCOME and S_ADJ_INCOME where the output are negative values like: -000680 and I would like to reformat this output to: 00-0680
for reporting purposes.
I would appreciate your help!
If you values are not exactly 6 digits and integer then you will need to provide a larger example of values and how they should appear.
You may also have to provide an example just how you are building your "report".
In both fields, the output is exactly 6 digits including the dash. They all look like this:
-005236
-025450
-003629
Use a picture format:
data have;
do x = -005236,-025450,-003629,-000077;
output;
end;
format x z7.;
run;
proc format;
picture myFormat
low-high='99-9999';
run;
data want;
set have;
y = x;
format y myFormat.;
run;
proc print data=want; run;
Obs. x y 1 -005236 00-5236 2 -025450 02-5450 3 -003629 00-3629 4 -000077 00-0077
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.