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
 

 

How to split one file into 5 files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vardhan0007

New User


Joined: 05 Jun 2006
Posts: 51
Location: Bangalore,India

PostPosted: Wed Apr 11, 2007 9:15 pm    Post subject: How to split one file into 5 files
Reply with quote

Hi,

I have one requirement where one file has to be splitted into 5 files.I dont have any conditions just need to split it .

Thanks,
Harsha.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Apr 11, 2007 10:03 pm    Post subject:
Reply with quote

Harsha,

See if the "Split a file to n output files dynamically" Smart DFSORT Trick will do what you need:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

If not, then provide more details of what exactly you want to do.
Back to top
View user's profile Send private message
jagankallis
Warnings : 1

New User


Joined: 28 Jun 2006
Posts: 29
Location: DUISBURG

PostPosted: Thu Apr 12, 2007 4:01 pm    Post subject: Re: How to split one file into 5 files
Reply with quote

Harsha,

Code:
//S010    EXEC PGM=ICETOOL
//TOOLMSG  DD  SYSOUT=*                                         
//DFSMSG   DD  SYSOUT=*                                         
//CNT1CNTL DD  *                                                 
  OUTFIL FNAMES=(OUT1,OUT2,OUT3,OUT4,OUT5),                           
      SPLIT                                                     
/*                                                               
//INDD    DD DISP=SHR,DSN='INPUT FILE'   
//TOOLIN  DD *                                                   
  COPY FROM(INDD) USING(CNT1)                                   
/*                                                               
//OUT1   DD  DSN='OUTPUT FILE1'
//OUT2   DD  DSN='OUTPUT FILE2'
//OUT3   DD  DSN='OUTPUT FILE3'
//OUT4   DD  DSN='OUTPUT FILE4'
//OUT5   DD  DSN='OUTPUT FILE5'


Hope this helps !
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Thu Apr 12, 2007 4:46 pm    Post subject: Re: How to split one file into 5 files
Reply with quote

Just curious ....

let's say You have a file with 10 000 000 ( ten millions ) records

then it' s the same thing to split it in :
5 files containing 2 000 000 ( two millions ) records each,
4 files containing 1 ( one ) record each and one slightly bigger containing
9 999 996 ( nine millions nine hundred ninety nine thousands nine hundred ninety six ) records ....

right ?!?

regards

P.S

wondering about the logic of the question ...
and the bandwidth waste
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Apr 12, 2007 8:31 pm    Post subject:
Reply with quote

Harsha,

Note that the DFSORT Trick I pointed to will create output files with contiguous input records, whereas the method Jagannathan shows will create output files with non-contiguous input records.

For more methods to split a file, see the "Five ways to split a data set" Smart DFSORT Trick at:

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
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