IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Compiler option AWO again


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Aug 24, 2012 6:13 am
Reply with quote

OK, following on from this one.

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,

Of course, you may have no choice :-)

So be aware of what is going on...
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Aug 27, 2012 2:20 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Aug 27, 2012 3:51 pm
Reply with quote

Thanks Bill. You got me thinking now... icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts SCOPE PENDING option -check data DB2 2
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
No new posts CICS vs LE: STORAGE option CICS 0
No new posts INSYNC option with same function as I... JCL & VSAM 0
Search our Forums:

Back to Top