Ü  CALLB(D|E) (Call a Bound Procedure)      

·         This op-code calls a procedure that is bound statically to the main program.  

·         It is a static call.

·         The operation extender ‘D’ may be used to include operational descriptors (information about each parameter to be passed to the called procedure.).

·         If there is any error in this call operation then the error can be traced with operator extender ‘E’ and LO level indicator which turns on in case of any error.

·         If we don’t want to use error indicator with operator extender ‘E’ even then we can trace the error by using the built-in function %ERROR and %STATUS. For more information see chapter File and Program exception.

·         If the called program returns with LR indicator on, the calling program can trace that will EQ indicator.

Factor 1

Op-code

Factor 2

Result Field

Resulting Indicators

HI                    LO                EQ                     

CALLB(D E)

' procedure name'

[parameter list]

 

[error]

[LR}

 


Example


Columns . . . :    6  80                 Browse                               AMINEM/QRPGLESRC
SEU==>                                                                               OP_CALLB
FMT C  CL0N01Factor1+++++++Opcode&ExtFactor2+++++++Result++++++++Len++D+HiLoEq....
*************** Beginning of data ****************************************************
0001.00 C     PLST1         PLIST                                                       130125
0002.00 C                   PARM                    a                 2 0               130125
0003.00 C                   PARM                    b                 2 0               130125
0004.00 C                   PARM                    c                 2 0               130125
0005.00  *                                                                              130125
0006.00 C                   Z-ADD     11            a                                   130125
0007.00 C                   Z-ADD     22            b                                   130125
0008.00 C                   Z-ADD     *zeros        c                                   130125
0009.00 C                   CALLB     'OP_CALLB1'   PLST1                               130125
0010.00 C     c             DSPLY                                                       130125
0011.00 C                   SETON                                        LR             130125
****************** End of data *******************************************************

 

The called program OP_CALLB1:


Columns . . . :    6  80                 Browse                              AMINEM/QRPGLESRC
SEU==>                                                                              OP_CALLB1
FMT C  CL0N01Factor1+++++++Opcode&ExtFactor2+++++++Result++++++++Len++D+HiLoEq....
*************** Beginning of data ************************************************************
0001.00 C     *ENTRY        PLIST                                                       130125
0002.00 C                   PARM                    p                 2 0               130125
0003.00 C                   PARM                    q                 2 0               130125
0004.00 C                   PARM                    r                 2 0               130125
0005.00 C                   EVAL      r=p+q                                             130125
0006.00 C                   RETURN                                                      130125
****************** End of data ***************************************************************



CRTPGM PGM(AMINEM/OP_CALLB) MODULE(AMINEM/OP_CALLB AMINEM/OP_CALLB1) ENTMOD(*PGM)


OUTPUT

DSPLY  33










User Comments:



Subscribe

  Email:



Copyright © Go4as400.com, 2013-2017. Copyright notice