I am trying to extract a portion of a record using sort. The record layout is as follows: sd0904050698001c1c,,,,,
I need to copy the data in postion 3-12 to the outrec, change the data in position 13 which is comp-3 and position 15 which is comp-3 to 001 and 1 resepectively to the outrec.
I can manage 3-12 fine, but cannot find the correct syntax for the remaining positions.
Any assistance is appreciated
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
the data in position 13 which is comp-3 and position 15 which is comp-3 to 001 and 1 resepectively
Not sure what you mean. It looks like 13-14 has X'001C' (2 bytes) and 15 has X'1C' (1 byte), but you say you want to change them to '001' (3 bytes) and '1' (1 byte), so you're adding a byte. If you want '001' and '1' regardless of what's in 13-14 and 15, you could use C'001',C'1'. If you want to convert the PD value in those fields to ZD values, you could use 13,2,PD,TO=ZD,LENGTH=3,15,1,PD,TO=ZD,LENGTH=1 or 13,2,PD,EDIT=(TTT),15,1,PD,EDIT=(T).
If none of that helps, you need to explain more clearly what you want to do.
Seems it lost the field that is in postion 15.
New Outrec:
0820385479001
0860498952002
0820469274002
many more records follow,,,
Inrec
SD0820385479...
ECFFFFFFFFFF011
2408203854790CC
--------------
SD0860498952...
ECFFFFFFFFFF022
2408604989520CC
--------------
SD0820469274...
ECFFFFFFFFFF022
2408204692740CC