Ü    CALL(E) (Call a Program)       

               

·         This op-code passes control to the program specified in factor 2. It’s a dynamic call operation.

·         Program name should be in quotes.

·         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                     

 

CALL(E)

‘program name’

[parameter list]

 

[error]

[LR}

 


Example


Columns . . . :    6  80              Browse                                  AMINEM/QRPGLESRC
SEU==>                                                                                OP_CALL
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                   CALL      'OP_CALL1'    PLST1                               130125
0010.00 C     c             DSPLY                                                       130125
0011.00 C                   SETON                                        LR             130125
****************** End of data *******************************************************

 

 


Columns . . . :    6  80                 Browse                               AMINEM/QRPGLESRC
SEU==>                                                                               OP_CALL1
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 *******************************************************

 

Output

DSPLY  33   

 











User Comments:



Copyright © www.go4as400.com, 2013-2023. Copyright notice   Terms of services   Privacy policy