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 files - Condition to split on unmatched / OTHER

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
xknight

Active User


Joined: 22 Jan 2008
Posts: 117
Location: Liberty city

PostPosted: Fri Feb 18, 2011 5:20 pm    Post subject: Splitting files - Condition to split on unmatched / OTHER
Reply with quote

My requirement is to split the source file to three files.

Code:
INPUT FILE:

123456789
ATEST123
BTEST345
CTEST567


I am splitting the file based on the condition below,

Code:
//OUT1 DD DSN=OUTPUT DATASET


Code:
//SYSIN DD *
OPTION COPY
OUTFIL INCLUDE=(1,1,CH,EQ,'A',AND,
                6,3,CH,EQ,'123,OR,
                1,1,CH,EQ,'B',AND,
                6,3,CH,EQ,'345),FNAMES=OUT


I Want to retrieve the record "CTEST567" which may not be known to me
it is same as "WHEN OTHER" condition in evaluate. Is it possible to retrieve the unmatched records while splitting the files.

Kindly advise on this.
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Fri Feb 18, 2011 10:58 pm    Post subject: Reply to: Splitting files - Condition to split on unmatched
Reply with quote

xavierrajnaveen,


Use the Parm 'SAVE' which specifies that OUTFIL input records not included by STARTREC, ENDREC, SAMPLE, INCLUDE or OMIT for any other OUTFIL group are to be included in the data sets for this OUTFIL group.

Code:

//STEP0250 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *                                     
ATEST123                                           
BTEST345                                           
CTEST567                                           
//OUT1     DD SYSOUT=*                             
//OUT2     DD SYSOUT=*                             
//SYSIN    DD *                                     
  SORT FIELDS=COPY                                 
  OUTFIL FNAMES=OUT1,                               
  INCLUDE=((1,1,CH,EQ,C'A',AND,6,3,CH,EQ,C'123'),OR,
           (1,1,CH,EQ,C'B',AND,6,3,CH,EQ,C'345'))   
  OUTFIL FNAMES=OUT2,SAVE                           
//*


Out1 will have the first 2 records and OUT2 will have the last record.
Back to top
View user's profile Send private message
xknight

Active User


Joined: 22 Jan 2008
Posts: 117
Location: Liberty city

PostPosted: Fri Feb 18, 2011 11:25 pm    Post subject: Reply to: Splitting files - Condition to split on unmatched
Reply with quote

Skolusu,

That is brilliant and very much useful.

Thank you very much for your advise and time!!!

icon_biggrin.gif icon_biggrin.gif
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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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