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?
Just curious: where is that used? There are a couple of formats that separate thousands with either periods or commas.
It is used by french canadian.
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;
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;
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?
You could always just put it in either your config or autoexec file. That way it will be used every time you run SAS.
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.
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.