DATA Step, Macro, Functions and more

numeric formatting datastep

Accepted Solution Solved
Reply
Regular Contributor
Posts: 180
Accepted Solution

numeric formatting datastep

data test(keep=pct);

set test1;

run;

sample output

pct

1000

5000

150

By default the pct comes out as above.  I need for the results to display as follows:

100.00

50.00

1.50

 


Accepted Solutions
Solution
‎12-19-2016 02:41 PM
Super User
Posts: 13,941

Re: numeric formatting datastep

Divide by 100 and format as F6.2.

Pct= pct/100;

Format pct F6.2;

 

Or use a custom picture format that involves MULT.

View solution in original post


All Replies
Solution
‎12-19-2016 02:41 PM
Super User
Posts: 13,941

Re: numeric formatting datastep

Divide by 100 and format as F6.2.

Pct= pct/100;

Format pct F6.2;

 

Or use a custom picture format that involves MULT.

Regular Contributor
Posts: 180

Re: numeric formatting datastep

thanks it worked

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 276 views
  • 1 like
  • 2 in conversation