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

Splitting of one file into five files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Raghavendra reddy P

New User


Joined: 27 Mar 2007
Posts: 1
Location: mysore

PostPosted: Thu Dec 13, 2007 5:35 pm
Reply with quote

Hi all,
I have one requirement in which I want to split one file into 5 files.
input file format looks like this...
hdr
123
456
312
hdr
145
456
hdr
379
009
146
211
hdr
008
678
hdr
157

Now I want split this into five files as
hdr
123
456
312
as one file and
hdr
145
456
so as five files
please help me on solving this

Thanks,
Raghavendra

* I validated with O/P that DFSORT is the product used. Kevin *
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Dec 13, 2007 10:27 pm
Reply with quote

Raghavendra reddy P,

The following DFSORT JCl will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT         
//SYSOUT   DD SYSOUT=*           
//SORTIN   DD *                   
HDR                               
123                               
456                               
312                               
HDR                               
145                               
456                               
HDR                               
379                               
009                               
146                               
211                               
HDR                               
008                               
678                               
HDR                               
157                               
//FILE1    DD SYSOUT=*           
//FILE2    DD SYSOUT=*           
//FILE3    DD SYSOUT=*           
//FILE4    DD SYSOUT=*           
//FILE5    DD SYSOUT=*           
//SYSIN    DD *                   
  SORT FIELDS=COPY                                           
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),         
        IFTHEN=(WHEN=(1,3,CH,EQ,C'HDR'),                     
                OVERLAY=(81:SEQNUM,8,ZD)),                   
        IFTHEN=(WHEN=NONE,                                   
                OVERLAY=(89:SEQNUM,8,ZD,                     
                         81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
                                                             
  OUTFIL FNAMES=FILE1,INCLUDE=(81,8,ZD,EQ,1),                 
    BUILD=(01,80)                                               
  OUTFIL FNAMES=FILE2,INCLUDE=(81,8,ZD,EQ,2),                 
    BUILD=(01,80)                                               
  OUTFIL FNAMES=FILE3,INCLUDE=(81,8,ZD,EQ,3),                 
    BUILD=(01,80)                                               
  OUTFIL FNAMES=FILE4,INCLUDE=(81,8,ZD,EQ,4),                 
    BUILD=(01,80)                                               
  OUTFIL FNAMES=FILE5,INCLUDE=(81,8,ZD,EQ,5),                 
    BUILD=(01,80)                                               
/*                                                           


Hope this helps..
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 FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top