ILE RPG Version6 Opcodes
From RPG Reference
ILE RPG Version 6 Opcodes
[ Up to Version 6 ]
Version 6 ILE RPG Language is a product of IBM
The information in this table is taken from the IBM manual: ILE RPG Language Reference Version 6, Release 1 [1]
| Factor 1 | Opcode | Factor 2 | Result Field | Ind. 1 | Ind. 2 | Ind. 3 |
|---|---|---|---|---|---|---|
| Free-form syntax | ||||||
| Device name | Acq (e) | WORKSTN file | ER | |||
| ACQ{(E)} device-name workstn-file | ||||||
| Addend | ADD (h) | Added | Sum | + | - | Z |
| (not allowed - use the + or += operator) | ||||||
| Date/Time | ADDDUR(e) | Duration:Duration Code | Date/Time | ER | ||
| (not allowed - use the + or += operators with duration functions such as %YEARS and %MONTHS) | ||||||
| ALLOC (e) | Length | Pointer | ER | |||
| (not allowed - use the %ALLOC built-in function) | ||||||
| Comparand | ANDxx | Comparand | ||||
| (not allowed - use the AND operator) | ||||||
| subroutine name | BEGSR | |||||
| BEGSR subroutine-name | ||||||
| BITOFF | bit numbers | character field | ||||
| (not allowed - use the%BITAND and %BITNOT built-in functions. | ||||||
| BITON | bit numbers | character field | ||||
| (not allowed - use the %BITOR built-in function. | ||||||
| Comparand | CABxx | Comparand | Label | HI | LO | EQ |
| (not allowed - use other operation codes, such as LEAVE, ITER, and RETURN) | ||||||
| CALL (e) | Program name | Plist name | ER | LR | ||
| (not allowed - use the CALLP operation code) | ||||||
| CALLB (d e) | Procedure name or procedure pointer | Plist name | ER | LR | ||
| (not allowed - use the CALLP operation code) | ||||||
| CALLP (e m/r) | NAME{ (Parm1 {:Parm2...}) } | |||||
| {CALLP{(EMR)}} name( {parm1{:parm2...}} ) | ||||||
| Comparand | CASxx | Comparand | Subroutine name | HI | LO | EQ |
| (not allowed - use the IF and EXSR operation codes) | ||||||
| Source string 1 | CAT (p) | Source string 2:number of blanks | Target string | |||
| (not allowed - use the + operator) | ||||||
| search-arg | CHAIN (e n) | name (file or record format) | data-structure | NR | ER | |
| CHAIN{(ENHMR)} search-arg name {data-structure} | ||||||
| Comparator string | CHECK (e) | Base string:start | Left- position | ER | FD | |
| (not allowed - use the %CHECK built-in function) | ||||||
| Comparator string | CHECKR (E) | Base string:start | Right- position | ER | FD | |
| (not allowed - use the %CHECKR built-in function) | ||||||
| *NOKEY | CLEAR | *ALL | name (variable or record format) | |||
| CLEAR {*NOKEY} {*ALL} name | ||||||
| CLOSE (e) | file-name or *ALL | ER | ||||
| CLOSE{(E)} file-name|*ALL | ||||||
| Boundary | COMMIT (e) (COMIT) | ER | ||||
| COMMIT{(E)} {boundary} | ||||||
| Comparand | COMP | Comparand | HI | LO | EQ | |
| (not allowed - use the use the =, <, <=, >, >=, or <> operators) | ||||||
| DEALLOC(e/n) | pointer-name | ER | ||||
| DEALLOC{(EN)} pointer-name | ||||||
| *LIKE | DEFINE | Referenced field | Defined field | |||
| (not allowed - use the LIKE or DTAARA keyword on the Definition specification) | ||||||
| *DTAARA | DEFINE | External data area | Internal field | |||
| (not allowed - use the LIKE or DTAARA keyword on the Definition specification) | ||||||
| search-arg | DELETE (e) | name (file or record format) | NR | ER | ||
| DELETE{(EHMR)} {search-arg} name | ||||||
| Dividend | DIV (h) | Divisor | Quotient | + | - | Z |
| (not allowed - use the / or /= operator, or the%DIV built-in function) | ||||||
| Starting value | DO | Limit value | Index value | |||
| (not allowed - use the FOR operation code) Code | ||||||
| DOU (m/r) | indicator-expression | |||||
| DOU{(MR)} indicator-expression | ||||||
| Comparand | DOUxx | Comparand | ||||
| (not allowed - use the DOU operation code) | ||||||
| DOW (M/R) | indicator-expression | |||||
| DOW{(MR)} indicator-expression | ||||||
| Comparand | DOWxx | Comparand | ||||
| (not allowed - use the DOW operation code) | ||||||
| message | DSPLY (e) | output-queue | response | ER | ||
| DSPLY{(E)} {message {output-queue {response}}} | ||||||
| Identifier | DUMP (A) | |||||
| DUMP{(A)} {identifier} | ||||||
| ELSE | ||||||
| ELSE | ||||||
| Blank | ELSEIF (M/R) | indicator-expression | ||||
| ELSEIF{(MR)} indicator-expression | ||||||
| ENDyy | Increment value (ENDDO and END only) | |||||
| ENDDO ENDFOR ENDIF ENDMON ENDSL (END and ENDCS not allowed) | ||||||
| Label | ENDSR | return-point | ||||
| ENDSR {return-point} | ||||||
| EVAL (H M/R) | Assignment Statement | |||||
| {EVAL{(HMR)}} result = expression {EVAL{(HMR)}} result += expression | ||||||
| EVALR (m/r) | Assignment Statement | |||||
| EVALR{(MR)} result = expression | ||||||
| EVAL-CORR | target = source | |||||
| EVAL-CORR{(HMR)} target = source; | ||||||
| EXCEPT | except-name | |||||
| EXCEPT {except-name} | ||||||
| EXFMT (e)[2] | format-name | data-structure | ER | |||
| EXFMT{(E)} format-name {data-structure} | ||||||
| EXSR | subroutine-name | |||||
| EXSR subroutine-name | ||||||
| EXTRCT (e) | Date/Time:Duration Code | Target | ER | |||
| (not allowed - use the %SUBDT built-in function) | ||||||
| FEOD (EN) | file-name | ER | ||||
| FEOD{(EN)} file-name | ||||||
| FOR | DOWNTO limit | |||||
| FOR{(MR)} index-name {= start-value} {BY increment} {TO|DOWNTO limit}; | ||||||
| FORCE | file-name | |||||
| FORCE file-name | ||||||
| GOTO | Label | |||||
| (not allowed - use other operation codes, such as LEAVE, LEAVESR, ITER, and RETURN) | ||||||
| Blank | IF (m/r) | indicator-expression | ||||
| IF{(MR)} indicator-expression | ||||||
| Comparand | IFxx | Comparand | ||||
| (not allowed - use the IF operation code) | ||||||
| *LOCK | IN (e) | data-area-name | ER | |||
| IN{(E)} {*LOCK} data-area-name | ||||||
| ITER | ||||||
| ITER | ||||||
| KFLD | Indicator | Key field | ||||
| (not allowed - use %KDS) | ||||||
| KLIST name | KLIST | |||||
| (not allowed - use %KDS) | ||||||
| LEAVE | ||||||
| LEAVE | ||||||
| LEAVESR | ||||||
| LEAVESR | ||||||
| Search argument | LOOKUP | Array name | HI | LO | EQ | |
| (not allowed - use the %LOOKUP or %TLOOKUP built-in function) | ||||||
| Search argument | LOOKUP | Table name | Table name | HI | LO | EQ |
| (not allowed - use the %LOOKUP or %TLOOKUP built-in function) | ||||||
| MHHZO | Source field | Target field | ||||
| (not allowed - use the %BITAND and %BITOR built-in functions. | ||||||
| MHLZO | Source field | Target field | ||||
| (not allowed - use the %BITAND and %BITOR built-in functions. | ||||||
| MLHZO | Source field | Target field | ||||
| (not allowed - use the %BITAND and %BITOR built-in functions. | ||||||
| MLLZO | Source field | Target field | ||||
| (not allowed - use the %BITAND and %BITOR built-in functions. | ||||||
| MONITOR | ||||||
| MONITOR | ||||||
| Data Attributes | MOVE (p) | Source field | Target field | + | - | ZB |
| (not allowed -
use the EVAL or EVALR operations, or built-in functions such as %CHAR, %DATE, %DEC , %DECH, %GRAPH, %INT, %INTH, %TIME, %TIMESTAMP , %UCS2, %UNS, or %UNSH ) | ||||||
| MOVEA (p) | Source | Target | + | - | ZB | |
| (not allowed — use %SUBARR or one or more String Operations) | ||||||
| Data Attributes | MOVEL (p) | Source field | Target field | + | - | ZB |
| not allowed - use EVAL,
or built-in functions such as %CHAR, %DATE, %DEC , %DECH, %GRAPH, %INT, %INTH, %TIME, %TIMESTAMP , %UCS2, %UNS, or %UNSH | ||||||
| Multiplicand | MULT (h) | Multiplier | Product | + | - | Z |
| (not allowed - use the * or *= operator) | ||||||
| MVR | Remainder | + | - | Z | ||
| (not allowed - use the %REM built-in function) | ||||||
| program-device | NEXT (e) | file-name | ER | |||
| NEXT{(E)} program-device file-name | ||||||
| Occurrence value | OCCUR (e) | Data structure | Occurrence value | ER | ||
| (not allowed - use the %OCCUR built-in function) | ||||||
| ON-ERROR | List of exception IDs | |||||
| ON-ERROR {exception-id1 {:exception-id2...}} | ||||||
| OPEN (e) | file-name | ER | ||||
| OPEN{(E)} file-name | ||||||
| Comparand | ORxx | Comparand | ||||
| (not allowed - use the OR operator) | ||||||
| OTHER | ||||||
| OTHER | ||||||
| *LOCK | OUT (e) | data-area-name | ER | |||
| OUT{(E)} {*LOCK} data-area-name | ||||||
| Target field | PARM | Source field | Parameter | |||
| (not allowed - use Prototypes and Parameters and CALLP) | ||||||
| PLIST name | PLIST | |||||
| (not allowed - use Prototypes and Parameters and CALLP) | ||||||
| program-device | POST (e) | file-name | INFDS name | ER | ||
| POST{(E)} {program-device} file-name | ||||||
| READ (e n) | name (file or record format) | data-structure | ER | EOF | ||
| READ{(EN)} name {data-structure} | ||||||
| READC (e) | record-name | data structure | ER | EOF | ||
| READC{(E)} record-name {data-structure} | ||||||
| search-arg | READE (e n) | name (file or record format) | data-structure | ER | EOF | |
| READE{(ENHMR)} search-arg|*KEY name {data-structure} | ||||||
| READP (e n) | name (file or record format) | data-structure | ER | BOF | ||
| READP{(EN)} name {data-structure} | ||||||
| search-arg | READPE(e n) | name (file or record format) | data-structure | ER | BOF | |
| READPE{(ENHMR)} search-arg|*KEY name {data-structure} | ||||||
| REALLOC (e) | Length | Pointer | ER | |||
| (not allowed - use the %REALLOC built-in function) | ||||||
| program-device | REL (e) | file-name | ER | |||
| REL{(E)} program-device file-name Code | ||||||
| *NOKEY | RESET (e) | *ALL | name (variable or record format) | ER | ||
| RESET{(E)} {*NOKEY} {*ALL} name Code | ||||||
| RETURN (H M/R) | expression | |||||
| RETURN{(HMR)} expression | ||||||
| ROLBK (e) | ER | |||||
| ROLBK{(E)} | ||||||
| Comparator string:length | SCAN (e) | Base string:start | Left-most position | ER | FD | |
| (not allowed - use the %SCAN built-in function) | ||||||
| SELECT | ||||||
| SELECT | ||||||
| search-arg | SETGT (e) | name (file or record format) | NR | ER | ||
| SETGT{(EHMR)} search-arg name | ||||||
| search-arg | SETLL (e) | name (file or record format) | NR | ER | EQ | |
| SETLL{(EHMR)} search-arg name | ||||||
| SETOFF | OF | OF | OF | |||
| (not allowed - use EVAL *INxx = *OFF) | ||||||
| SETON | ON | ON | ON | |||
| (not allowed - use EVAL *INxx = *ON) | ||||||
| SHTDN | ON | |||||
| (not allowed - use the %SHUT built-in function) | ||||||
| SORTA | Array or %SUBARR(Array : start-element {:number-of-elements} ) | |||||
| SORTA array-name or SORTA %SUBARR(array-name : start-element { : number-of-elements }) | ||||||
| SQRT (h) | Value | Root | ||||
| (not allowed - use the %SQRT built-in function) | ||||||
| Minuend | SUB (h) | Subtrahend | Difference | + | - | Z |
| (not allowed - use the - or -= operators) | ||||||
| Date/Time/Timestamp | SUBDUR (e) (duration) | Date/Time/Timestamp | Duration:Duration Code | ER | ||
| not allowed - use the - or -= operators with duration functions such as %YEARS and %MONTHS, or the %DIFF built-in function) | ||||||
| Date/Time/Timestamp | SUBDUR (e) (new date) | Duration:Duration Code | Date/Time/Timestamp | ER | ||
| not allowed - use the - or -= operators with duration functions such as %YEARS and %MONTHS, or the %DIFF built-in function) | ||||||
| Length to extract | SUBST (e p) | Base string:start | Target string | ER | ||
| (not allowed - use %SUBST) | ||||||
| label | TAG | |||||
| (not allowed - use other operation codes, such as LEAVE, ITER, and RETURN) | ||||||
| TEST (e) | Date/Time/Timestamp Field | ER | ||||
| TEST{(EDTZ)} {dtz-format} field-name | ||||||
| Date Format | TEST (D E) | Character or Numeric field | ER | |||
| TEST{(EDTZ)} {dtz-format} field-name | ||||||
| Time Format | TEST (E T) | Character or Numeric field | ER | |||
| TEST{(EDTZ)} {dtz-format} field-name | ||||||
| Timestamp Format | TEST (E Z) | Character or Numeric field | ER | |||
| TEST{(EDTZ)} {dtz-format} field-name | ||||||
| TESTB | Bit numbers | Character field | OF | ON | EQ | |
| (not allowed - use the %BITAND built-in function.) | ||||||
| TESTN | Character field | NU | BN | BL | ||
| (not allowed - rather than testing the variable before using it, code the usage of the variable in a MONITOR group and handle any errors with ON-ERROR.) | ||||||
| TESTZ | Character field | AI | JR | XX | ||
| (not allowed - use the %BITAND built-in function to isolate the zone part of the character) | ||||||
| TIME | Target field | |||||
| (not allowed – use the %DATE, %TIME, and %TIMESTAMP built-in functions) | ||||||
| UNLOCK (e) | name (file or data area) | ER | ||||
| UNLOCK{(E)} name | ||||||
| UPDATE (e) | name (file or record format) | data-structure | ER | |||
| UPDATE{(E)} name {data-structure | %FIELDS(name{:name...})} | ||||||
| WHEN (m/r) | indicator-expression | |||||
| WHEN{(MR)} indicator-expression | ||||||
| Comparand | WHENxx (WHxx) | Comparand | ||||
| (not allowed - use the WHENoperation code) | ||||||
| WRITE (e) | name (file or record format) | data-structure | ER | EOF | ||
| WRITE{(E)} name {data-structure} | ||||||
| XFOOT (h) | Array name | Sum | + | - | Z | |
| (not allowed - use the %XFOOT built-in function) | ||||||
| From:To | XLATE (e p) | Source-String:start | Target String | ER | ||
| (not allowed - use the %XLATE built-in function) | ||||||
| XML-INTO | receiver %XML(xmlDoc {: options }) | |||||
| XML-INTO{(EH)} receiver %XML(xmlDoc {: options }); | ||||||
| XML-INTO | %HANDLER(handlerProc : commArea) %XML(xmlDoc {: options }) | |||||
| XML-INTO{(EH)} %HANDLER(handlerProc : commArea) %XML(xmlDoc {: options }); | ||||||
| XML-SAX{(E)} | %HANDLER(handlerProc : commArea) %XML(xmlDoc {: options }) | |||||
| XML-SAX{(E)} %HANDLER(handlerProc : commArea) %XML(xmlDoc {: options }); | ||||||
| Z-ADD (h) | Addend | Sum | + | - | Z | |
| (not allowed - use the EVAL operation code) | ||||||
| Z-SUB (h) | Subtrahend | Difference | + | - | Z | |
| (not allowed - use the EVAL operation code) | ||||||
Notice: The information on this site is intended as an aid to memory and not a complete, exhaustive reference. For the reference see the cited manual [1]. This site has been carefully checked but is not guaranteed to be accurate.
