- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am using a picture format to display '%' in proc tabulate output. Using this format is however changing the negative values to positive.
Code I am using.
proc format;
picture mypercent_pict (round) low-high = "009.99%";
run;
proc tabulate data=dataset;
class Month ;
var Segment Total;
table Month='', (Total*sum=""*f=comma12. Segment=""*(sum="segment"*f=comma12. pctsum<Total>="Segment as %"*f=mypercent_pic));
run;
If I don't use "*f=mypercent_pic" I get the following output:
Month Total Segment Segment as %
Jul-18 689,039 1,194,031 173.29
Aug-18 -353,108 1,409,626 -399.21
Sep-18 -886,771 1,144,431 -129.06
However, using the mypercent_pict format gets rid of the negative sign.
Month Total Segment Segment as %
Jul-18 689,039 1,194,031 173.29%
Aug-18 -353,108 1,409,626 399.21%
Sep-18 -886,771 1,144,431 129.06%
Any suggestions to get the output as -399.21% and -129.06% in the table?
Thanks
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
When using picture-formats you have to tell sas that negative numbers need special formatting:
proc format;
picture mypercent_pict (round)
low -< 0 = "009.99%" (prefix = "-")
0 - high = "009.99%"
;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
When using picture-formats you have to tell sas that negative numbers need special formatting:
proc format;
picture mypercent_pict (round)
low -< 0 = "009.99%" (prefix = "-")
0 - high = "009.99%"
;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content