Q177011: Generated COBOL Will Not Compile
Article: Q177011
Product(s): Microsoft SNA Server
Version(s): WINDOWS:1.0
Operating System(s):
Keyword(s): kberrmsg kbprogramming
Last Modified: 05-APR-2000
-------------------------------------------------------------------------------
The information in this article applies to:
- Microsoft COM Transaction Integrator for CICS and IMS, version 1.0
-------------------------------------------------------------------------------
SYMPTOMS
========
When you use the Component Builder (CB) to create a component library (.tlb)
file manually (this is, without using the Import COBOL Wizard), you can define a
method with parameters in an order that prevents COBOL generated by the CB COBOL
Export facility from compiling properly.
If there are two or more parameters that are arrays whose actual counts depend on
the value of other parameters, those actual count parameters must appear before
the first array.
RESOLUTION
==========
The solution to this problem is to use CB to arrange the parameters in the
following order
COUNT1
COUNT2
ARRAY1
ARRAY2
and then regenerate the COBOL using the COBOL Export facility.
MORE INFORMATION
================
Example
-------
You generate a component library with the following four parameters:
Count1 (integer)
Array1 (anything)
Count2 (integer)
Array2 (anything)
The generated COBOL would be similar to this:
01 DFHCOMMAREA.
05 COUNT1 PIC S9(4) COMP. INOUT
05 ARRAY1 OCCURS 10 TIMES INOUT
DEPENDING ON COUNT1 OF DFHCOMMAREA
PIC S9(9) COMP.
05 COUNT2 PIC S9(4) COMP. INOUT
05 ARRAY2 OCCURS 10 TIMES INOUT
DEPENDING ON COUNT2 OF DFHCOMMAREA
PIC S9(9) COMP.
This COBOL produces the following error message when compiled on MVS:
115 IGYGR1137-S "OCCURS DEPENDING ON" object "COUNT2" was defined in
a variably located area. Execution results will be unpredictable.
Additional query words: Customer Information Control System (CICS) Management (IMS)
======================================================================
Keywords : kberrmsg kbprogramming
Technology : kbAudDeveloper kbCOMTISearch kbCOMTI100
Version : WINDOWS:1.0
Hardware : ALPHA x86
Issue type : kbprb
=============================================================================
THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.
Copyright Microsoft Corporation 1986-2002.