4. CA MICS Facilities › 4.3 User Exit Facilities › 4.3.1 Definition and Methodology › 4.3.1.2 Indirect Exit Points
4.3.1.2 Indirect Exit Points
Indirect exit points are implemented by coding a SAS Macro
variable to indicate the name of a user source library
concatenated member to insert.
The general form of a indirect exit is:
%LET exit-point-name = user-source-member-name ;
where exit-point-name indicates the function and location of
the Macro within the CA MICS code.
CA MICS indirect exit point names are structured as follows:
USRtfff
where t is a 1-byte function code, and
fff is a file identifier.
These exit points are stored in members called #cccEXIT on
the sharedprefix.MICS.SOURCE library, where ccc is the
component identifier. The exit routines contained in these
members will apply to all database units in the CA MICS
complex.
For purposes of the description of indirect exits below, let
us assume a hypothetical component identifier of ccc. An
example of such an exit member is #cccEXIT, which contains
the file manipulation, accounting modification, and
operational exits for the CCC Component. This member
includes the definition of an indirect exit point whose
purpose is file and accounting modification of the CCCFFF
file. The Macro is called USRSFFF. If
sharedprefix.MICS.SOURCE(#cccEXIT) contains a %LET statement
for the USRSFFF exit point, it must look like the following:
.
.
%LET USRSFFF = EXITMEM1:
.
.
Coding the statement above will cause SAS logic residing in
prefix.MICS.USER.SOURCE(EXITMEM1) to be %INCLUDEd and
executed at the point at which the USRSFFF exit point occurs
in distributed CA MICS code.
Indirect exit points are defined by the occurrence of a
reference to the CA MICS %FXIT Macro in CA MICS SAS code. The
%FXIT Macro is the CA MICS conditional include of user-coded
exit logic. If the exit point for which the %FXIT Macro is
referenced has been defined, a
%INCLUDE USOURCE(member-name-list);
will be generated at that point in the CA MICS SAS
compilation. If no exit point definition has occurred prior
to the %FXIT Macro invocation, no %INCLUDE is generated.
Here is an illustration of the method, again using the
example of file FFF in component CCC:
contents of sharedprefix.MICS.SOURCE(#cccEXIT):
.
.
.
%LET USRSFFF = EXITMEM1;
.
.
.
contents of prefix.MICS.USER.SOURCE(EXITMEM1):
RETAIN MYCONST 4;
FFFCPUTM = FFFCPUTM * MYCONST;
Some exits are intended for use by a specific database unit.
This is the case, for example, with exits to be used with
CA MICS Accounting and Chargeback. For this purpose, exit
routine invocation is channeled through the
prefix.MICS.USER.SOURCE library in each database unit. The
previous definition of an exit macro can be overridden by a
definition added after the sharedprefix.MICS.SOURCE library
member is included. In the example, a USRSFFF exit point has
been defined in sharedprefix.MICS.SOURCE(#cccEXIT). To
override this definition for a particular database unit,
redefine the variable in prefix.MICS.USER.SOURCE(#cccEXIT),
as:
contents of prefix.MICS.USER.SOURCE(#cccEXIT):
/* some comments */
%INCLUDE SOURCE(#cccEXIT);
--->%LET USRSFFF = EXITMEM2;
contents of prefix.MICS.USER.SOURCE(EXITMEM2):
RETAIN MYTWO 2;
FFFEXCPS = FFFEXCPS / MYTWO;
The exit member referenced by the database unit's daily
update cycle is in prefix.MICS.USER.SOURCE. In our example,
the daily CCC format routine (DYCCCFMT) would include
prefix.MICS.USER.SOURCE(#cccEXIT), which itself includes
sharedprefix.MICS.SOURCE(#cccEXIT). The diagram below
illustrates the flow for any given database unit.
DYCCCFMT:
|.
|.
|%INCLUDE USOURCE(#cccEXIT);
|
prefix.MICS.USER.SOURCE(#cccEXIT)
contains:
|.
|.
|%INCLUDE SOURCE(#cccEXIT);
|
sharedprefix.MICS.SOURCE(#cccEXIT)
contains:
|
|.
|.
|%LET USRSFFF = EXITMEM1;
|.
|.
|.
|.
|.
|.
|%FXIT(NAME=USRSFFF);
(which resolves to null)
|.
|.
To code an exit local to the database unit requires you to
redefine the variable in the prefix.MICS.USER.SOURCE library
member after the sharedprefix.MICS.SOURCE library copy or
stub has been included. In our example, USRSFFF would be
redefined as:
DYCCCFMT:
|.
|.
|%INCLUDE USOURCE(#cccEXIT);
|
prefix.MICS.USER.SOURCE(#cccEXIT)
contains:
|.
|.
|%INCLUDE SOURCE(#cccEXIT);
|
sharedprefix.MICS.SOURCE(#cccEXIT)
contains:
|.
|%LET USRSFFF = EXITMEM1;
|.
|.
--->|%LET USRSFFF = EXITMEM1 EXITMEM2;
|.
|.
| %FXIT(NAME=USRSFFF);
(which resolves to)
| %INCLUDE USOURCE(EXITMEM1 EXITMEM2);
(which includes EXITMEM1)
| RETAIN MYCONST 4;
| FFFCPUTM = FFFCPUTM * MYCONST;
(and includes EXITMEM2)
| RETAIN MYTWO 2;
| FFFEXCPS = FFFEXCPS / MYTWO;
|.
|.
|.