MacKinney Systems, Inc.


We have a job which does the following:
    1. closes CICS files
    2. repros to a backup
    3. delete and defines the file
    4. opens CICS files

When the flow is separated into 3 jobs is runs fine:
     First job CICS close files.
     Second job repro backup, delete, define.
     Third job CICS open files.

But the symptom for the combined job has data set reserved at the very start of the job. I can't figure why they work separately but not together.


Most likely, dynamic allocation is occurring (look for SYS00xxx in your output) and assigning DISP=OLD to your dataset. The DISP=OLD is not released until the end of the job, not the end of the step. This prevents successful dataset OPENs in succeeding steps. To prevent dynamic allocation from occurring, do the following:

1. Add a FILE statement in the DELETE, DEFINE and VERIFY steps.
2. Use INFILE and OUTFILE in place of INDATASET and OUTDATASET in any REPRO steps.

You can also break your job into two jobs and put the OPENs in the second job.