Go down a bit, and you'll get to AWO and some discussion of what abends and what doesn't.
I have carefully hand-crafted four programs.
The first has one QSAM VB input and one QSAM VB output. Prior to opening the input, something is moved to record area defined under the FD.
Without compiler option AWO, BANG! S0C4.
With compiler option AWO, RC=0.
The second has one QSAM VB input and one QSAM VB output. After closing the input,
something is moved to record area defined under the FD.
Without compiler option AWO, BANG! S0C4.
With compiler option AWO, RC=0.
The third has one QSAM VB input and one QSAM VB which is not referenced. Prior to opening the input, something is moved to record area defined under the FD.
Without compiler option AWO, BANG! S0C4.
With compiler option AWO, RC=0.
The fourth has one QSAM VB input and one QSAM VB which is not referenced. After closing the input, something is moved to record area defined under the FD.
Without compiler option AWO, BANG! S0C4.
With compiler option AWO, RC=0.
Beginning to sense a pattern, I carefully hand-crafted a further two programs.
These are similar to the above, but only contain one file, which is opened for input.
With both:
Without compiler option AWO, BANG! S0C4.
With compiler option AWO, RC=0.
I decided not to bother testing to prove that the MOVE to the record-area after end of tile would abend with AWO - if it doesn't abend after the close, it won't abend after end of file.
I suppose worth one more carefully hand-crafted program. FB.
As expected. S0C4 irrespective of AWO.
My advice remains: use APPLY WRITE ONLY for all QSAM VB output files. Do not use compiler option AWO,
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Just a run-through on why not to use compiler option AWO.
AWO applies to all QSAM VB In the program, including input files.
What this means for the input files (since the WRITE part obviously does not apply) is that the record is moved from the buffer to a record-area which is pointed-to by the FD.
The is no advantage for you in this.
Although this allows for sloppy coding, like using the FD before the file is open, after the file is closed or after end-of-file, as soon as you recompile without AWO, or go to another site which does not use AWO, your sloppy code will fail (in the case of the first two) and may fail in the case of the latter.
With no advantage, you are left with the disadvantage of each input record being moved, and the additional processing time that that takes. MVCL is a "slow" instruction, and that is what will be used.
APPLY WRITE ONLY is good to use on all your QSAM VB output files. Spell it out for each of them and don't use (unless forced to by site standards) compiler option AWO.