View previous topic :: View next topic
|
Author |
Message |
tomehta
New User
Joined: 18 Aug 2008 Posts: 98 Location: India
|
|
|
|
Hi
I want to split a bigger file in 2 GB files . Say if the file size is 16GB, I want to split it in 8 files. The size of the bigger file will vary. it can be 3 GB or it may extend to 30GB as well. How I can achieve this.
Regards |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
tomehta,
What is the RECFM and LRECL of the input file?
Can you hardcode the maximum number of output DD statements, or do you need to generate the correct number of DD statements dynamically?
How many records do you want in each output file? |
|
Back to top |
|
|
tomehta
New User
Joined: 18 Aug 2008 Posts: 98 Location: India
|
|
|
|
Hi Frank,
Q:
Quote: |
What is the RECFM and LRECL of the input file? |
Ans :
Code: |
LRECL=32000,RECFM=VB |
Q
Quote: |
: Can you hardcode the maximum number of output DD statements, or do you need to generate the correct number of DD statements dynamically? |
Ans : I will prefer it to be dynamic however hardcoded ia also ok. Kinda nice to have
Q :
Quote: |
How many records do you want in each output file? |
Ans : No such criteria, only constraint is of 2 GB. As I have to transfer these file using a in house bulit protocol.
Hope I am able to answer your questions.
Thanks |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Since your input file is VB, I assume that means different records can have different lengths. So it sounds like you want to write a set of records whose lengths adds up to 2GB to an output file, then write the next set of records whose lengths adds up to 2GB to another output file, etc.
DFSORT does NOT have any built-in functions to do this kind of thing.
I'd suggest you write a program or exit with the appropriate logic. |
|
Back to top |
|
|
tomehta
New User
Joined: 18 Aug 2008 Posts: 98 Location: India
|
|
|
|
Hi Frank,
Say I keep it FB , in that case can we do it thru DFSORT ?
Appreciate your help.
thanks |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Say I keep it FB , in that case can we do it thru DFSORT ? |
Yes, in that case you can determine how many records you need for the 2GB filesize as n=2GB/LRECL. Then you can use DFSORT's SPLIT1R=n option on OUTFIL to split the file into multiple output data sets each with that number of records, e.g.
Code: |
OUTFIL SPLIT1R=64000,
FNAMES=(OUT01,OUT02,OUT03,...)
|
|
|
Back to top |
|
|
Deepa.m
New User
Joined: 28 Apr 2005 Posts: 99
|
|
|
|
All,
Mine is similar requirement and at the end i want to create a control file with the filename and record count
aaa.bbb.file1 00064000
aaa.bbb.file2 00064000
aaa.bbb.file3 00000340
aaa.bbb.file4 00000000
aaa.bbb.file5 00000000
Say i create 12 static files always. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
Deepa.m wrote: |
All,
Mine is similar requirement and at the end i want to create a control file with the filename and record count |
Deepa ,
you canNOT have a DSN qualifier with numeric. ie.
aaa.bbb.file1.00064000 is not valid. You can have aaa.bbb.file1 C064000
Remember that the max length of a DSN qualifier is 8 bytes, and the first should be alphabetic which will leave you with 7 bytes for getting the count.
So suggest that you look into alternative ways of specifying the counts. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I believe the file names and counts are to be placed in one output file as the content of that file. . .
Possibly, i misunderstand. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
And the next request will be how to use that file for something. |
|
Back to top |
|
|
|