BookmarkSubscribeRSS Feed
DanieleTiles
Calcite | Level 5
Hi to all,
I've got a simple picture format:

proc format;
picture posval low-high='000,009';
run;

However, I've got this problem: I'd like to represent the number as it would appear with a commax value (so it'd be shown like 200.000 and not as 200,000...in Italy we use a different format :))
I didn't find any hint on how to do it...
Thanks

Daniele
7 REPLIES 7
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
You have SAS-standard NLS (National Language Support) formats which address the decimal/comma consideration. You will need to look in the SAS National Language Support (NLS): Reference Guide for details, however I provided a DOC link below which mentions them.

Or, the PICTURE statement you have shown can also be changed from a comma to a period.

Scott Barry
SBBWorks, Inc.


Formats Documented in Other SAS Publications
The main references for SAS formats are SAS Language Reference: Dictionary and the SAS National Language Support (NLS): Reference Guide. See the documentation for your operating environment for host-specific information about formats.
http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a003168458.htm
DanieleTiles
Calcite | Level 5
Hi there,
actually, I had tried to change from comma to dot before writing (otherwise I wouldn't have written! 🙂 )
Thanks for the link, I'll take a look and hopefully solve this problem.
Best regards

Daniele
Patrick
Opal | Level 21
Hi Daniele

Have a look at the following. I assume one of the options should cover your needs.

HTH
Patrick

options LOCALE=Italian_Italy;
data _null_;
a=200000.001;
put a= best32.2;
put a= nlnum32.2;
put a= nlnumi32.2;
put a= comma32.2;
put a= commax32.2;
run;

options LOCALE=English_UnitedStates;
data _null_;
a=200000.001;
put a= best32.2;
put a= nlnum32.2;
put a= nlnumi32.2;
put a= comma32.2;
put a= commax32.2;
run;
DanieleTiles
Calcite | Level 5
Hi Patrick,
I've tried with the options Locale, but I didn't see any change in the picture format...with normal formats I've no problem in replacing dot with comma.
Only with the picture one...
Patrick
Opal | Level 21
Hi Daniele

The example below based on http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0305d&L=sas-l&P=31270

What would we do without Google 🙂

HTH
Patrick


proc format ;
picture q low - high = '000.009,999' (decsep="," dig3sep=".");
run ;

data _null_ ;
x = 200 ;
put x= q. ;
x = 200000 ;
put x= q. ;
x = 200000.001 ;
put x= q. ;
run ;
DanieleTiles
Calcite | Level 5
Dear Patrick,
THANKS!! I couldn't find that options, and now I'm happy!! 😄
Best regards!

Daniele
Tim_SAS
Barite | Level 11
Just as a shout-out for our Publications folks, here's the online documentation for those two options.

http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a002473467.htm#a003281531.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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