To create a customized
currency representation, you can use the FORMAT procedure. The following
example shows the creation of unique formats for the Australian dollar,
the Swiss franc, and the British pound. For details about the FORMAT
procedure, see
Base SAS Procedures Guide.
SAS Code That Customizes Currency Representations
proc format;
picture aud low-<0='0,000,000,009.00'
(prefix='-AU$' mult=100)
0–high='0,000,00,009.00 '
(prefix='AU$' mult=100);
picture sfr low-<0='0,000,000,009.00'
(prefix='-SFr.' mult=100)
0–high='0,000,00,009.00 '
(prefix='-SFr.' mult=100);
picture bpd low-<0='0,000,000,009.00'
(prefix='-BPd.' mult=100)
0–high='0,000,00,009.00 '
(prefix='BPd.' mult=100);
run;
data currency;
input aud sfr bpd 12.2;
datalines;
12345 12345 12345
0 0 0
-12345 -12345 -12345
;
proc print data=currency noobs;
var aud sfr bpd;
format aud aud. sfr sfr. bpd bpd.;
title 'Unique Currency Formats';
run;
Customizing currency
representations offers flexibility, but requires a programming solution.