www.sas.com > SAS UK > In the Know Homepage Search | Contact Us    
SAS UK Newsletter Banner SAS - The power to know(tm)  

How Do I Get a Pound (£) Symbol in my SAS Output Within SAS® 8 and SAS®9?

Although SAS does not have a standard pound format, there are a number of different ways to get the pound (£) symbol in your SAS output depending on the version of SAS you are running.

SAS® 8

Here are two examples when using SAS® 8.

1. Using a custom picture format.


Proc format; 
picture sterling 
low -<0="000,009.99" (prefix='-£') 
0 - high= "000,009.99" (prefix='£');
run;
proc print data=sashelp.class;
format weight sterling.;
run;

2. Using the debug option along with a Euro format.


options debug='Euro=A3';
proc print data=sashelp.class;
format height Euro10.2;
run;

This option is normally set to 45 for the Euro (€) symbol. If you would like to set this permanently to a pound (£) symbol, go to the command bar in SAS and type Regedit. Navigate to SAS_REGISTRY ' CORE ' LSW ' ENCODE and set the value to the hex character A3.

For information on determining hex characters please have a look at the following HINTS & TIPS.
http://www.sas.com/offices/europe/uk/newsletter/feature/5oct_nov03/ht1.html

SAS®9

Although the SAS® 8 examples will also work within SAS®9, a new option LOCALE has been added to SAS®9 to pick up locale settings. A locale reflects the language, local conventions such as data formatting, and culture for a geographical region. Local conventions may include specific formatting rules for dates, times, and numbers and a currency symbol for the country or region. Collating sequence, paper size, postal addresses, and telephone numbers can also be included in locale.

The option LOCALE can be set using any of the following methods.

Within SAS Options, Tools ' Options ' System ' Environment control ' Language control. Within the configuration file SASv9.cfg, by altering the following line: -LOCALE "EN_GB" Within SAS code, use an options statement as in the following example.


Options locale=EN_GB;
data _null_;
X=15.20;
put X=nlmny15.2;
put X=nlmnyi15.2;
run;