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 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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts How to insert a value on specific pos... Poha Eater DFSORT/ICETOOL 9 Sun Oct 01, 2017 3:04 am
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm

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