Previous Page | Next Page

The FORMAT Procedure

Example 7: Retrieving a Permanent Format


Procedure features:

PROC FORMAT statement options:

LIBRARY=

Other features:

FMTSEARCH= system option

Data sets:

SAMPLE.


This example uses the LIBRARY= option and the FMTSEARCH= system option to store and retrieve a format stored in a catalog other than WORK.FORMATS or LIBRARY.FORMATS.


Program

 Note about code
libname proclib 'SAS-library';
 Note about code
options nodate pageno=1 linesize=64 pagesize=60;
 Note about code
proc format library=proclib;
 Note about code
   picture nozeros
              low   -     -1  =  '00.00' (prefix='-'          )
               -1  <-<     0  =     '99' (prefix='-.' mult=100)
                0   -<     1  =     '99' (prefix='.'  mult=100)
                1   -   high  =  '00.00';
run;
 Note about code
options  fmtsearch=(proclib);
 Note about code
proc print data=sample;
   format amount nozeros.;
 Note about code
   title1 'Retrieving the NOZEROS. Format from PROCLIB.FORMATS';
   title2 'The SAMPLE Data Set';
run;

Output: Listing

      Retrieving the NOZEROS. Format from PROCLIB.FORMATS      1
                      The SAMPLE Data Set

                         Obs    Amount

                          1     -2.05 
                          2      -.05 
                          3      -.02 
                          4       .00 
                          5       .09 
                          6       .54 
                          7       .56 
                          8      6.60 
                          9     14.63 

Output: HTML

[untitled graphic]

Previous Page | Next Page | Top of Page