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 Splitting of single report to seperat... abdulrafi TSO/ISPF 4 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 splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm


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