LOGEDIT: Log edit user exit (DFSFLGE0 and other LOGEDIT exits)
The log edit exit routine allows you to alter the content of messages in IMS log data. This exit routine may be used to provide additional security by eliminating the logging of sensitive information under limited circumstances.
This topic contains Product-sensitive Programming Interface information.
After the message is edited, the message-related record is then logged. Even though the altered record is logged, IMS processes the original version of the message. After a subsequent restart, IMS processes the edited version of the message. If restart reschedules an edited message, the transaction might fail because of the edits.
Subsections:
About this routine
You can write a log edit exit routine that is called before each message-related log record is written to the log. The exit overlays segments of the record data with other data. The record types that are presented to the exit are controlled through the LOGEDIT statement in the LOGGER section of the DFSDFxxx PROCLIB member. If you want to use the REFRESH USEREXIT command to add the LOGEDIT user exit, you must have selected log records to edit when IMS initialized. If no records were selected, message DFS4586E is issued and the LOGEDIT user exit is not added.
The user exit cannot directly edit log data. Instead, it returns an offset and length where data is to be changed and the address of a replacement. IMS overwrites the actual record starting at the specified offset for the specified length using the data at the address indicated for replacement data.
The user exit can specify that no alterations are to be made. Or, after specifying an edit, it can indicate that further edits are needed in the same record.
If the offset or length that is specified extends outside the data portion of the record, no editing occurs, and the user exit is notified on the next call. The user exit can assess the situation, but no further editing of the record is allowed. After the user exit returns, it is called for the next record.
This user exit is optional. No default user exit and no samples are provided. The following table shows the attributes of the log edit user exit.
| Attribute | Description |
|---|---|
| IMS environments | DB/DC, DBCTL. |
| Naming convention | You can name this exit routine DFSFLGE0 and link it into a library that is included in the STEPLIB concatenation. If DFSFLGE0 is linked into a library in the STEPLIB concatenation and the USER_EXITS section of the DFSDFxxx member defines exit routines, the exit routines defined in the DFSDFxxx member will be loaded. DFSFLGE0 is only loaded if it is listed as one of the exit routines in the DFSDFxxx member. Alternatively, you can define one or more exit routine modules with the EXITDEF parameter of the USER_EXITS section of the DFSDFxxx member of the IMS.PROCLIB data set. The routines are called in the order that they are listed in the parameter. |
| Binding | You must bind the exit routine into IMS.SDFSRESL (or a library concatenated with it) as a separate reentrant load module. If the module is not present in the load library, the IMS logger does not load or call it. The following example demonstrates how to bind the exit routine into IMS.SDFSRESL.
|
| Including the routine | The module or modules must be included in an authorized library in the JOBLIB, STEPLIB, or LINKLIST concatenation. No additional steps are necessary to use a single exit routine that is named DFSFLGE0. If you use multiple exit routines, specify EXITDEF=(TYPE= LOGEDIT,EXIT=(exit_names)) in the EXITDEF parameter of the USER_EXITS section of the DFSDFxxx member of the IMS.PROCLIB data set |
| IMS callable services | This exit routine can use IMS callable services. This exit routine is defined to IMS as an IMS standard user exit. Exit routines that are defined to IMS receive the callable services token in the standard exit parameter list. This exit routine does not need to issue an initialization call (DFSCSII0) to use IMS callable services. This exit routine must be manually link-edited with DFSCSI00. |
| Sample routine location | No sample exit routine is provided. |
Attributes of this routine
The log edit user exit must be written as reentrant. The user exit receives control running in 31-bit addressing mode and must return control in that mode. It is called in TASK mode, with no locks held, and in non-cross memory, non-AR mode. In an online IMS environment, the log edit user exit runs in key 7, supervisor state, in the IMS control region address space.
Calling this routine
- Initialization call
- IMS calls the LOGEDIT user exit when the logger is initialized. IMS makes this call when it opens the first OLDS.
- Edit record call
- The log edit user exit is called immediately before the log record (OLDS or WADS) is written.
- Termination call
- IMS calls the
LOGEDIT user exit when the logger is terminated. IMS makes this call after it closes the output log and notifies DBRC. If IMS terminates abnormally, it attempts to make this
call from the log task ESTAE routine.
If IMS terminates abnormally, there might be cases when the logger cannot make the termination call to LOGEDIT. Therefore, your user exit must be able to tolerate not being called for termination.
Restrictions
The log edit user exit is subject to the following restrictions:
- This user exit should not modify any storage other than the parameter lists and associated work areas.
- All addresses, entry register contents, and parameter list contents can change from one call of the LOGEDIT user exit to the next call. One call should not depend on addresses from a prior call. The sole exception is the content of the work area indicated by SXPLAWRK, which will persist across calls.
- This user exit can call only z/OS® services that it is authorized to call. It must not call any internal IMS services.
Communicating with IMS
IMS communicates with this user exit through the entry registers, a parameter list, and the exit registers.
Content of Registers on Entry
| Register | Content |
|---|---|
| 1 | Address of the IMS standard user exit parameter list |
| 13 | Address of the save area. Your user exit must not change the first three words of this save area. This save area is not chained to any other IMS save area. |
| 14 | Return address to IMS. |
| 15 | Entry point of this user exit. |
Standard exit parameter list
This user exit uses the Version 6 standard exit parameter list. The address of the work area passed to this user exit in SXPLAWRK will be the same each time that this user exit is called.
If your LOGEDIT user exit can be called in an enhanced user exit environment, additional user exit routines might be called after your routine. When your user exit routine finds a transaction upon which to act, it can set SXPL_CALLNXTN in the byte that SXPLCNXT points to. This tells IMS to not call additional exit routines.
Function-specific parameter list on entry
The following table shows the content of the function-specific parameter list. The address of this parameter list is in the standard IMS user exit parameter list field SXPLFSPL.
| Field | Offset | Length | Content |
|---|---|---|---|
| LGEXVERA | X'0' | X'4' | Address of parameter list version number. |
| LGEXTYPA | X'4' | X'4' | Address of call type field. |
| The remaining fields apply only to the edit record call type: | |||
| LGEXRCDA | X'8' | X'4' | Address of log record image. |
| LGEXEINA | X'C' | X'4' | Address of edit instruction area. |
| LGEXFBKA | X'10' | X'4' | Address of feedback field. |
LGEXVERA points to LGEXVER, described in the following table:
| Field | Offset | Length | Content |
|---|---|---|---|
| LGEXVER | X'0' | X'4' | Parameter list version number. |
LGEXTYPA points to LGEXCTYPE, described in the following table:
| Field | Offset | Length | Content |
|---|---|---|---|
| LGEXCTYP | X'0' | X'4' | Call type:
|
As shown in the preceding table, some fields apply only to the record edit call.
- LGEXRCDA points to a copy of the log record. It does not point into a log buffer.
- LGEXEINA points to the edit instructions area mapped by LGEXEI (included in LCDSECT). These fields are described in the following table.
- LGEXFBKA points to the feedback field, described in Table 6:
| Field | Offset | Length | Content |
|---|---|---|---|
| LGEXFUNC | X'0' | X'4' | Functions. |
| LGEXFNC1 | X'0' | X'1' | Functions byte 1.
|
| X'1' | X'3' | Functions, reserved bytes. | |
| LGEXOFFS | X'4' | X'4' | Offset for the record edit call. |
| LGEXLENG | X'8' | X'4' | Length for the record edit call. |
| LGEXREPL | X'C' | X'4' | The address of the replacement data for the record edit call |
| Field | Offset | Length | Content |
|---|---|---|---|
| LGEXFDBK | X'0' | X'4' | Feedback field, which includes feedback to the exit routine from
IMS:
|
The user exit cannot actively edit log data. Instead, it returns an offset and length where data is to be changed and the address of a replacement. IMS overwrites the actual record starting at the specified offset for the specified length using the data at the address indicated for replacement data.
The edit instruction area is cleared before each record edit call. IMS edits the record only if LGEXEDIT is set on return to IMS. If the user exit needs to make another change in the same record, it must also set LGEXHOLD to have the same record presented again. The previous edit does not appear in the record image. IMS changes only the actual record.
Contents of registers on exit
Before returning to IMS, the user exit must restore all registers except for register 15, which must contain the following:
| Register | Contents |
|---|---|
| 15 | 0 |