Previous Page | Next Page

The FORMAT Procedure

PROC FORMAT Statement


Tip: You can use data set options with the CNTLIN= and CNTLOUT= data set options. See Data Set Options for a list.

PROC FORMAT <option(s)>;

Task Option
Specify a SAS data set from which PROC FORMAT builds informats or formats. CNTLIN=
Create a SAS data set that stores information about informats or formats. CNTLOUT=
Print information about informats or formats. FMTLIB
Specify a SAS library or catalog that will contain the informats or formats that you are creating in the PROC FORMAT step. LIBRARY=
Specify the number of characters of the informatted or formatted value that appear in PROC FORMAT output. MAXLABLEN=
Specify the number of characters of the start and end values that appear in the PROC FORMAT output. MAXSELEN=
Prevent a new informat or format from replacing an existing one of the same name. NOREPLACE
Print information about each format and informat on a separate page (table note 1) PAGE

TABLE NOTE 1:  Used in conjunction with FMTLIB. If PAGE is specified, FMTLIB is invoked (or assumed). [arrow]


Options

CNTLIN=input-control-SAS-data-set

specifies a SAS data set from which PROC FORMAT builds informats and formats. CNTLIN= builds formats and informats without using a VALUE, PICTURE, or INVALUE statement. If you specify a one-level name, then the procedure searches only the default library (either the WORK library or USER library) for the data set, regardless of whether you specify the LIBRARY= option.

Note:   LIBRARY= can point to either a library or a catalog. If only a libref is specified, a catalog name of FORMATS is assumed.  [cautionend]

Tip: A common source for an input control data set is the output from the CNTLOUT= option of another PROC FORMAT step.
See also: Input Control Data Set
Featured in: Creating a Format from a Data Set
CNTLOUT=output-control-SAS-data-set

creates a SAS data set that stores information about informats and formats that are contained in the catalog specified in the LIBRARY= option.

Note:   LIBRARY= can point to either library or a catalog. If only a libref is specified, then a catalog name of FORMATS is assumed.  [cautionend]

If you are creating an informat or format in the same step that the CNTLOUT= option appears, then the informat or format that you are creating is included in the CNTLOUT= data set.

If you specify a one-level name, then the procedure stores the data set in the default library (either the WORK library or the USER library), regardless of whether you specify the LIBRARY= option.

Tip: You can use an output control data set as an input control data set in subsequent PROC FORMAT steps.
See also: Output Control Data Set
FMTLIB

prints information about all the informats and formats in the catalog that is specified in the LIBRARY= option. To get information only about specific informats or formats, subset the catalog using the SELECT or EXCLUDE statement.

Interaction: The PAGE option invokes FMTLIB.
Tip: If your output from FMTLIB is not formatted correctly, then try increasing the value of the LINESIZE= system option.
Tip: If you use the SELECT or EXCLUDE statement and omit the FMTLIB and CNTLOUT= options, then the procedure invokes the FMTLIB option and you receive FMTLIB option output.
Featured in: Printing the Description of Informats and Formats
LIBRARY=libref<.catalog>

specifies a catalog to contain informats or formats that you are creating in the current PROC FORMAT step. The procedure stores these informats and formats in the catalog that you specify so that you can use them in subsequent SAS sessions or jobs.

Note:   LIBRARY= can point to either a library or a catalog. If only a libref is specified, then a catalog name of FORMATS is assumed.  [cautionend]

Alias: LIB=
Default: If you omit the LIBRARY= option, then formats and informats are stored in the WORK.FORMATS catalog. If you specify the LIBRARY= option but do not specify a name for catalog, then formats and informats are stored in the libref.FORMATS catalog.
Tip: SAS automatically searches LIBRARY.FORMATS. You might want to use the LIBRARY libref for your format catalog. You can control the order in which SAS searches for format catalogs with the FMTSEARCH= system option. For further information about FMTSEARCH=, see the section on SAS system options in SAS Language Reference: Dictionary.
See also: Storing Informats and Formats
Featured in: Creating a Picture Format
MAXLABLEN=number-of-characters

specifies the number of characters in the informatted or formatted value that you want to appear in the CNTLOUT= data set or in the output of the FMTLIB option. The FMTLIB option prints a maximum of 40 characters for the informatted or formatted value.

MAXSELEN=number-of-characters

specifies the number of characters in the start and end values that you want to appear in the CNTLOUT= data set or in the output of the FMTLIB option. The FMTLIB option prints a maximum of 16 characters for start and end values.

NOREPLACE

prevents a new informat or format that you are creating from replacing an existing informat or format of the same name. If you omit NOREPLACE, then the procedure warns you that the informat or format already exists and replaces it.

Note:   You can have a format and an informat of the same name.  [cautionend]

PAGE

prints information about each format and informat (that is, each entry) in the catalog on a separate page.

Tip: The PAGE option activates the FMTLIB option.

Previous Page | Next Page | Top of Page