Formats are used to output data in a formatted way.
e.g. as we know SAS stores date as numeric number i.e. number of days
from 01Jan1960.
So if you display date without formatting i.e.
put dt;
it will look like some thing -
18549
Which is bit difficult for user to calculate actual date from this number.
Now if you display it using format date9 e.g.
put dt date9.;
it will come out as 14OCT2010,which sounds much better.
There are number of formats,some of the most common formats are -
w.
w.d
$w
$charw.
DOLLARw.d
COMMAw.d
MMDDYY10.
DATE9.
where -
The w indicates the width (bytes or number of columns) of the
variable.
The d is used for numeric data to specify the number of digits to the right of the decimal place.
Oct 14, 2010