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

Spliting files into output


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rafael2009

New User


Joined: 21 May 2009
Posts: 18
Location: Mumbai

PostPosted: Fri May 29, 2009 3:28 pm
Reply with quote

Hi,

I want to split the below input to different output files
input:
01 WERTYERWTY
02 RETHRETHRT
02 RETHRTHRTH
03 ERHERH444
04 555555555
05 666666666
06 777777777
06 ERHWRTHERH
99 999999999

Outfile1
01 WERTYERWTY

Outfile2
02 RETHRETHRT
02 RETHRTHRTH

Outfile3
03 ERHERH444

Outfile4
04 555555555
05 666666666
06 777777777
06 ERHWRTHERH
99 999999999
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Fri May 29, 2009 3:34 pm
Reply with quote

Hi Rafael,
You can use this:
Code:

//STEP0    EXEC PGM=SYNCTOOL                                   
//IN1      DD *                                               
01 WERTYERWTY                                                 
02 RETHRETHRT                                                 
02 RETHRTHRTH                                                 
03 ERHERH444                                                   
04 555555555                                                   
05 666666666                                                   
06 777777777                                                   
06 ERHWRTHERH                                                 
99 999999999                                                   
//TOOLIN   DD *                                               
  COPY FROM(IN1) USING(CTL1)                                   
//CTL1CNTL DD *                                               
 OUTFIL FNAMES=OUTFIL1,INCLUDE=(1,2,CH,EQ,C'01')               
 OUTFIL FNAMES=OUTFIL2,INCLUDE=(1,2,CH,EQ,C'02')               
 OUTFIL FNAMES=OUTFIL3,INCLUDE=(1,2,CH,EQ,C'03')               
 OUTFIL FNAMES=OUTFIL4,SAVE                                   
//OUTFIL1  DD SYSOUT=*                                         
//OUTFIL2  DD SYSOUT=*                                         
//OUTFIL3  DD SYSOUT=*                                         
//OUTFIL4  DD SYSOUT=*                                         
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG   DD SYSOUT=*                                         


Thanks, Balu
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri May 29, 2009 3:46 pm
Reply with quote

Quote:
Please state the "rules" to get the output --
And the Sort product/version installed in your shop.
Back to top
View user's profile Send private message
rafael2009

New User


Joined: 21 May 2009
Posts: 18
Location: Mumbai

PostPosted: Fri May 29, 2009 4:06 pm
Reply with quote

Thanks everyone... it worked with SYNCTOOL ... the sort rule was that the 4th file should contain rest of recorts (apart from 01 02 03)
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri May 29, 2009 4:15 pm
Reply with quote

rafael2009,

You dont really need SYNCTOOL for this.

Code:
//STEP1  EXEC  PGM=SORT                         
//SYSOUT   DD  SYSOUT=*                         
//SORTIN   DD  DSN= Input file                   
//OUTFIL1  DD SYSOUT=*                           
//OUTFIL2  DD SYSOUT=*                           
//OUTFIL3  DD SYSOUT=*                           
//OUTFIL4  DD SYSOUT=*                           
//SYSIN    DD  *                                 
  OPTION COPY                                   
  OUTFIL FNAMES=OUTFIL1,INCLUDE=(1,2,CH,EQ,C'01')
  OUTFIL FNAMES=OUTFIL2,INCLUDE=(1,2,CH,EQ,C'02')
  OUTFIL FNAMES=OUTFIL3,INCLUDE=(1,2,CH,EQ,C'03')
  OUTFIL FNAMES=OUTFIL4,SAVE                     
/*
Back to top
View user's profile Send private message
vvmanyam

New User


Joined: 16 Apr 2008
Posts: 86
Location: Bangalore

PostPosted: Fri May 29, 2009 4:24 pm
Reply with quote

I had a recent job in my spool with Icetool step, so just modified and pasted here!!
I hope there will not be any change in processing time from Icetool to sort.. Not sure icon_smile.gif

Thanks, Balu
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri May 29, 2009 4:28 pm
Reply with quote

Quote:
I hope there will not be any change in processing time from Icetool to sort..
You can save a control card at least icon_smile.gif
Back to top
View user's profile Send private message
rafael2009

New User


Joined: 21 May 2009
Posts: 18
Location: Mumbai

PostPosted: Fri May 29, 2009 4:43 pm
Reply with quote

Thanks a lot Arun...
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri May 29, 2009 6:12 pm
Reply with quote

You're welcome. icon_smile.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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top