Help using Base SAS procedures

proc format picture question

Reply
Contributor
Posts: 58

proc format picture question

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 Smiley Happy)
I didn't find any hint on how to do it...
Thanks

Daniele
Super Contributor
Super Contributor
Posts: 3,174

Re: proc format picture question

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
Contributor
Posts: 58

Re: proc format picture question

Hi there,
actually, I had tried to change from comma to dot before writing (otherwise I wouldn't have written! Smiley Happy )
Thanks for the link, I'll take a look and hopefully solve this problem.
Best regards

Daniele
Respected Advisor
Posts: 3,886

Re: proc format picture question

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;
Contributor
Posts: 58

Re: proc format picture question

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...
Respected Advisor
Posts: 3,886

Re: proc format picture question

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 ;
Contributor
Posts: 58

Re: proc format picture question

Dear Patrick,
THANKS!! I couldn't find that options, and now I'm happy!! Smiley Very Happy
Best regards!

Daniele
Super Contributor
Posts: 394

Re: proc format picture question

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.
Ask a Question
Discussion stats
  • 7 replies
  • 296 views
  • 0 likes
  • 4 in conversation