把format输出到表
proc format cntlout=表名 library=库名;select 输出的format列表;
run;
PROC FORMAT Statement
PROC FORMAT <option(s)>; |
To do this | Use this option | |
---|---|---|
Specify a SAS data set from which PROC FORMAT builds an informat or format | CNTLIN= | |
Create a SAS data set that stores information about informats or formats | CNTLOUT= | |
Print information about informats or formats | FMTLIB | |
Specify a SAS 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 | PAGE |
|
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, the procedure searches only the default data library (either the WORK data library or USER data library) for the data set, regardless of whether you specify the LIBRARY= option.
Tip: A common source for an input control data set is the output from the CNTLOUT= option of another PROC FORMAT step.
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.
If you are creating an informat or format in the same step that the CNTLOUT= options appears, the informat or format that you are creating is included in the CNTLOUT= data set.
If you specify a one-level name, the procedure stores the data set in the default data library (either the WORK data library or the USER data 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.
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, try increasing your linesize. Tip: If you use the SELECT or EXCLUDE statement and omit the FMTLIB and CNTLOUT= options, the procedure invokes the FMTLIB option and you receive FMTLIB option output.
LIBRARY=
libref<.catalog>
-
specifies a catalog to contain informats or formats you are creating in the current PROC FORMAT step. The procedure stores these informats and formats in the catalog you specify so that you can use them in subsequent SAS sessions or jobs.
Alias: LIB= Default: WORK.FORMATS Tip: SAS automatically searches LIBRARY.FORMATS. You may want to use the LIBRARY libref for your format catalog.
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, the procedure warns you that the informat or format already exists and replaces it. 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.