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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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