Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
somapradeep1,
This is a bit tricky because PD values have a sign in the last nibble. So your PD value of 123456789 is X'123456789C' in hex (5 bytes) and you want to split it into two ZD values of 12345 (5 bytes) and 06789 (5 bytes). Let's assume that your original PD value is in positions 1-5 and you want the first ZD value in positions 11-15 and the second ZD value in positions 21-25. You can use a DFSORT job like the following:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB)
//SORTOUT DD DSN=... output file (FB)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
OVERLAY=(11:1,3,PD,TO=ZD,LENGTH=5,
21:3,3,PD0,TO=ZD,LENGTH=5)),
IFTHEN=(WHEN=(11,5,ZD,LT,0),
OVERLAY=(11:11,5,ZD,MUL,-1,TO=ZD,LENGTH=5))
|
If that's not what you want, then you need to do a better job of explaining exactly what it is you do want. |
|