|
View previous topic :: View next topic
|
| Author |
Message |
suvarna
New User
Joined: 24 Aug 2005 Posts: 13
|
|
|
|
Hi Guys,
Thanks to all of u for ur help.
I am solving that problem in a different way combining JCL & REXX.
I am facing a new problem now. I am trying to sort a file into four different output files using OUTFIL. But i dont want the entire record. So I used INCLUDE COND to achieve that. Again i want to truncate some parts from that record. For this when i use OUTREC the job is abending that the syntax is not correct.
When this syntax is used the output is
CTR301I MOB.#CO.R01.RT01.I402P01.INSURANC.G0021V00 +001 CB
in one line
//SYSIN DD *
SORT FIELDS=(14,42,CH,A)
OUTFIL FILES=1,
INCLUDE=(23,2,CH,EQ,C'01',AND,39,8,CH,EQ,C'INSURANC')
But when i use the following syntax it is abending.
//SYSIN DD *
SORT FIELDS=(14,42,CH,A)
OUTFIL FILES=1,
INCLUDE=(23,2,CH,EQ,C'01',AND,39,8,CH,EQ,C'INSURANC')
OUTREC FIELDS=(1:14,42)
Can u help me to solve it ? |
|
| Back to top |
|
 |
radhakrishnan82
Active User

Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
Using ICETOOL,its working.
| Code: |
//CTL1CNTL DD * *** CONSTANT CONTROL CARDS ***
SORT FIELDS=(1,1,CH,A)
OUTFIL FNAMES=OUT1,
INCLUDE=(1,1,CH,EQ,C'2')
OUTREC FIELDS=(1:1,6)
OUTFIL FNAMES=OUT2,
INCLUDE=(1,1,CH,EQ,C'1')
OUTREC FIELDS=(2:1,6) |
the output is as expected. |
|
| Back to top |
|
 |
radhakrishnan82
Active User

Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
suvarna,
try this
| Code: |
//SYSIN DD *
SORT FIELDS=(14,42,CH,A)
OUTFIL FNAMES=1, replace FILES with FNAMES
INCLUDE=(23,2,CH,EQ,C'01',AND,39,8,CH,EQ,C'INSURANC')
OUTREC FIELDS=(1:14,42) |
|
|
| Back to top |
|
 |
suvarna
New User
Joined: 24 Aug 2005 Posts: 13
|
|
|
|
Hi Guys
Thanks to u all for the help :-)
It is working now. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The problem here is that you don't understand the "order" of processing of the control statements.
You used:
| Code: |
SORT FIELDS=(14,42,CH,A)
OUTFIL FILES=1,
INCLUDE=(23,2,CH,EQ,C'01',AND,39,8,CH,EQ,C'INSURANC')
OUTREC FIELDS=(1:14,42)
|
Regardless of the order in which you code the statements, they are processed in the following order: SORT statement, OUTREC statement, OUTFIL statements. The OUTREC statement reformats the sorted records to 42 bytes. The OUTFIL INCLUDE operates against the reformatted record, but tries to access 39,8 which is beyond the end of the 42-byte reformatted record.
What you probably want is to use the OUTREC parameter of OUTFIL rather than the OUTREC statement, e.g.
| Code: |
SORT FIELDS=(14,42,CH,A)
OUTFIL FILES=1,
INCLUDE=(23,2,CH,EQ,C'01',AND,39,8,CH,EQ,C'INSURANC'),
OUTREC=(1:14,42)
|
The order of processing in this case is: SORT statement, OUTFIL INCLUDE, OUTFIL OUTREC. So the OUTFIL INCLUDE operates against the sorted input records, and the OUTFIL OUTREC operates against the included records.
| Quote: |
Using ICETOOL,its working.
Code:
//CTL1CNTL DD * *** CONSTANT CONTROL CARDS ***
SORT FIELDS=(1,1,CH,A)
OUTFIL FNAMES=OUT1,
INCLUDE=(1,1,CH,EQ,C'2')
OUTREC FIELDS=(1:1,6)
OUTFIL FNAMES=OUT2,
INCLUDE=(1,1,CH,EQ,C'1')
OUTREC FIELDS=(2:1,6)
|
Well in this case the first OUTREC statement reformats the records to 6 bytes and the OUTFIL INCLUDEs operate against those 6 bytes. Since the INCLUDEs have 1,1, it doesn't matter if they operate against the input records or the reformatted records - position 1 has the same value eiter way. The second OUTREC statement is ignored as a duplicate. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|