amount=1145.32; put amount dollar10.2;
$1,145.32
num=15; char=put(num,hex2.);
%macro tst(amount); %put %sysfunc(putn(&amount,dollar10.2)); %mend tst; %tst (1154.23);
format sales1-sales3 comma10.2;Because the FORMAT statement permanently associates a format with a variable, any subsequent DATA step or PROC step uses COMMA10.2 to write the values of SALES1, SALES2, and SALES3.
attrib sales1-sales3 format=comma10.2;Because the ATTRIB statement permanently associates a format with a variable, any subsequent DATA step or PROC step uses COMMA10.2 to write the values of SALES1, SALES2, and SALES3.
System Option
|
Result
|
---|---|
FMTERR
|
SAS produces an error
that causes the current DATA or PROC step to stop.
|
NOFMTERR
|
SAS continues processing
and substitutes a default format, usually the BESTw.
or $w. format.
|