SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Rakeon
Quartz | Level 8

Hi,

is there a percent format with comma instead of point  ?

For example the percentn format show me this: -17.1%, but we need -17,1% format.

 

Exist this kind of format?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

Hi @Rakeon,

 

You can use the NLPCTw.d format (or one of the related NLPCT... formats) with a suitable LOCALE setting (possibly your default).

280  %put %sysfunc(getoption(locale));
DE_DE
281
282  data _null_;
283  x=-0.171;
284  put x NLPCT6.1;
285  run;

-17,1%
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


286
287  options locale=EN_US;
288
289  data _null_;
290  x=-0.171;
291  put x NLPCT6.1;
292  run;

-17.1%

View solution in original post

1 REPLY 1
FreelanceReinh
Jade | Level 19

Hi @Rakeon,

 

You can use the NLPCTw.d format (or one of the related NLPCT... formats) with a suitable LOCALE setting (possibly your default).

280  %put %sysfunc(getoption(locale));
DE_DE
281
282  data _null_;
283  x=-0.171;
284  put x NLPCT6.1;
285  run;

-17,1%
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds


286
287  options locale=EN_US;
288
289  data _null_;
290  x=-0.171;
291  put x NLPCT6.1;
292  run;

-17.1%

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1045 views
  • 6 likes
  • 2 in conversation