On 10/8/2014 8:35 PM, Brian Peterson wrote:
We have had a lot of success with COBOL 5 but have had a few "edge cases" where 
we've seen issues.

Since you mention OPT(1), one thing we've seen with COBOL 5 is that
the calling and called program parameter lists must be identical. Check
and see if there is a coding mistake where your calling program
specifies for example the 05 level of a data structure and the called
program specifies the 01 level. We z/OS guys understand that it is just
an address pointer, but the COBOL compiler will silently discard
statements that are known to be a constant value since they cannot change.

A statement cannot be 'a constant value'. A data item may be.


01 Field-01.
   05 sub-field-02 pic x(8) value "aaaa".
   05 sub-field-03 pic x(8) value " bbbb".

If the calling program passes "sub-field-02" to the called program
instead of "field-01", the compiler will assume the calling program
cannot change "sub-field-03" and drop for example IF statements that
refer to "sub-field-03" since the compiler knows what the value must be.

That doesn't sound remotely accurate. Just because a field is
initialized doesn't mean it cannot be changed; the compiler
would not / could not arbitrarily drop data fields in parameter
lists. I suggest the true cause of problems you encountered
were caused by other reasons.

Now, if a data item is not referenced in a program, the compiler
has been known to remove the data item from a program under certain
conditions. In your example, if no statement mentions any of the
names Field-01, sub-field-02, or sub-field-03 then the structure
might not be included in the object code at all.

But that's not what you seem to be trying to say.

-Steve Comstock



Valid COBOL programs work well with COBOL 5 but edge cases can be tricky to 
debug. Another option is to try OPT(0).

Brian

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to