Page 1 of 1

Icetool example for splitting a file into many conditionally

PostPosted: Fri Feb 20, 2015 9:09 pm
by smitamixa
I have one file. The records of that file needs to be separated into multiple files [more than 80] depending on the 1st four character of that record. Could icetool be used and what would be the syntax. Can some one give me the JCL.

Regards,
Smita Pattnaik

Re: Icetool example for splitting a file into many condition

PostPosted: Fri Feb 20, 2015 9:58 pm
by BillyBoyo
You can use an ordinary SORT COPY operation, with "more than 80" OUTFIL statements using INCLUDE= or OMIT= for record select. Have one OUTFIL with SAVE to collect any records which don't live somewhere in the selection.

Re: Icetool example for splitting a file into many condition

PostPosted: Fri Feb 20, 2015 10:07 pm
by smitamixa
Thanks Billy for the quick response. Is there any limit on number of files that can be generated using sort? How is icetool advantageous than sort?

Re: Icetool example for splitting a file into many condition

PostPosted: Fri Feb 20, 2015 10:57 pm
by BillyBoyo
There's a limit, but it is the number of DDnames, which relates to the TIOT size for your system. If it is 32K, 1,600+ shouldn't be a problem for something simple, although there are some limits about the amount of code you have.

ICETOOL does lots of useful stuff, mostly by telling DFSORT to do part of it. A lot of "complicated" things can be done in straight DFSORT. ICETOOL has a number of useful operators to do things which would be obtuse in SORT itself (RESIZE, for instance).

ICETOOL operators can also be combined in one set of control cards, so you can do multiple operations in one step to produce a combined result.

If you wanted to copy 86 files to 86 other files, that could be done in one ICETOOL step. You want to split a single file into 80+, which SORT is going to do for you without needing to wrap ICETOOL around it.

Have a look at the DFSORT Getting Started guide.

Re: Icetool example for splitting a file into many condition

PostPosted: Fri Feb 20, 2015 11:01 pm
by smitamixa
Billy,

Is there any advantage of using icetool over sort for simple splitting like this one?

Re: Icetool example for splitting a file into many condition

PostPosted: Fri Feb 20, 2015 11:15 pm
by BillyBoyo
No. You'd specify an ICETOOL COPY with a USING(xxxx) and have an xxxxCNTL DDname, and that would contain everything you had in a a SORT step, so no advantage at all. Because you're splitting the file on conditions, and ICETOOL doesn't do that (because SORT does it). ICETOOL complements SORT by enabling the combination of standard operations to produce a result in a single step, and by offering functionality which would be a real pain to do in SORT.

Plain DFSORT can do many, many things.