ILE COBOL Language Reference

+-------------------------------IBM Extension--------------------------------+

Format 6 - Procedure-Pointer Data Item

When Format 6 of the SET statement is executed,

the current value of the receiving field is replaced by the address value contained in the sending field.

SET Statement - Format 6
 
        .-------------------------------.
        V                               |
>>-SET----procedure-pointer-data-item-1-+----------------------->
 
>--TO--+-procedure-pointer-data-item-2------------------------------------+-><
       +-ENTRY--+-identifier-1----------------------+--| Library Phrase |-+
       |        '-+--------------------+--literal-1-'                     |
       |          '-| Linkage Phrase |-'                                  |
       +-NULL-------------------------------------------------------------+
       '-NULLS------------------------------------------------------------'
 
Linkage Phrase:
 
|--+---------------------------------------------------+--------|
   +-LINKAGE--+------+--+----+--+-environment-name-1-+-+
   |          '-TYPE-'  '-IS-'  +-PROGRAM------------+ |
   |                            '-PROCEDURE----------' |
   +-PROGRAM-------------------------------------------+
   '-PROCEDURE-----------------------------------------'
 
Library Phrase:
 
|--+-----------------------------------+------------------------|
   '-+----+--LIBRARY--+-identifier-2-+-'
     '-IN-'           '-literal-2----'
 
 
Procedure-pointer-data-item-1, procedure-pointer-data-item-2
Procedure-pointer-data-item-1 is the receiving field.

They must be described as USAGE IS PROCEDURE-POINTER.

identifier-1
Must be defined as an alphanumeric item such that the value can be a program name. (For more information, see PROGRAM-ID Paragraph.) The procedure-pointer data item is set to the outermost COBOL program (an ILE procedure) of the same compilation unit, or to the program object (*PGM), named in identifier-1. The contents of the identifiers are affected by the *MONOPRC option of the CRTCBLMOD or CRTBNDCBL command.
literal-1
Must be nonnumeric and must conform to the rules for formation of program-names. The literals are affected by the *MONOPRC option of the CRTCBLMOD or CRTBNDCBL command. The procedure-pointer data item can be set to the outermost COBOL program (an ILE procedure) of the same compilation unit, the outermost COBOL program (an ILE procedure) in another compilation unit, an ILE procedure (written in another ILE language), or a program object (*PGM). The procedure-pointer data item cannot be set to a nested COBOL program even if the nested COBOL program of the specified name is visible from the point of SET. The LINKAGE TYPE phrase of the ENTRY clause, along with the LINKAGE TYPE clause of the SPECIAL-NAMES paragraph and the LINKLIT parameter of the CRTCBLMOD or CRTBNDCBL command determine the type of object that the procedure-pointer data item is set to.

LINKAGE TYPE Phrase

The LINKAGE TYPE phrase is used to specify the type of program that the procedure-pointer data item is set to. It could be set to the address of a separately compiled program object (*PGM) or a procedure within a program.

environment-name-1
The type of program that procedure-pointer-data-item-1 will be set to. Environment-name-1 can be defined as:
PROGRAM
Procedure-pointer-data-item-1 is set to a program object (*PGM).
PROCEDURE
Procedure-pointer-data-item-1 is set to a procedure.
NULL(S)
Sets the receiving field to contain the value of an invalid address.

IN LIBRARY Phrase

The IN LIBRARY phrase is valid only for setting a procedure pointer data item to an program object. That is, a linkage of program must be specified, whether implicitly or explicitly, on the SET statement.

identifier-2
Must be an alphanumeric data item. The contents of identifier-2 must represent a valid library name. library names are at most 10 characters long; the first 10 characters of identifier-2 are used to form the library name.
literal-2
Must be nonnumeric and can be a maximum of 10 characters.

Identifier-2 and literal-2 are not affected by the *MONOPRC compiler option, and can contain an extended name.

+----------------------------End of IBM Extension----------------------------+


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]