BookmarkSubscribeRSS Feed
nicnad
Fluorite | Level 6

Hi,

I have numeric variable that are formated like the following:

format Montant 20.;

What is the proper way to format this variable so that thousands are separated with a space?

6 REPLIES 6
art297
Opal | Level 21

Just curious: where is that used?  There are a couple of formats that separate thousands with either periods or commas.

nicnad
Fluorite | Level 6

It is used by french canadian.

ballardw
Super User

Won't claim this is proper but seems to work for me:

 

proc format library=work;

picture mysep

0 - 9999999 = '000 000 000.00' (decsep='.' dig3sep=' ') ;

run;

data _null_;

x= 123456;

put x= mysep.;

run;

TomKari
Onyx | Level 15

This is handled by the SAS National Language Support routines. Your locale should be "French_Canada".

Give this a try:

options locale=French_Canada;

data _null_;

Montant=123456789;

format Montant nlnum20.2;

put Montant;

run;

nicnad
Fluorite | Level 6

Works Great! Thank you very much.

Quick question, can I put at the very top of my  code and it will be used in each data procedure?

art297
Opal | Level 21

You could always just put it in either your config or autoexec file.  That way it will be used every time you run SAS.

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 6 replies
  • 14139 views
  • 0 likes
  • 4 in conversation