Problem:
The customer was encountering an error with the catalog update API used in the MVSCAT FDS.
Simulation of issues indicate the following:
• Compile and deploy CATBUG as a mainframe dialect program or “DIALECT(MF) FCDCAT OUTDD(SYSOUT 121 R)”
• Run the GENDATA1.JCL to create the TEST.NDM.BASE dataset.
Below steps show catalog API failing for REPL when the catalog record was created using ESMAC. :
• In ESMAC copy the dataset to TEST.NDM. Ensure that the PCDSN is changed to TEST.NDM.DAT.
• In the data directory copy the TEST.NDM.BASE.DAT to TEST.NDM.DAT
• Submit the CATBUG.JCL. You should receive a status 20.
Below steps show catalog API failing for REPL when catalog record was created using JCL:
• Submit either ALTER.JCL or IEBGENR.JCL to copy the dataset to TEST.NDM
• Submit CATBUG.JCL. Yow will get "FILE NOT FOUND IN CATALOG: TEST.NDM"
See the attached demo for the recreation of this issue.
Resolution:
A program that opens an allocated dataset cannot perform an update on the catalog record of that same file within the same step. Altering the catalog record of the file might interfere with the disposition handling of the file at step-end. To resolve this issue, the CTLB-FREE-CLOSE flag was set on the dynamically allocated dataset. This CTLB-FREE-CLOSE flag ensures that the disposition handling of the file is performed when the file is closed and not at step-end. By implementing disposition handling, the file is closed, and it is possible to update the catalog record. The above simulation steps shown on the surface appear completely legal to do and only requires a single line change to make it work.
Related Incident: 3227114
#MFDS
#EnterpriseDeveloper
