Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
No new posts Finding difference between two PS fil... Vignesh Sid SYNCSORT 5 Mon Oct 30, 2017 1:13 pm
No new posts NDM 300 files from mainframe to linux shreya19 All Other Mainframe Topics 2 Thu Oct 26, 2017 11:40 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us