BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BStats
Calcite | Level 5

Hi,

 

I am writting constructing a table using proc report. One of the columns being displayed is a list of percentages

 

PercentUsed

99.267561

0.2447182

0.4967894

76.229856

 

How can I format this colum so that it appears as what is shown below, within the proc report table. 

 

PercentUsed

99.26%

0.24%

0.49%

76.2%

 

If I use the format=percent it times eveything by 100. So I get 9926 rather then 99.26

1 ACCEPTED SOLUTION

Accepted Solutions
JerryLeBreton
Pyrite | Level 9

Create a PICTURE format like this:

proc format;

   picture pcent low-high='009.99%';

run;

 

 data _null_;

   PercentUsed = 99.34567;

   x = put(PercentUsed, pcent.);

   put x=;

run;

x=99.34%

 

 

 

 

View solution in original post

4 REPLIES 4
Reeza
Super User
You need to create a custom picture format:

proc format;
picture mypct low-high='000,009%';
run;
BStats
Calcite | Level 5

This is turning my 0.24567 into 0%. I need it to be 0.24%

JerryLeBreton
Pyrite | Level 9

Create a PICTURE format like this:

proc format;

   picture pcent low-high='009.99%';

run;

 

 data _null_;

   PercentUsed = 99.34567;

   x = put(PercentUsed, pcent.);

   put x=;

run;

x=99.34%

 

 

 

 

BStats
Calcite | Level 5

Thank you so much!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 1222 views
  • 0 likes
  • 3 in conversation