Example of how XFCREQ and XFCREQC can be used
In this example, XFCREQ and XFCREQC are used to obtain a record containing compressed data, to decompress the data, and to return it to the area specified by the user program as INTO. The example shows only the capabilities of the exits; it is not intended to indicate an ideal way of achieving the function.
- In XFCREQ:
-
- Issue an EXEC CICS GETMAIN to obtain an area large enough to hold the decompressed data.
- Change the INTO pointer to point to this new area, so that File Control uses it when it processes the request. (The decompressed data is copied to the user's INTO area, and the INTO pointer reset, before return to the application program—see stages 4 and 7 of the processing to be done by XFCREQC.)
- Set UEPFCTOK to be the address of the new area so that XFCREQC can also use this area.
- Return to CICS®.
- In XFCREQC:
-
- Check ‘UEPRCODE' to make sure that the file control request completed without error.
- Use UEPFCTOK to find the address of the area. This area now holds the compressed data.
- Decompress the data in place.
- Copy the data from the new area to the user's INTO area. Use the user-specified LENGTH (from the command-level parameter list) to ensure that the data fits and that the copy does not cause a storage violation.
- Set ‘LENGERR' in UEPRESP, UEPRESP2, and UEPRCODE if the data does not fit.
- Use EXEC CICS FREEMAIN to free the work area pointed to by UEPFCTOK.
- At this point the command-level parameter list points to the now free area as the address for INTO. This is not a problem, because after completion of XFCREQC File Control restores this pointer to point to the area supplied by the user program.
- Return to CICS.