Output file same as input file

There are no special z/OS Batch considerations when the file named in the output card a map is the same as the file named in its input card. Code one DD statement for both files with a disposition of OLD or SHR. If you are mapping your output back to the input, be careful using card overrides.

The following example will not work:

//STEP1 EXEC PGM=DTXCMDSV,PARM='MAP -IF1 INFILE -OF1 OUTFILE'
//INFILE DD DSN=MY.IOFILE,DISP=SHR
//OUTFILE DD DSN=MY.IOFILE,DISP=SHR

Instead, the JCL should read:

//STEP1 EXEC PGM=DTXCMDSV,PARM='MAP -IF1 IOFILE -OF1 IOFILE'
//IOFILE DD DSN=MY.IOFILE,DISP=SHR