Ü    CASxx (Conditionally Invoke Subroutine)

 

·         This op-code compares factor 1 with factor 2 and as per the condition specified by CASxx, the subroutine specified in result field is processed.

·         xx represents EQ, GE, GT, LE, LT, NE  or BLANK.

·         The CAS statement is used to provide a subroutine if none of the previous CASxx operations have been met.

·         An ENDCS operation denotes the end of the CAS group and follows the last CASxx statement.

Factor 1

Op-code

Factor 2

Result Field

Resulting Indicators

       HI                            LO                      EQ

Comparison value 1

CASxx

Comparison  value 2

Subroutine name

Factor1>Factor2

Factor1

Factor1=Factor2

 

 

Example


Columns . . . :    6  80              Edit                                   AMINEM/QRPGLESRC
SEU==>                                                                             OP_CASEXX
FMT D  DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++
*************** Beginning of data ****************************************************
0001.00 Da                S              2  0 INZ(11)                                   130125
0002.00 Db                S              2  0 INZ(22)                                   130125
0003.00 DCOUNT            S              2  0 INZ(0)                                    130125
0004.00 C     a             CASEQ     b             SR0001                              130125
0005.00 C     a             CASLT     b             SR0001                              130125
0006.00 C     a             CASGT     b             SR0001                              130125
0007.00 C                   CAS                     SR0001                              130125
0008.00 C                   ENDCS                                                       130125
0009.00 C     COUNT         DSPLY                                                       130125
0010.00 C                   SETON                                        LR             130125
0011.00 C     SR0001        BEGSR                                                       130125
0012.00 C                   EVAL      COUNT=COUNT+1                                     130125
0013.00 C                   ENDSR                                                       130125
****************** End of data ********************************************************


 

 

OUTPUT

DSPLY   1          

 











User Comments:



Subscribe

.  


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