I have a control card like the below:
Record length of both input and output file is 620 and it is fixed format.
when i try copy the record from input file using overlay statemnt, it is working fine for 01 type record.
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(81,2,CH,EQ,C'01'),OVERLAY=(1:1,181,
182,21,203,21,224,21,
245,21,266,21,287,21,
308,21,329,21,350,21,
371,21,392,21,413,21,
434,21,455,21,476,145))
Input file:
6----+----7----+----8----+----9----+----0----+----1----+-
************** Top of Data ******************************
5165550290H V N5165550290BAV N
Output file:
6----+----7----+----8----+----9----+----0----+----1----
************** Top of Data ****************************
5165550290H V N5165550290BAV N
OUTREC IFTHEN=(WHEN=(81,2,CH,EQ,C'01'),OVERLAY=(1:1,181,
182,21,203,21,224,21,
245,21,266,21,287,21,
308,21,329,21,350,21,
371,21,392,21,413,21,
434,21,455,21,476,145))
Input file:
6----+----7----+----8----+----9----+----0----+----1----+-
************** Top of Data ******************************
5165550290H V N5165550290BAV N
Output file:
6----+----7----+----8----+----9----+----0----+----1----
************** Top of Data ****************************
5165550290H V N5165550290BAV N
But i want to insert a space inbetween few fields(i mentioned as X from the below control card)
For example, In the ouptput file, i need a space in 204th position and 205th position should contains
the value from the input file(203 to 21 length)..
SORT FIELDS=COPY
OUTREC IFTHEN=(WHEN=(81,2,CH,EQ,C'01'),OVERLAY=(1:1,181,182:X,
182,21,204:X,203,21,226:X,224,21,248:X,
245,21,270:X,266,21,292:X,287,21,314:X,
308,21,336:X,329,21,358:X,350,21,380:X,
371,21,402:X,392,21,424:X,413,21,446:X,
434,21,468:X,455,21,490:X,476,145))
OUTREC IFTHEN=(WHEN=(81,2,CH,EQ,C'01'),OVERLAY=(1:1,181,182:X,
182,21,204:X,203,21,226:X,224,21,248:X,
245,21,270:X,266,21,292:X,287,21,314:X,
308,21,336:X,329,21,358:X,350,21,380:X,
371,21,402:X,392,21,424:X,413,21,446:X,
434,21,468:X,455,21,490:X,476,145))
When i try with the below control card i am getting unexpected result. I have also tried with C' ' but invain. So can any one please correct me on this.
output:
6----+----7----+----8----+----9----+----0----+----1----+-
************** Top of Data ******************************
5165550290H V N5165550290B B N
Expected output
6----+----7----+----8----+----9----+----0----+----1----+-
************** Top of Data ******************************
5165550290H V N5165550290B AV N
6----+----7----+----8----+----9----+----0----+----1----+-
************** Top of Data ******************************
5165550290H V N5165550290B B N
Expected output
6----+----7----+----8----+----9----+----0----+----1----+-
************** Top of Data ******************************
5165550290H V N5165550290B AV N
Thanks
Jegan.