9.7 - The FMTLIB Option

You might have taken note that the FORMAT procedure by itself does not generate any output. Indeed, the FORMAT procedure prints output only when you specify the FMTLIB option in the PROC FORMAT statement. The FMTLIB option of the FORMAT procedure tells SAS to display a list of all the formats and/or informats in your catalog, along with descriptions of their values. The FMTLIB option can be particularly helpful when you are working with a large catalog of formats, and have forgotten the exact spelling of a specific format name or its range of values.

Example 9.14 Section

The following code uses the FORMAT procedure's FMTLIB option to request that SAS display information about three formats appearing in the work.format catalog:

PROC FORMAT FMTLIB;
   title 'Selected Formats from WORK.FORMAT Catalog';
   select racefmt ssnpix dolpix;
RUN;

Selected Formats from WORK.FORMAT Catalog

  
----------------------------------------------------------------------------  
|       FORMAT NAME: DOLPIX   LENGTH:   10   NUMBER OF VALUES:    1        |  
|   MIN LENGTH:   1  MAX LENGTH:  40  DEFAULT LENGTH:  10  FUZZ: STD       |  
|--------------------------------------------------------------------------|  
|START           |END             |LABEL  (VER. V7|V8   12OCT2023:16:53:55)|  
|----------------+----------------+----------------------------------------|  
|LOW             |HIGH            |000,000.00          P$  F* M100         |  
----------------------------------------------------------------------------  
                                                                                                                        
                                                                                                                        
----------------------------------------------------------------------------  
|       FORMAT NAME: RACEFMT  LENGTH:    6   NUMBER OF VALUES:    4        |  
|   MIN LENGTH:   1  MAX LENGTH:  40  DEFAULT LENGTH:   6  FUZZ: STD       |  
|--------------------------------------------------------------------------|  
|START           |END             |LABEL  (VER. V7|V8   12OCT2023:16:45:18)|  
|----------------+----------------+----------------------------------------|  
|               1|               1|Indian                                  |  
|               2|               2|Asian                                   |  
|               3|               3|Black                                   |  
|               4|               4|White                                   |  
----------------------------------------------------------------------------  
                                                                                                                        
                                                                                                                        
----------------------------------------------------------------------------  
|       FORMAT NAME: SSNPIX   LENGTH:   11   NUMBER OF VALUES:    1        |  
|   MIN LENGTH:   1  MAX LENGTH:  40  DEFAULT LENGTH:  11  FUZZ: STD       |  
|--------------------------------------------------------------------------|  
|START           |END             |LABEL  (VER. V7|V8   12OCT2023:16:53:55)|  
|----------------+----------------+----------------------------------------|  
|LOW             |HIGH            |999-99-9999         P   F  M1           |  
----------------------------------------------------------------------------  

Launch and run  the SAS program and review the output. Since the FORMAT procedure here does not refer to a permanent library, the contents of the temporary work.formats catalog are printed. The SELECT statement tells SAS to print information only on a select few formats rather than on the entire catalog. (See SAS Help for more details on the SELECT statement and its sister EXCLUDE statement.)

Although not used in this example, the PAGE option may be used additionally to tell SAS to print the information about each format and informat in the catalog on a separate page.

PROC FORMAT FMTLIB PAGE;
RUN;

The FORMAT procedure's PAGE option is meaningless unless the FMTLIB option is also invoked.