why do we use the EXTPGM keyword in the RPG program? Please provide the syntax of the EXTPGM keyword with some examples.
How does EXTPGM work when declaring an external program call in the RPGLE program?
Sorry, you do not have permission to ask a question, You must login to ask a question.
Sorry, you do not have permission to ask a question.
The
EXTPGM
keyword is used to define the procedure prototype in the RPGLE program. Prototype informs the compiler of how the parameters are defined in the program or procedure. When we use theEXTPGM
keyword, then the call will be an external program call that uses an external program object specified by theEXTPGM
keyword. The call becomes a dynamic external call if the prototype contains the termEXTPGM
keyword; otherwise, it is a bound procedure call.Example of using EXTPGM keyword:
D PGM1 PR EXTPGM('PGM1')
Defining EXTPGM keyword in RPGfully free format:
DCL-PR PGM1 EXTPGM;
END-PR;
D PGM1 PR EXTPGM('PGM1')
D PARM1 10A CONST
Defining EXTPGM keyword in RPG fully free format:
DCL-PR PGM1 EXTPGM;
PARM1 CHAR(10) CONST;
END-PR;