HP 3000 Manuals

Ap B. Using HP Link Editor/XL with HP COBOL II/XL [ HP Link Editor/XL Reference Manual ] MPE/iX 5.0 Documentation


HP Link Editor/XL Reference Manual

Appendix B  Using HP Link Editor/XL with HP COBOL II/XL 

This appendix discusses the HP COBOL II/XL compiler conventions that
relate specifically to HP Link Editor/XL. The following items explain how
you use the conventions to successfully create executable program files.
(For details about compiler conventions, see the HP COBOL II Reference 
Manual, the HP COBOL II/XL Programmer's Guide or the HP COBOL II/XL 
Reference Manual Supplement.)

   *   Compilation units 

       If you do not use the RLFILE option of the $CONTROL directive, the
       entire source file is treated as one compilation unit and the
       compiler produces a relocatable object file containing a single
       relocatable object module.

       If you use RLFILE, each concatenated (program unit that is not
       contained in another program) is a separate compilation unit and
       results in a separate relocatable object module in the relocatable
       library.

   *   Relocatable object module name 

       If you do not use the RLFILE option of the $CONTROL directive, the
       relocatable object module name is the unqualified name of the
       COBOL source file.

       If you use RLFILE, the relocatable object module name is the
       PROGRAM-ID name of that module.

   *   Program entry point 

       The program entry point is the name specified in the PROGRAM-ID
       statement.  Secondary entry points are specified by the ENTRY
       verb.

   *   Scope of data 

       External data and files are relative to the name of the data item
       or file.

       Internal and local data has local scope.

       Data in the main program is relative to $global$.

       Data is OWN (relative to M$ n$ name in the map, where n is a
       number and name is the module name) if the PROGRAM-ID paragraph
       does not contain an INITIAL clause, or if the program contains one
       of the following compiler directives:

            $CONTROL ANSISUB
            $CONTROL SUBPROGRAM

       Data is local (SP relative) if the PROGRAM-ID paragraph contains
       an INITIAL clause, or if the program contains the $CONTROL DYNAMIC
       directive.

   *   Locality sets 

       When an HP COBOL II relocatable object file contains multiple
       chunks of code, the locality set name is the name entered for the
       PROGRAM-ID. When the relocatable object file contains a single
       chunk, no locality set is used.

   *   Type checking 

       The compiler generates the following type checking information for
       parameters in non-intrinsic CALL statements:

          1.  A type checking level of 3.

          2.  The parameter-passing method is by reference or value.

          3.  The alignment (but not the type) of each identifier passed
              by reference or by content.

          4.  The type of each identifier passed by value.

          5.  The type of identifier in the GIVING clause of the CALL
              statement.

       The compiler generates the following type checking information for
       the formal parameters declared in the USING clause of the
       Procedure Division header or ENTRY statement.

          1.  A type checking level of 3.

          2.  The parameter-passing method is by reference.

          3.  The alignment of each parameter.  The alignment is assumed
              to be on byte boundaries unless you use LINKALIGNED16 or
              LINKALIGNED for the OPTFEATURES= parameter of the $CONTROL
              compiler directive.  If you use LINKALIGNED16, alignment is
              assumed to be on 16-bit boundaries and if you use
              LINKALIGNED, alignment is assumed to be on 32-bit
              boundaries.

       To override the type checking level used during compilation, use
       the
       PARMCHECK= check_level parameter of the LINK command.



MPE/iX 5.0 Documentation