|
View previous topic :: View next topic
|
| Author |
Message |
Jim Alton
New User
Joined: 31 Dec 2012 Posts: 31 Location: England
|
|
|
|
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. |
|
| Back to top |
|
 |
Pandora-Box
Global Moderator
.jpg)
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
| So the point is? |
|
| Back to top |
|
 |
Skolusu
Senior Member
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. |
Jim Alton,
You need to explain with examples.
Do you mean something like this ?
SORTIN Has
and you want something like this
| Code: |
OPTION COPY
OUTFIL FNAMES=OUT01,INCLUDE=(1,1,CH,EQ,C'A')
OUTFIL FNAMES=OUT01S,SAVE
OUTFIL FNAMES=OUT02,INCLUDE=(1,1,CH,EQ,C'B')
OUTFIL FNAMES=OUT02S,SAVE
|
OUT01 will have A
OUT01S SHOULD have B, C, D, E, F
OUT02 will have B
OUT02S SHOULD have A, C, D, E, F
Is that what you want ?
If that is indeed what you want you can simply code the opposite condition on your SAVE datasets. something like this
| Code: |
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT01,INCLUDE=(1,1,CH,EQ,C'A')
OUTFIL FNAMES=OUT01S,OMIT=(1,1,CH,EQ,C'A')
OUTFIL FNAMES=OUT02,INCLUDE=(1,1,CH,EQ,C'B')
OUTFIL FNAMES=OUT02S,OMIT=(1,1,CH,EQ,C'B')
//* |
|
|
| Back to top |
|
 |
Jim Alton
New User
Joined: 31 Dec 2012 Posts: 31 Location: England
|
|
|
|
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. |
|
| Back to top |
|
 |
Skolusu
Senior Member
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. |
|
|
| Back to top |
|
 |
Jim Alton
New User
Joined: 31 Dec 2012 Posts: 31 Location: England
|
|
|
|
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.
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:
| Code: |
OPTION COPY
OUTFIL FNAMES=OUT01,STARTREC=30,ENDREC=70
OUTFIL FNAMES=OUT02,STARTREC=20,ENDREC=80
OUTFIL FNAMES=OUT03,SAVE
|
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? |
|
| Back to top |
|
 |
Skolusu
Senior Member
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:
| Code: |
OPTION COPY
OUTFIL FNAMES=OUT01,STARTREC=30,ENDREC=70
OUTFIL FNAMES=OUT02,STARTREC=20,ENDREC=80
OUTFIL FNAMES=OUT03,SAVE
|
then what would the SAVE receive? Would it just receive the first and last 19 records? |
OUT03 would indeed receive the first and last 19 records. Run this sample and see it for your self
Step0050 creates a 8 byte file with just seqnum for 100 records.
| Code: |
//STEP0050 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
DUMMY RECORD
//SORTOUT DD DSN=&&IN,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//SYSIN DD *
OPTION COPY
OUTFIL REPEAT=100,BUILD=(SEQNUM,8,ZD)
//*
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DISP=SHR,DSN=&&IN
//OUT01 DD SYSOUT=*
//OUT02 DD SYSOUT=*
//OUT03 DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT01,STARTREC=30,ENDREC=70
OUTFIL FNAMES=OUT02,STARTREC=20,ENDREC=80
OUTFIL FNAMES=OUT03,SAVE
//* |
| Jim Alton wrote: |
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? |
Try these control cards
| Code: |
//SYSIN DD *
OPTION COPY
OUTREC OVERLAY=(10:SEQNUM,3,ZD)
OUTFIL FNAMES=OUT01,STARTREC=30,ENDREC=70
OUTFIL FNAMES=OUT01S,INCLUDE=(10,3,ZD,LT,30,OR,10,3,ZD,GT,70)
OUTFIL FNAMES=OUT02,STARTREC=20,ENDREC=80
OUTFIL FNAMES=OUT02S,INCLUDE=(10,3,ZD,LT,20,OR,10,3,ZD,GT,80)
OUTFIL FNAMES=OUT03,SAVE
//* |
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. |
|
| Back to top |
|
 |
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
small correction, I believe
| Quote: |
OUT03 would indeed receive the first and last 19 records. Run this sample and see it for your self
|
shoud be
| Quote: |
OUT03 would indeed receive the first 19 and last 20 records. Run this sample and see it for your self
|
Gerry |
|
| Back to top |
|
 |
Jim Alton
New User
Joined: 31 Dec 2012 Posts: 31 Location: England
|
|
|
|
Dear Skolusu,
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:
| Code: |
//SYSIN DD *
OPTION COPY
OUTREC OVERLAY=(10:SEQNUM,3,ZD)
OUTFIL FNAMES=OUT01,STARTREC=30,ENDREC=70
OUTFIL FNAMES=OUT01S,INCLUDE=(10,3,ZD,LT,30,OR,10,3,ZD,GT,70)
OUTFIL FNAMES=OUT02,STARTREC=20,ENDREC=80
OUTFIL FNAMES=OUT02S,INCLUDE=(10,3,ZD,LT,20,OR,10,3,ZD,GT,80)
OUTFIL FNAMES=OUT03,SAVE
//*
|
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. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
| gcicchet wrote: |
Hi,
small correction, I believe
| Quote: |
OUT03 would indeed receive the first and last 19 records. Run this sample and see it for your self
|
shoud be
| Quote: |
OUT03 would indeed receive the first 19 and last 20 records. Run this sample and see it for your self
|
Gerry |
Apologies. Thanks for the correction Gerry. |
|
| Back to top |
|
 |
Skolusu
Senior Member
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. |
|
| Back to top |
|
 |
Jim Alton
New User
Joined: 31 Dec 2012 Posts: 31 Location: England
|
|
|
|
| Thanks for the attention, Skolusu, and for the implied judgement that it's an idea worth further consideration. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|