HP 3000 Manuals

Chunk and Locality Set Names [ HP COBOL II/XL Programmer's Guide ] MPE/iX 5.0 Documentation


HP COBOL II/XL Programmer's Guide

Chunk and Locality Set Names 

The locality set name is extracted from the PROGRAM-ID paragraph,
according to the external naming convention (refer to the HP Link 
Editor/XL Reference Manual for the definition of locality set).  The
executable code resides in the program file or an executable library.
For a large program, the executable code is in chunks.  Each chunk is in
a separate subspace, but they all reside in the same program file and
locality set.

The chunk name is the locality set name, with a three-digit number
enclosed in dollar signs concatenated to it.

Example 1 

If the program-id of a three-chunk program is PROG-1, then the locality
set name is prog_1, and the chunk names are:

     prog_1
     prog_1$001$
     prog_1$002$

You must be aware of chunks in these situations:

   *   When you read a verb map.  Each code offset is offset from the
       beginning of a chunk.  See Chapter 7  for information on maps.

   *   When you use DEBUG. Each code offset is offset from the beginning
       of a chunk.  See Chapter 7  for information on debugging.

   *   When you use the LINK command.  If you specify the MAP parameter,
       the command prints the code offset for each chunk.  Refer to the
       HP Link Editor/XL Reference Manual for more information on the
       LINK command.

Example 2 

The following program illustrates chunk names with nested and
concatenated programs.  The main program contains a subprogram, which
contains another subprogram, and a concatenated program follows the main
program's END PROGRAM header.  All the programs are chunked.  With nested
or concatenated programs, a new chunk begins whenever a new program
starts.  Large programs may be chunked in the middle of the PROCEDURE
DIVISION code.

     IDENTIFICATION DIVISION.
     PROGRAM-ID. MAIN-P.
     PROCEDURE DIVISION.              Main program (first chunk) starts here. 

         :                  Second chunk starts here. 

     IDENTIFICATION DIVISION.         First subprogram (third chunk) starts here. 

     PROGRAM-ID. SUB-1.                
     PROCEDURE DIVISION.
         :                  Fourth chunk starts here. 

     IDENTIFICATION DIVISION.         Second subprogram (fifth chunk) starts here. 

     PROGRAM-ID. SUB-2.                
     PROCEDURE DIVISION.
         :                  Sixth chunk starts here. 

     END PROGRAM SUB-2.                
     END PROGRAM SUB-1.                
     END PROGRAM MAIN-P.               

     IDENTIFICATION DIVISION.         Concatenated subprogram (seventh chunk). 

     PROGRAM-ID. CONCAT-P.             
     PROCEDURE DIVISION.
          :                 Eighth chunk starts here. 

     END PROGRAM CONCAT-P.

The following table gives the chunk location, number and name for the
chunks in the above example:

------------------------------------------------------------------------------------------
|                                                                                        |
|        Chunk Location                Chunk Number                  Chunk Name          |
|                                                                                        |
------------------------------------------------------------------------------------------
|                                                                                        |
| Main program                              1               main_p                       |
|                                                                                        |
| Main program                              2               main_p$001$                  |
|                                                                                        |
| Nested program                            3               main_p$003$sub_1             |
|                                                                                        |
| Nested program                            4               main_p$003$sub_1$001$        |
|                                                                                        |
| Nested program                            5               main_p$004$sub_2             |
|                                                                                        |
| Nested program                            6               main_p$004$sub_2$001$        |
|                                                                                        |
| Concatenated program                      7               concat_p                     |
|                                                                                        |
| Concatenated program                      8               concat_p$001$                |
|                                                                                        |
------------------------------------------------------------------------------------------



MPE/iX 5.0 Documentation