But few output files contains the same records as the record satisfied both condition. Can you please help me so that the same record will not present in more than one output file
Joined: 08 May 2006 Posts: 1193 Location: Dublin, Ireland
If you know how many OUTFIL statements you will have, and assuming that all records will be output to one or other of the output files, you could use INREC IFTHEN BUILD processing to apply a suitable identifier to the records as selected (e.g. 01 - 99).
Then, in your OUTFIL processing, select records to be written to the output files based on that identifier.
For the first SORT condition if the first two records are sorted then the remaining records(here in this case from 3rd record to 7th record)should only be the input for the second condition and so on
Hope you understand my requriment. Here is my complete SORT condition
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Since I'd already Code'd your second, I choped out your re-coding.
You are excluding fields with OUTREC, but have you looked at your record-lengths?
You have to make your conditions mutually exclusive. I don't think anyone is going to do it for you, and they are unlikely to be able to do it how you actually want it to be, as only you know that.
If you can't narrow it down further, look at Garry's suggestion.
Once an IFTHEN has a "hit" on a record, IFTHEN processing stops. If you do all your conditions in IFTHEN, then you will get the effect of "it's already been selected" automatically. If you do this, document it.
Inside the IFTHENs you set a value to be selected for each OUTFIL (like 01, 02, etc to 22 or whatever). You have to remember to "chop off" the value afterwards, with BUILD for instance.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Krupagk,
Looking at your control cards for the 22 files, I am not sure as to why you want to change them. I suggest you stick to your original sort card as they are optimal.
Adding an INREC with conditions will affect the performance as it now needs to perform the checks twice(once on the INREC and the second on OUTFIL)