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.

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!

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.

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