Delete $year format from sasfmt.commonfmt catelog.
- Use year.formatc to indicate character format.
- Use .format to indicate numeric format.
- “/ entrytype = format” can be omitted.
- For Proc Catalog procedure, need Quit to close it.
- Also no need to put $ sign before the format name Year.
proc catalog catalog =sasfmt.commonfmt ; delete year.formatc / entrytype=format; quit;
Assume there is a $year format in the work library. Copy the $year format to the sasfmt.commonfmt.
The best practice is developing a local permanent format catalog for common usage, in this case the sasfmt.commonfmt. If I need to create new format for the SAS work and the format is reusable, then I will copy the format from work library to the sasfmt.commonfmt catalog so I don’t have to recreate the format in the future.
- Use Proc Catalog procedure
- catalog= for the source catalog
- out= for the target catalog
- Use Copy statement for the copying formats
- Use Select statement to select specific format to be copied. If Select statement is omitted, then all the formats in the source catalog will be copied to the target catalog.
Proc catalog catalog=work.formats; copy out=SASFMT.COMMONFMT; select year.formatc; quit;
Check the $Year format in the sasfmt.commonfmt catalog.
- Use Proc Format procedure
- Use fmtlib option to display the details of format.
- lib= for the format catalog
- Use Select statement to identify specific formats to be displayed. This becomes useful when the catalog contains a large number of formats.
proc format fmtlib lib=sasfmt.commonfmt ; select $year; run;