View previous topic :: View next topic
|
Author |
Message |
vardhan0007
New User
Joined: 05 Jun 2006 Posts: 51 Location: Bangalore,India
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
jagankallis Warnings : 1 New User
Joined: 28 Jun 2006 Posts: 29 Location: DUISBURG
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|