I was trying to create two files, one with the regs with number in position 84, greater or equal than the number in position 208.
And other file with number in pos 84 less than number in pos 208.
That didn't worked, and everytime I was getting all regs in file 2....
I was misled by the 208,15 and 209,15 in your first post and was thinking on the lines why the first one (208,15) didn't work and the second one (209,15) worked.
Only now i realised that you were referring to the OUTREC FIELDS. It didn't work in mine too and the error message was duplicate outrec statements. This may have something to do with the version of DFSORT but i will let the experts to comment on that.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Gabriel,
Code:
SORT FIELDS=COPY
OUTFIL FNAMES=FILE1, <--- first OUTFIL statement
INCLUDE=(84,15,ZD,GE,208,15,ZD) <--- first OUTFIL statement
OUTREC FIELDS=(C'T',1,239) <--- first OUTREC statement
OUTFIL FNAMES=FILE2, <--- second OUTFIL statement
INCLUDE=(84,15,ZD,LT,208,15,ZD) <--- second OUTFIL statement
OUTREC FIELDS=(C'T',1,239) <--- dup OUTREC statement
The problem with the statements above is that you are using the wrong syntax for what you want to do. You are mixing up the OUTREC statement with the OUTREC operand of the OUTFIL statement. This is the reason we recommend that you use the BUILD operand rather than the OUTREC operand. The correct syntax for what you want to do would be:
Code:
SORT FIELDS=COPY
OUTFIL FNAMES=FILE1, <--- first OUTFIL statement
INCLUDE=(84,15,ZD,GE,208,15,ZD), <--- first OUTFIL statement
BUILD=(C'T',1,239) <--- first OUTFIL statement
OUTFIL FNAMES=FILE2, <--- second OUTFIL statement
INCLUDE=(84,15,ZD,LT,208,15,ZD), <--- second OUTFIL statement
BUILD=(C'T',1,239) <--- second OUTFIL statement
Your control statements with INREC worked because they have the correct syntax:
Code:
SORT FIELDS=COPY
INREC FIELDS(C'T',1,239) <--- INREC statement
OUTFIL FNAMES=FILE1, <--- first OUTFIL statement
INCLUDE=(85,15,ZD,GE,209,15,ZD) <--- first OUTFIL statement
OUTFIL FNAMES=FILE2, <--- second OUTFIL statement
INCLUDE=(85,15,ZD,LT,209,15,ZD) <--- second OUTFIL statement