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.

Read syntax diagramSkip visual syntax diagram
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.
End of IBM Extension