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

Splitting files - Condition to split on unmatched / OTHER


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top