4. CA MICS Facilities › 4.5 User-defined Informats and Formats
4.5 User-defined Informats and Formats
To validate the contents of a SAS variable by looking for
specific values, you can create a SAS informat or format to
search a table in a SAS DATA step rather than coding numerous
lines of SAS code. If the permissible values used to build
the format table are contained in a sequential or partitioned
data set, SAS code can be written to input the file that
contains the information and create the necessary PROC FORMAT
SAS code to build the SAS format.
The SAS DATA step that performs the table search process
would contain only a few lines to use the PUT function to
perform the table search and, based on the search results,
execute specific SAS statements like creating an observation
for all non-matching conditions in a CA MICS file. A SAS
format can also be used to translate the value in a SAS
variable into another meaningful value, such as deriving an
account code value based on the job name or user
identification value.
SAS Format Catalogs
-------------------
SAS stores the output of PROC FORMAT in a special member type
of a SAS data library called a catalog. SAS data libraries
that contain catalogs are commonly called object libraries.
A SAS object library can contain any number of format
catalogs. These formats can be either temporary or
permanent. Temporary formats are stored in a catalog on the
WORK data set and are available only for the life of the SAS
job step. Permanent formats are stored in a permanent SAS
object library and are available to multiple job step
executions.
CA MICS supports three specific format catalogs to store
permanent informats and formats at both the complex and unit
levels. The catalog names and uses are defined as follows:
USERFMT1 - To store user-defined informats and formats
that override standard CA MICS formats. Entries should be
placed in this catalog with extreme caution. Formats
placed in this catalog with the same name as standard
CA MICS informats and formats will be found first and
used in place of the standard ones. This may cause
unpredictable results and should only be done with the
assistance of Technical Support.
USERFMT2 - To store user-defined informats and formats
that augment standard CA MICS formats. We recommend that
you store all user-defined informats and formats here
unless specific circumstances require that you override a
standard CA MICS format.
MICSFMTS - To store informats and formats distributed
with CA MICS or defined by standard CA MICS facilities
during the installation and maintenance processes.
User-defined informats and formats should NOT be placed
in this catalog.
Complex-level format catalogs are stored in
sharedprefix.MICS.MCOLIB and are available in all standard
CA MICS cataloged procedures. Unit-level format catalogs,
stored in prefix.MICS.MUOLIB, are available in all standard
unit-level CA MICS cataloged procedures. In addition, the
CA MICS Workstation Facility will provide access to the
appropriate object libraries.
CA MICS processes define the search order for these format
catalogs through the use of the SAS OPTIONS statement. The
WORK.FORMATS format catalog is always defined first in the
search order and is typically followed by the MCOLIB format
catalogs, which are succeeded by the MUOLIB format catalogs,
and finally the SAS format catalog. Utilizing the USEROBJLIB
JCLDEF/JCLDEFC option would add your user-defined formats
catalog to the end of the search order. This search order
may vary by the process or job being executed.
For example,
OPTIONS FMTSEARCH=(WORK.FORMATS MCOLIB.USERFMT1
MCOLIB.MICSFMTS MCOLIB.USERFMT2 MUOLIB.USERFMT1
MUOLIB.MICSFMTS MUOLIB.USERFMT2 LIBRARY.FORMATS);
Some processes such as MICF inquiries define the unit level
(MUOLIB) format catalogs ahead of the complex level (MCOLIB)
format catalogs whenever a unit database has been selected.
The order of the MUOLIB definition on the FMTSEARCH option
will coincide with the order that units have been selected.
In other words, the first unit selected in a File Selection
Step for example, would be the first format catalog defined
on the FMTSEARCH option.
Creating User-defined Informat/Format Catalog Entries
-------------------------------------------------------
Since both complex- and unit-level format catalogs are stored
in SAS object libraries, updating these catalogs requires
exclusive use of the libraries (DISP=OLD). To eliminate
contention problems between batch and TSO users accessing the
CA MICS system, all users acquire a temporary copy of the
CA MICS object libraries (MCOLIB and MUOLIB) automatically
during initial processing. This means that updates to the
temporary copy of your user format catalogs must also be made
to the permanent SAS object library. If you use the standard
CA MICS jobs, USERFMTC and USERFMTU, to update your temporary
user format catalogs, then the permanent SAS object library
will be updated automatically.
Note: Remember to monitor the size of the CA MICS object
libraries over time. The number of user formats created by
your users dictates the amount of space that is optimal for
your site.