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 of one file into five files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Splitting of one file into five files
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    Post subject: Reply to: Splitting of one file into five files
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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