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 based on KEY and Generating multiple files

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

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Thu May 06, 2010 5:41 pm    Post subject: Splitting file based on KEY and Generating multiple files
Reply with quote

Can we Splitt the file based on KEY and Generate multiple files?

Inputfile : Fileformat VB and LRECL is 3000, Key position is 22 (18 + 4 RDW), and key length is 10 bytes


Code:
XXXXXXXXXXXXXXXXX1111111111ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX1111111111ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX1111111111ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX1111111111ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX2222222222ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX2222222222ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX2222222222ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX2222222222ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX3333333333ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX3333333333ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX3333333333ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX4444444444ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX4444444444ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX4444444444ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX4444444444ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX5555555555ZZZZZZZZZZZZZZZZZZZZZ


i need to have this file to be split into couple of files based on the key, if key count matches to 2, those records needs to be written to one file

FILE1
Code:
XXXXXXXXXXXXXXXXX1111111111ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX1111111111ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX1111111111ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX1111111111ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX2222222222ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX2222222222ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX2222222222ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX2222222222ZZZZZZZZZZZZZZZZZZZZZ


FILE2:

Code:
XXXXXXXXXXXXXXXXX3333333333ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX3333333333ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX3333333333ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX4444444444ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX4444444444ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX4444444444ZZZZZZZZZZZZZZZZZZZZZ
XXXXXXXXXXXXXXXXX4444444444ZZZZZZZZZZZZZZZZZZZZZ


FILE3:
Code:
XXXXXXXXXXXXXXXXX5555555555ZZZZZZZZZZZZZZZZZZZZZ
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu May 06, 2010 7:03 pm    Post subject:
Reply with quote

How many maximum number of different keys can be there?
Back to top
View user's profile Send private message
Mazahar

New User


Joined: 11 Dec 2007
Posts: 82
Location: hyderabad

PostPosted: Thu May 06, 2010 7:06 pm    Post subject:
Reply with quote

Quote:
How many maximum number of different keys can be there?
_________________
-Sambhaji


five output files are maximum, which mean 10 keys are maximum
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu May 06, 2010 9:25 pm    Post subject: Reply to: Splitting file based on KEY and Generating multipl
Reply with quote

mazahar,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD DSN=your input VB file,DISP=SHR
//OUT1     DD SYSOUT=*                                                 
//OUT2     DD SYSOUT=*                                                 
//OUT3     DD SYSOUT=*                                                 
//OUT4     DD SYSOUT=*                                                 
//OUT5     DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
 SORT FIELDS=COPY                                                     
 INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,SEQNUM,8,ZD,RESTART=(22,10),2X,5)),
 IFTHEN=(WHEN=GROUP,BEGIN=(5,8,ZD,EQ,1),PUSH=(13:ID=2))   
           
 OUTFIL FNAMES=OUT1,BUILD=(1,4,15),INCLUDE=(13,2,ZD,LE,2)             
 OUTFIL FNAMES=OUT2,BUILD=(1,4,15),                                   
 INCLUDE=(13,2,ZD,GT,2,AND,13,2,ZD,LE,4)                               
 OUTFIL FNAMES=OUT3,BUILD=(1,4,15),                                   
 INCLUDE=(13,2,ZD,GT,4,AND,13,2,ZD,LE,6)                               
 OUTFIL FNAMES=OUT4,BUILD=(1,4,15),                                   
 INCLUDE=(13,2,ZD,GT,6,AND,13,2,ZD,LE,8)                               
 OUTFIL FNAMES=OUT5,BUILD=(1,4,15),SAVE                               
//*
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 Data replication from multiple Db2 ta... kishpra DB2 1 Mon Mar 27, 2017 9:58 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 3 Mon Mar 27, 2017 3:59 pm
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts Unable to catalog a gdg dataset resid... Shovan JCL & VSAM 7 Fri Mar 24, 2017 2:24 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am


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