|
|
| Author |
Message |
gabriel.ryoga
New User
Joined: 07 Jun 2007 Posts: 27 Location: Spain
|
|
|
|
I've this sysin:
| Code: |
SORT FIELDS=COPY
OUTFIL FNAMES=FILE1,
INCLUDE=(84,15,ZD,GE,208,15,ZD)
OUTREC FIELDS=(C'T',1,239)
OUTFIL FNAMES=FILE2,
INCLUDE=(84,15,ZD,LT,208,15,ZD)
OUTREC FIELDS=(C'T',1,239)
|
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....
So I changed to this one:
| Code: |
SORT FIELDS=COPY
INREC FIELDS(C'T',1,239)
OUTFIL FNAMES=FILE1,
INCLUDE=(85,15,ZD,GE,209,15,ZD)
OUTFIL FNAMES=FILE2,
INCLUDE=(85,15,ZD,LT,209,15,ZD)
|
This Sysin worked fine for my needs, but I still don't understand why the first one didn't worked....
can somebody explain it?? |
|
| Back to top |
|
 |
References
|
|
 |
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 119 Location: Chennai
|
|
|
|
| Can you post samples of the data in the input file please? |
|
| Back to top |
|
 |
gabriel.ryoga
New User
Joined: 07 Jun 2007 Posts: 27 Location: Spain
|
|
|
|
INPUT1:
| Code: |
00000000000001C00000000000002C
00000000000003C00000000000001C
|
FILE1:
| Code: |
T00000000000003C00000000000001C
|
FILE2:
| Code: |
T00000000000001C00000000000002C
|
SYSIN1:
| Code: |
SORT FIELDS=COPY
OUTFIL FNAMES=FILE1,
INCLUDE=(1,15,ZD,GE,16,15,ZD)
OUTREC FIELDS=(C'T',1,30)
OUTFIL FNAMES=FILE2,
INCLUDE=(1,15,ZD,LT,16,15,ZD)
OUTREC FIELDS=(C'T',1,30)
|
SYSIN2:
| Code: |
SORT FIELDS=COPY
INREC FIELDS(C'T',1,30)
OUTFIL FNAMES=FILE1,
INCLUDE=(1,15,ZD,GE,16,15,ZD)
OUTFIL FNAMES=FILE2,
INCLUDE=(1,15,ZD,LT,16,15,ZD)
|
I would like to know why is working SYSIN2 and not SYSIN1.
Thanks. |
|
| Back to top |
|
 |
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 1218 Location: At my desk
|
|
|
|
| gabriel.ryoga wrote: |
| I would like to know why is working SYSIN2 and not SYSIN1. |
Are you syre that you don't have SYSIN1 and SYSIN2 reversed?
What I see is
SYSIN1:
| Code: |
00000000000001C GE 00000000000002C FALSE
00000000000003C GE 00000000000001C TRUE
123456789012345 123456789012345 |
SYSIN2:
| Code: |
T00000000000001 GE C00000000000002 TRUE
T00000000000003 GE C00000000000001 TRUE
123456789012345 123456789012345 |
|
|
| Back to top |
|
 |
Manuneedhi K
Active User
Joined: 07 May 2008 Posts: 119 Location: Chennai
|
|
|
|
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. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4675 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
|
|
|
| Back to top |
|
 |
|
|
|