DATA Step, Macro, Functions and more

numeric formatting datastep

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 131
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: 10,483

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: 10,483

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.

Frequent Contributor
Posts: 131

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
  • 140 views
  • 1 like
  • 2 in conversation