OPTION COPY
INREC BUILD=(1,38,X'00',40:39,49,X'00',51:50,117)
ICE201I 0 RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE126A 0 INCONSISTENT *INREC IFTHEN 0 REFORMATTING FIELD FOUND
ICE751I 0 C5-K05352 C6-Q95214 C7-K90000 C8-K05352 E9-K06751 E7-K90000
ICE052I 3 END OF DFSORT
I'm trying to insert HEX 00 in between filelds
The input record is FB, lrecl =165
The output will be FB 168 because I'm insert two one-btye fields
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Code:
INREC BUILD=(1,38,X'00',40:39,49,X'00',51:50,117)
You received the errror message because you have overlapping fields.
40:39,49,X'00'
builds the output record up to position 89. But then you have 51: which says to start the next byte in position 51 which is before 89. You can't overlap fields that way.
I think maybe you are using the ending position (49) instead of the length.
If you tell me where you want to insert those two X'00' characters, I can tell you how to set up the INREC statement. It appears you want the first X'00' after input positions 1 to 38. But where do you want the second X'00' - after input positions 39 to what?
Quote:
The input record is FB, lrecl =165
The output will be FB 168 because I'm insert two one-btye fields
That would be 165+2 = 167, not 168.
Also, you can remove the //SORTWK01 DD statement - it isn't used for COPY. You can also remove the //SYSPRINT DD statement as DFSORT doesn't use it.