Previous Topic: 7.3.2 IMS Application Unit DefinitionNext Topic: 7.3.4 IMS Processing Options (IMSOPS)


7.3.3 Code the IMS Application Unit Exit (IMSAURT)

An IMS Application Unit Derivation Routine is a user-written
routine, stored in prefix.MICS.PARMS(IMSAURT), that is
invoked for each transaction processed.  This SAS routine
assigns a value to the IMSAPU data element discussed in the
previous section.  For example, if the IMSAPU data element is
constructed from four different sources, this user routine
has the responsibility of building the data value from those
four fields for each transaction processed.

The user application unit routine is written in SAS.  The
testing and accuracy of the exit is the responsibility of the
user.  The worksheet for structuring the IMS Application Unit
Derivation Routine is shown in Figure 7-5.  However, the
CA MICS IMS Analyzer provides a sample application unit
derivation routine in member IMSAURT.

The application unit derivation routine has available for use
each of the data elements contained in the IMS monitor data
collection record.  The data elements that are most often
used to determine the application unit value are shown below:

  TRANSACT  - The IMS transaction ID
  LTERM     - The IMS terminal identifier
  PSBNAME   - The IMS Program Specification Block name
  TRANTYPE  - C/S/M/L/X for conversational, short, medium,
              long, or excessive transaction types
  ISUITYPE  - M for MPP transactions
              B for BMP transactions
              C for conversational transactions
              F for Fastpath message driven transactions
              N for Fastpath non-message driven transactions
              U for Fastpath utilities
              E for Explicit APPC
              D for DBCTL transactions
              (blank) when the execution method cannot be
              determined.

The objective of the Application Unit derivation process is
to build the data element IMSAPU from the data made available
in the IMS transaction detail data.


CODING CONSIDERATIONS

Follow these guidelines for coding this CA MICS exit routine:

  1.  Validating the data to ensure correct application
      units is generally a prudent measure.  When invalid
      codes are encountered, they should be assigned to the
      application codes representing the site's overhead
      accumulator.

      Note:  Allowing invalid or garbage application units
      into the CA MICS database will significantly increase
      the number of records and therefore the DASD space
      requirements of the IMS Information Area files.

  2.  Ensure that all of the required fields are available
      for application unit construction. Here are examples:

        o Certain transactions may be executed without being
          attached to a terminal facility.  This situation
          may occur for miscellaneous overhead transactions,
          such as certain BMP transactions.  Such a data
          collection record would have no valid terminal
          identifier present.

        o Data created by the IMS FORMAT command reports the
          message destination identifier rather than the
          transaction identifier in the type 1 log record.
          You can use the IMSRLRT exit to set
          TRANSACT=TRANSMID when TRANXORG=F.


EXAMPLE

Assume that the installation has defined two application unit
identification sources, and they are described as:

o Project is the first two characters of the terminal ID.
o Transaction is the transaction ID.

Furthermore, the values of Project may only be DD, TD, or
AS.  If this example were a banking application, these
projects might be Demand Deposits, Time Deposits, and
Administrative Services, respectively.

The SAS code defined for the user-application unit exit would
be as follows:

* ABC'S  IMS APPLICATION UNIT DERIVATION EXIT
*
*   PROJECT IS BUILT FROM POSITIONS 1-2 OF THE TERMINAL ID.
*   TRANSACTION IS BUILT FROM THE INPUT TRANSACTION ID.
*
*   IF THE PROJECT IS NOT EQUAL TO DD, TD, OR AS,
*      THE CODE IS INVALID AND THE APPLICATION UNITS SHOULD
*      BE SET TO THE INSTALLATION OVERHEAD APPLICATION UNITS.
*
   ;
    IMSAPU = SUBSTR(LTERM,1,2) || SUBSTR(TRANSACT,1,4) ||
             '      ' ;  /* BLANK FILL */
    IF IMSAPU NE :'DD' AND IMSAPU NE :'TD'
    AND IMSAPU NE :'AS' THEN GO TO AURTOVHD ;
    GOTO AURTRTEX ;

AURTOVHD:
    IMSAPU = '**          ' ;
AURTRTEX:







                           +--------------------------------------------------------------------------+
                           | INSTALLATION PREPARATION WORKSHEET: IMS Application Unit Routine         |
                           |                                     Definition                           |
                           | PARMS Library Member is IMSAURT                                          |
                           | Reference Section: 7.3.3                                                 |
                           +--------------------------------------------------------------------------+
                           |                                                                          |
                           | * VALIDATE FOR VALID APPLICATION UNITS, WHERE POSSIBLE ;                 |
                           |     IF application data is not valid GOTO AURTOVHD ;                     |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | * BUILD APPL. UNIT FIELDS;                                               |
                           |     IMSAPU =field source 1 ||                                            |
                           |             field source n ;                                             |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           |     GOTO AURTRTEX ;                                                      |
                           | * LINKED ROUTINE TO BUILD INSTALLATION OVERHEAD APPLICATION UNITS;       |
                           | AURTOVHD:                                                                |
                           |     IMSAPU ='overhead category' ;                                        |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | ________________________________________________________________________ |
                           | AURTRTEX:                                                                |
                           +--------------------------------------------------------------------------+
                           | ....5...10...15...20...25...30...35...40...45...50...55...60...65...70.. |
                           +--------------------------------------------------------------------------+


Figure 7-5. IMS Application Unit Exit Worksheet