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

How to split one file into 5 files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

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

Harsha,

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

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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Apr 12, 2007 4:46 pm
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 Developer


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

PostPosted: Thu Apr 12, 2007 8:31 pm
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:

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 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 0
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