IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Splitting file into 2


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
monasu1998

Active User


Joined: 23 Dec 2005
Posts: 176
Location: India

PostPosted: Tue Apr 30, 2013 11:52 pm
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1689
Location: Tiruppur, India

PostPosted: Wed May 01, 2013 12:00 am
Reply with quote

Hello,
The multiple AND conditions would most likely be the issue.

For input records like the one below,
Code:
040          GAA          XXX

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
View user's profile Send private message
monasu1998

Active User


Joined: 23 Dec 2005
Posts: 176
Location: India

PostPosted: Wed May 01, 2013 12:04 am
Reply with quote

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
View user's profile Send private message
monasu1998

Active User


Joined: 23 Dec 2005
Posts: 176
Location: India

PostPosted: Wed May 01, 2013 12:14 am
Reply with quote

Superb.... thanks a lot Vasanth........
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed May 01, 2013 12:48 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Get two files from one file with diff... DFSORT/ICETOOL 10
No new posts View GDG data which is copied from a ... JCL & VSAM 2
No new posts How to read unpacked field created in... DFSORT/ICETOOL 11
No new posts How to add 2 digits to COMP-3 file? DFSORT/ICETOOL 11
No new posts VSAM file Storage Calculation JCL & VSAM 3
Search our Forums:

Back to Top