File control recovery sample exit program: DFH$FCLD

DFH$FCLD is a sample exit program that is designed to be invoked at the XFCLDEL exit. It allows you to perform logical deletion of records from a VSAM ESDS data set or a BDAM data set during backout.

About DFH$FCLD

DFH$FCLD provides sample processing for the file control logical delete global user exit, XFCLDEL. The exit program, if enabled at the XFCLDEL exit point, is invoked when a WRITE to a VSAM ESDS or BDAM data set is being backed out. Because these access methods do not support a physical delete operation, special action must be taken to provide a logical delete function. Normally this involves flagging the record in a way that application programs that use the data set recognize as meaning the record has been deleted.

There is more information about using the XFCLDEL user exit, and about the DFH$FCLD sample program, in the comments within the DFH$FCLD source code.

In summary, DFH$FCLD performs the following processing:
  • Makes a user trace entry if tracing is active for file control. This has trace point id X'01F0' and traces:
    • An eye-catcher ‘DFH$FCLD ENTRY'
    • The unmarked file control request data
    • The file control portion of the log record.
  • Issues an EXEC CICS® INQUIRE FILE command to check the access method and type to confirm that the file is a VSAM ESDS or BDAM data set. The logical delete exit should have been invoked only if the file is one of these types.
  • For a VSAM ESDS:
    • Flags the record (whose address is passed to the exit in UEPFDATA) as logically deleted. The sample adopts what is probably the most common convention, which is to flag the first byte with a logical delete mark of X'FF'.
    • Takes the normal exit from the program.
  • For BDAM:
    • Flags the record (whose address is passed to the exit in UEPFDATA) as logically deleted. The sample adopts a convention for BDAM of flagging the first byte with a logical delete mark of X'C0'.
    • Takes the normal exit from the program.
  • For any other combination of access method and type:
    • Does not process the request, and the record is not flagged as deleted
    • Takes the error exit from the program.
  • Normal exit from the program:
    • Makes a user trace entry if tracing is active for file control. This has trace point id X'01F1' and traces:
      • An eye-catcher ‘DFH$FCLD EXIT OK'
      • An eye-catcher ‘RECORD MARKED AS DELETED'
      • The marked file control request data
      • The file control portion of the log record.
    • Returns to CICS with return code UERCLDEL, which instructs CICS to rewrite the marked record and therefore to logically delete it.
  • Error exit from the program:
    • Makes a user exception trace entry regardless of the trace setting. This has trace point id X'01F2' and traces:
      • An eye-catcher ‘USEREXC'
      • An eye-catcher ‘DFH$FCLD EXIT FAIL'
      • The unmarked file control request data
      • The file control portion of the log record.
    • Returns to CICS with return code UERCFAIL, which instructs CICS to regard the logical delete as having failed. (The return code UERCNORM is not intended for use by this exit. Returning UERCNORM has the same effect as UERCFAIL.)

Setting up DFH$FCLD

To define file control recovery sample exit programs including DFH$FCLD, specify the supplied resource group DFH$FCB in your startup grouplist, or use CEDA to install DFH$FCB.