I POST THIS BECAUSE I KNOW DFSORT DEVELOPERS MONITOR THIS FORUM.
I think I know how SAVE works - it sweeps up everything all the other OUTFIL statements discard, and is coded in a separate OUTFIL statement. But, it seems to me, that the step of incorporating SAVE into another OUTFIL INCLUDE/OMIT would be beneficial and, surely, not that hard, since DFSORT already does the same with a single OUTFIL INCLUDE/OMIT accompanied by an OUTFIL SAVE. So, I'm advocating multiple OUTFIL INCLUDE/OMIT with their own SAVEs. There is a problem in identifying the multiple SAVE datasets but surely that's a small problem.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Jim Alton wrote:
I POST THIS BECAUSE I KNOW DFSORT DEVELOPERS MONITOR THIS FORUM.
I think I know how SAVE works - it sweeps up everything all the other OUTFIL statements discard, and is coded in a separate OUTFIL statement. But, it seems to me, that the step of incorporating SAVE into another OUTFIL INCLUDE/OMIT would be beneficial and, surely, not that hard, since DFSORT already does the same with a single OUTFIL INCLUDE/OMIT accompanied by an OUTFIL SAVE. So, I'm advocating multiple OUTFIL INCLUDE/OMIT with their own SAVEs. There is a problem in identifying the multiple SAVE datasets but surely that's a small problem.
Your example is what I'm getting at, though the example code, of course, wouldn't give the example output.
The third image, the actual working code, would satisfy the simple example, but the method wouldn't satisfy more complex examples.
I was thinking of the SAVE being integrated in to the OUTFIL INCLUDE/OMIT statement since working out the obverse of an OUTFIL that includes STARTREC, ENDREC, etc., might be difficult to impossible.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Jim Alton wrote:
Skolusu,
Your example is what I'm getting at, though the example code, of course, wouldn't give the example output.
The third image, the actual working code, would satisfy the simple example, but the method wouldn't satisfy more complex examples.
I was thinking of the SAVE being integrated in to the OUTFIL INCLUDE/OMIT statement since working out the obverse of an OUTFIL that includes STARTREC, ENDREC, etc., might be difficult to impossible.
I am not sure if you have read the documentation of SAVE. SAVE indeed takes into account the STARTREC and ENDREC parms.
Quote:
SAVE Specifies that OUTFIL input records not included by STARTREC, ENDREC, ACCEPT , SAMPLE, INCLUDE or OMIT for any other OUTFIL group are to be included in the data sets for this OUTFIL group. SAVE operates in a global fashion over all of the other OUTFIL statements for which SAVE is not specified, enabling you to keep any OUTFIL input records that would not be kept otherwise. SAVE will include the same records for each group for which it is specified.
It is possible that I'm misunderstanding the operation of the SAVE, but the Technical Writers sometimes have a difficult job in expressing clearly the precise operation of these things.
The way I understand the operation of the SAVE is that it takes all records discarded by the other OUTFILs, and it need only be coded once within the SYSIN since its input in entirely determined by the other OUTFILs. However, it's not clear whether a record rejected by one OUTFIL statement but accepted by another, will appear in the SAVE dataset. For instance, if you had a data set of 100 records and had:
then what would the SAVE receive? Would it just receive the first and last 19 records? Then make it more complicated by inserting INCLUE/OMIT statements - what would then appear in the SAVE dataset?
Getting back to the issue of saving the rejects from individual OUTFILs, and referring to the same example, how would you get the records rejected from OUT01 in one dataset and the records rejected from OUT02 in another dataset?
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Jim Alton wrote:
Dear Skolusu,
It is possible that I'm misunderstanding the operation of the SAVE, but the Technical Writers sometimes have a difficult job in expressing clearly the precise operation of these things.
Well Frank Yaeger was the technical writer in this case and he is the one who coded most of the stuff and IMHO the documentation does explain it in detail.
Jim Alton wrote:
The way I understand the operation of the SAVE is that it takes all records discarded by the other OUTFILs, and it need only be coded once within the SYSIN since its input in entirely determined by the other OUTFILs. However, it's not clear whether a record rejected by one OUTFIL statement but accepted by another, will appear in the SAVE dataset. For instance, if you had a data set of 100 records and had:
Then make it more complicated by inserting INCLUE/OMIT statements - what would then appear in the SAVE dataset?
Play around with the sample job above and see the results.
Jim Alton wrote:
Getting back to the issue of saving the rejects from individual OUTFILs, and referring to the same example, how would you get the records rejected from OUT01 in one dataset and the records rejected from OUT02 in another dataset?
With the above control cards, OUT03 which is a SAVE dataset will NOT have any records, as every record in the file is accounted for in one of the OUTFIL dataset.
Thanks for confirming that a record rejected by one OUTFIL statement but accepted by another does not get included in the SAVE dataset.
Regarding your solution to the question I posed about the example:
you have had to alter the records by inserting a sequence of numbers in order that you can pick out the rejected records, but, in general, you would not want to do that. Of course, in general, you don't want to alter any of the records for the purpose of selection and rejection. The way that SAVE works currently is without artificially altering the record contents, and if SAVE were integrated into individual OUTFILs then you wouldn't need to think of altering or augmenting the records for selection purposes.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Jim Alton wrote:
The way that SAVE works currently is without artificially altering the record contents, and if SAVE were integrated into individual OUTFILs then you wouldn't need to think of altering or augmenting the records for selection purposes.
Jim Alton,
I will add your suggestion to the list of candidates for future enhancements to DFSORT, but it's a long list, and all of the items have to be prioritized against each other. Suggestions are always welcome, but I can't discuss specifics or make any promises.