FORMAT Procedure

SELECT Statement

Selects entries for processing by the FMTLIB and CNTLOUT= options.
Restrictions: Only one SELECT statement can appear in a PROC FORMAT step.

You cannot use a SELECT statement and an EXCLUDE statement within the same PROC FORMAT step.

Printing the Description of Informats and Formats

Syntax

SELECT entry(s);

Required Argument

entry(s)
specifies one or more catalog entries for processing. Catalog entry names are the same as the name of the informat or format that they store. Because informats and formats can have the same name, and because character and numeric informats or formats can have the same name, you must use certain prefixes when specifying informats and formats in the SELECT statement. Follow these rules when specifying entries in the SELECT statement:
  • Precede names of entries that contain character formats with a dollar sign ($).
  • Precede names of entries that contain character informats with an at sign and a dollar sign (for example, @$entry-name).
  • Precede names of entries that contain numeric informats with an at sign (@).
  • Specify names of entries that contain numeric formats without a prefix.

Details

Shortcuts to Specifying Names

You can use the colon (:) and hyphen (-) wildcard characters to select entries. For example, the following SELECT statement selects all formats or informats that begin with the letter a.
select a:;
In addition, the following SELECT statement selects all formats or informats that occur alphabetically between apple and pear, inclusive:
select apple-pear;

How the FMTLIB and CNTLOUT= Options Affect Whether a Catalog Is Opened in Read or Update Mode

Using the FMTLIB and CNTLOUT= options in the SELECT statement indicates whether a catalog is opened for read or update mode. The following rules apply:
  • If you use the SELECT statement and do not specify the FMTLIB or the CNTLOUT= option, PROC FORMAT assumes that the catalog is opened in update mode.
  • If you use the SELECT statement and specify the FMTLIB or the CNTLOUT= option, the catalog is opened for read access.
  • If you use the SELECT statement without the FMTLIB or the CNTLOUT= option, and the SAS program does not have write access to the catalog, the following error is written to the SAS log:
    ERROR: User does not have appropriate authorization level
           for file libref.FORMATS.CATALOG.