View previous topic :: View next topic
|
Author |
Message |
monasu1998
Active User
Joined: 23 Dec 2005 Posts: 176 Location: India
|
|
|
|
Hi,
I've a file which I want to write the records with following condtion to 1 file
(01,03,CH,EQ,C'040',AND,
800,3,CH,EQ,C'GAA',AND,
820,3,CH,EQ,C'CAA')
rest of the records into the second file..
I tried
OUTPUT FILES=OUT,INCLUDE=
(01,03,CH,EQ,C'040',AND,
800,3,CH,EQ,C'GAA',AND,
820,3,CH,EQ,C'CAA')
OUTPUT FILES=01,INCLUDE=
(01,03,CH,NE,C'040',AND,
800,3,CH,NE,C'GAA',AND,
820,3,CH,NE,C'CAA').
Ideally the total records in sortout and file 1 should be counting to total of inpt records. But I see the count is not matching.
Could someone guide me or suggest where to look?
Thanks |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hello,
The multiple AND conditions would most likely be the issue.
For input records like the one below,
Both the INCLUDE conditions would not have been met and the record is missed out
I think this
Code: |
OUTPUT FILES=01,INCLUDE=
(01,03,CH,NE,C'040',AND,
800,3,CH,NE,C'GAA',AND,
820,3,CH,NE,C'CAA') |
has to be
Code: |
OUTPUT FILES=01,INCLUDE=
(01,03,CH,NE,C'040',OR,
800,3,CH,NE,C'GAA',OR,
820,3,CH,NE,C'CAA') |
|
|
Back to top |
|
|
monasu1998
Active User
Joined: 23 Dec 2005 Posts: 176 Location: India
|
|
|
|
Hello Vasanth,
Thanks for your reply. What needs to be done to write the records like you have highlighted into the2nd file..
Thanks, |
|
Back to top |
|
|
monasu1998
Active User
Joined: 23 Dec 2005 Posts: 176 Location: India
|
|
|
|
Superb.... thanks a lot Vasanth........ |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
monasu1998,
Use the parm SAVE to route the records that do not match the criteria to a different OUTFIL
ex:
Code: |
OUTFIL FILES=OUT,
INCLUDE=(001,3,CH,EQ,C'040',AND,
800,3,CH,EQ,C'GAA',AND,
820,3,CH,EQ,C'CAA')
OUTFIL FILES=01,SAVE
|
Any records that do NOT match the criteria on SORTOUT file will routed to SORTOF01.
Check this link which explains in detail about SAVE parm
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1ca60/3.15 |
|
Back to top |
|
|
|
|