Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Splitting file into 2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Splitting file into 2
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: 1458
Location: Azeroth

PostPosted: Wed May 01, 2013 12:00 am    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Splitting file into 2
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

http://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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us