p-1 position may overlay the data in that position.
If it is a problem then you can use INREC BUILD=....
If need any help, provide the LRECL, position of the date field
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
Prem,
I tried with a SORT card similar to your's and the output was not as expected. Actually quotes is not behaving in the way it should . Did you try testing the code? I don't think that would work. Please correct me if am wrong.
- CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 09:19 ON TUE OCT
SORT FIELDS=COPY
INREC OVERLAY=(0:C'''',1:1,5,PD,EDIT=(TTTT-TT-TT),C'''')
£
REFORMATTING FIELD ERROR
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Aaru,
You need to code two apostrophes to display one apostrophe, e.g. C'''' to get '.
Code:
INREC OVERLAY=(1:C''',2:1,4,5:C''')
This is a single string (C'string'). Within the string, you have an apostrophe (''), then the hardcoded value (,2:1,4,5:C) and then another apostrophe (''), so you get:
Code:
',2:1,4,5:C'
Code:
INREC OVERLAY=(1:C'''',2:1,4,5:C'''')
This result is correct:
Code:
''BC'
because of the way OVERLAY works.
You start with
ABCD
1:C'''' overlays an apostrophe in position 1 so you have
'BCD
2:1,4 overlays positions 1-4 ('BCD) in positions 2-5 so you get
''BCD
5:C'''' overlays an apostrophe in position 5 so you get
''BC'
If you used BUILD instead of OVERLAY and used the correct columns (6: instead of 5:), you'd get the correct result: