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: 1475
Location: Chennai

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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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