Joined: 16 May 2005 Posts: 32 Location: Millenium Business Park, Mumbai
I have a input dataset of length 1900. My requirement is to create an output dataset of 1902 by prefixing a value say '01' in the input dataset. I'm able to do this by siffixing a value at end but I am curious to know that how can we prefix a value using Overlay parameter.
Below is my JCL to add a suffix in a dataset using overlay.
Guess, the option OVERLAY is to write over the record in the Input Dataset. This means U can only overwrite the record and U cant insert a new value in the begining of the record. Instead, you can use SORT program to insert a new value in the starting position.
And the JCL is
//STEP1 EXEC PGM=SORT
//SORTIN DD DSN=INPUT.DATASET,DISP=SHR => Record length 80
//SORTOUT DD DSN=OUTPUT.DATASET,DISP=SHR => Rec Length 81
//SYSIN DD *
OUTREC FIELDS=(C'1',2:1,80) => Inserts '1' in position 1 in output rec.