Page 1 of 1

Split File Dynamically.

PostPosted: Thu Jul 03, 2014 6:56 pm
by Vineet
Hi All,

I have a requirement, where I need to split a big file into multiple files. File size is dynamic in nature i.e. Daily file size may vary. For Example On Monday By Running my process I generate a File having size = 5GB, On Tuesday when Running the process generate file having size = 20MB, On Wednesday File size is 8.5 GB. Below is the The only Infoamtion what I am having:

(1) LRECL of the O/P file which is = 100 & RECFM = FB.
(2) 1 GB of Data need to be Copy to each file.

On Monday When I Run Split Process it should create 5 Files, where each file having Data of 1GB. -----> Actual File size is 5GB
On Tuesday when I Run Split Process it should create 1 Files. ----> Actual file Size is 20 MB
On Wednesday When I Run Split Process it should create 9 Files, where 8 files having Data of 1GB * 8 & 1 File having Data of 500 MB. ---> Actual File Size is 8.5 GB.

How I can do this using SORT. If there is a JCL please share.

Thanks
Kind Rgd'sVineet

Re: Split File Dynamically.

PostPosted: Thu Jul 03, 2014 10:29 pm
by BillyBoyo
You'll need N named OUTFILs, where N is a reasonable maximum, plus one extra which uses SAVE, as a "bucket" in case the unexpected happens.

You'll need a DDNAME for each in the JCL. You'll need to clear up the empty files afterwards.

Re: Split File Dynamically.

PostPosted: Fri Jul 04, 2014 12:40 am
by Vineet
Thanks Billy. can you provide sample JCL for same.

Rgd's