Posted: Tue Jun 17, 2014 9:02 pm Post subject: Split Input Based Upon Last Digit of Integer Field
Looking for some assistance. Im attempting to split an input file into 5 outputs based upon the last digit of an integer field (5,4). The only way I have been able to accomplish this is convert the integer/binary field to ZD and then split based upon ZD as shown below. The conversion to ZD seems to add some overhead in cpu/time and Im trying to find another way to avoid using it.
Correct, the INCLUDE and INREC statements were existing. My change was to change from a single output and split to 5 records based upon the last digit in the 5,4 field which is leading field in sort card.
So here is the original I started with. It still seems very inefficient to me. Can you please elaborate what you mean by not using FIELDS? What alternative is there for the SORT statement or you mean I should use multiple sort steps to accomplish this? I changed the INREC FIELDS to INREC BUILD statement and didnt see much change in my test job.
As I tried to indicate, FIELDS means many things, depending on where it is used. This is for historical reasons.
INREC FIELDS, OUTREC FIELDS and OUTFIL OUTREC all exist, and will be supported forever. But INREC BUILD, OUTREC BUILD and OUTFIL BUILD are better to use than FIELDS/OUTREC, because BUILD only means BUILD, and does the same thing at each point of the processing.
Using BUILD instead of FIELDS/OUTREC will change nothing at all, except make it easier to understand.
Whoever wrote the INREC origianlly did not know what they were doing, because they made it harder to maintain through the inclusion of unnecessary column numbers.
Having INCLUDE COND rather than the INCLUDE= on OUTFIL is more efficient, because not all records on the file will be SORTed before they are ignored. If worried about performance, rearrange the conditions in the COND= so that the most likely to be true is first.
Then you need to look at your documentation to see how to test bits in INCLUDE/OMIT COND and INCLUDE/OMIT=. This will save you from having the conversion to ZD. I don't think it'll make a stunning difference, but it'll save some.
The time is taken up by the SORT. If you need to SORT, not much you can do about that (if the order of duplicate keys is not important, ensure you have NOEQUALS).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum