Operation Codes
Operation Codes
Operation Codes
The following table shows the free-form syntax for each operation code.
-
Extenders
(A) : Always perform a dump, even if DEBUG(*NO) is specified
(A) : Sort ascending
(C) : Only handle exceptions sent to the current procedure for ON-EXCP
(D) : Pass operational descriptors on bound call
(D) : Date field
(D) : Sort descending
(E) : Error handling
(H) : Half adjust (round the numeric result)
(M) : Default precision rules
(N) : Do not lock record
(N) : Set pointer to *NULL after successful DEALLOC
(N) : Do not force data to non-volatile storage
(P) : Pad the result with blanks or zeros
(R) : “Result Decimal Position” precision rules
(T) : Time field
(Z) : Timestamp field
Table 1. Operation Codes in Free-Form Syntax
| Code | Free-Form Syntax |
|---|---|
| ACQ1 | ACQ{(E)} device-name workstn-file |
| BEGSR | BEGSR subroutine-name |
| CALLP | {CALLP{(EMR)}} name( {parm1{:parm2…}} ) |
| CHAIN | CHAIN{(ENHMR)} search-arg file-or-record-name {data-structure} |
| CLEAR | CLEAR {*NOKEY} {*ALL} name |
| CLOSE | CLOSE{(E)} file-name |
| COMMIT | COMMIT{(E)} {boundary} |
| DATA-GEN | DATA-GEN{(EH)} source document parser |
| DATA-INTO | DATA-INTO{(EH)} target-or-handler document parser |
| DEALLOC 1 | DEALLOC{(EN)} pointer-name |
| DELETE | DELETE{(EHMR)} {search-arg} file-or-record-name |
| DOU | DOU{(MR)} indicator-expression |
| DOW | DOW{(MR)} indicator-expression |
| DSPLY | DSPLY{(E)} {message {message-queue {response}}} |
| DUMP1 | DUMP{(A)} {identifier} |
| ELSE | ELSE |
| ELSEIF | ELSEIF{(MR)} indicator-expression |
| ENDDO | ENDDO |
| ENDFOR | ENDFOR |
| ENDIF | ENDIF |
| ENDMON | ENDMON |
| ENDSL | ENDSL |
| ENDSR | ENDSR {return-point} |
| EVAL | {EVAL{(HMR)}} result = expression |
| EVALR | EVALR{(MR)} result = expression |
| EVAL-CORR | EVAL-CORR{(EH)} target-ds = source-ds |
| EXCEPT | EXCEPT {except-name} |
| EXFMT | EXFMT{(E)} format-name {data-structure} |
| EXSR | EXSR subroutine-name |
| FEOD | FEOD{(EN)} file-name |
| FOR | FOR{(MR)} index {= start} {BY increment} {TO |
| FOR-EACH | FOR-EACH{(H)} item IN array |
| FORCE | FORCE file-name |
| IF | IF{(MR)} indicator-expression |
| IN 1 | IN{(E)} {*LOCK} data-area-name |
| ITER | ITER |
| LEAVE | LEAVE |
| LEAVESR | LEAVESR |
| MONITOR | MONITOR |
| NEXT1 | NEXT{(E)} program-device file-name |
| ON-ERROR | ON-ERROR {exception-id1 {:exception-id2 …}} |
| ON-EXIT | ON-EXIT {status} |
| OPEN | OPEN{(E)} file-name |
| OTHER | OTHER |
| OUT1 | OUT{(E)} {*LOCK} data-area-name |
| POST 1 | POST{(E)} {program-device} file-name |
| READ | READ{(EN)} file-or-record-name {data-structure} |
| READC | READC{(E)} record-name {data-structure} |
| READE | READE{(ENHMR)} search-arg |
| READP | READP{(EN)} name {data-structure} |
| READPE | READPE{(ENHMR)} search-arg |
| REL 1 | REL{(E)} program-device file-name |
| RESET 1 | RESET{(E)} {*NOKEY} {*ALL} name |
| RETURN | RETURN{(HMR)} expression |
| ROLBK | ROLBK{(E)} |
| SELECT | SELECT |
| SETGT | SETGT{(EHMR)} search-arg file-or-record-name |
| SETLL | SETLL{(EHMR)} search-arg file-or-record-name |
| SORTA | SORTA{(AD)} array-name or keyed-ds-array |
| TEST 1 | TEST{(EDTZ)} {dtz-format} field-name |
| UNLOCK 1 | UNLOCK{(E)} name |
| UPDATE | UPDATE{(E)} file-or-record-name {data-structure |
| WHEN | WHEN{(MR)} indicator-expression |
| WRITE | WRITE{(E)} file-or-record-name {data-structure} |
| XML-INTO | XML-INTO{(EH)} target-or-handler xml-document |
| XML-SAX | XML-SAX{(E)} handler xml-document |
Note:
- Complex-qualified names are not allowed for this operation code.
The next table is a summary of the specifications for each operation code in traditional syntax.
-
An empty column indicates that the field must be blank.
-
All underlined fields are required.
-
An underscored space denotes that there is no resulting indicator in that position.
-
Symbols
: Plus
: Minus
-
Extenders
(A) : Always perform a dump, even if DEBUG(*NO) is specified
(A) : Sort ascending
(D) : Pass operational descriptors on bound call
(D) : Date field
(D) : Sort descending
(E) : Error handling
(H) : Half adjust (round the numeric result)
(M) : Default precision rules
(N) : Do not lock record
(N) : Set pointer to *NULL after successful DEALLOC
(P) : Pad the result with blanks or zeros
(R) : “Result Decimal Position” precision rules
(T) : Time field
(Z) : Timestamp field
-
Resulting indicator symbols
BL : Blank(s)
BN : Blank(s) then numeric
BOF : Beginning of the file
EOF : End of the file
EQ : Equal
ER : Error
FD : Found
HI : Greater than
IN : Indicator
LO : Less than
LR : Last record
NR : No record was found
NU : Numeric
OF : Off
ON : On
Z : Zero
ZB : Zero or Blank
Table 2. Operation Codes in Traditional Syntax
| Codes | Factor 1 | Factor 2 | Result Field | Resulting Indicators | ||
|---|---|---|---|---|---|---|
| 71-72 | 73-74 | 75-76 | ||||
| ACQ (E7) | device-name | workstn-file | ER | |||
| ADD (H) | Addend | Addend | Sum | + | - | Z |
| ADDDUR (E) | Date/Time | Duration:Duration Code | Date/Time | ER | ||
| ALLOC (E) | Length | Pointer | ER | |||
| ANDxx | Comparand | Comparand | ||||
| BEGSR | subroutine-name | |||||
| BITOFF | Bit numbers | Character field | ||||
| BITON | Bit numbers | Character field | ||||
| CABxx | Comparand | Comparand | Label | HI | LO | EQ |
| CALL (E) | Program name | Plist name | ER | LR | ||
| CALLB (D E) | Procedure name or Procedure pointer | Plist name | ER | LR | ||
| CALLP (E M/R) | name{ (parm1 {:parm2 …}) } | |||||
| CASxx | Comparand | Comparand | Subroutine name | HI | LO | EQ |
| CAT (P) | Source string 1 | Source string 2:number of blanks | Target string | |||
| CHAIN (E N) | search-arg | name (file or record format) | data-structure | NR2 | ER | |
| CHECK (E) | Comparator String | Base String:start | Left-most Position(s) | ER | FD2 | |
| CHECKR (E) | Comparator String | Base String:start | Right-most Position(s) | ER | FD2 | |
| CLEAR | *NOKEY | *ALL | name (variable or record format) | |||
| CLOSE (E) | file-name or *ALL | ER | ||||
| COMMIT (E) | boundary | ER | ||||
| COMP1 | Comparand | Comparand | HI | LO | EQ | |
| DEALLOC (E/N) | pointer-name | ER | ||||
| DEFINE | *LIKE | Referenced field | Defined field | |||
| DEFINE | *DTAARA | External data area | Internal field | |||
| DELETE (E) | search-arg | name (file or record format) | NR2 | ER | ||
| DIV (H) | Dividend | Divisor | Quotient | + | - | Z |
| DO | Starting value | Limit value | Index value | |||
| DOU (M/R) | indicator-expression | |||||
| DOUxx | Comparand | Comparand | ||||
| DOW (M/R) | indicator-expression | |||||
| DOWxx | Comparand | Comparand | ||||
| DSPLY (E)4 | message | message-queue | response | ER | ||
| DUMP (A) | identifier | |||||
| ELSE | ||||||
| ELSEIF (M/R) | indicator-expression | |||||
| END | Increment value | |||||
| ENDCS | ||||||
| ENDDO | Increment value | |||||
| ENDFOR | ||||||
| ENDIF | ||||||
| ENDMON | ||||||
| ENDSL | ||||||
| ENDSR | label | return-point | ||||
| EVAL (H M/R) | Result = Expression | |||||
| EVALR (M/R) | Result = Expression | |||||
| EVAL-CORR | EVAL-CORR target-ds = source-ds | |||||
| EXCEPT | except-name | |||||
| EXFMT (E) | Record format-name | data-structure | ER | |||
| EXSR | subroutine-name | |||||
| EXTRCT (E) | Date/Time:Duration Code | Target Field | ER | |||
| FEOD (EN) | file-name | ER | ||||
| FOR | Index-name = start-value BY increment TO | DOWNTO limit | ||||
| FORCE | file-name | |||||
| GOTO | Label | |||||
| IF (M/R) | indicator-expression | |||||
| IFxx | Comparand | Comparand | ||||
| IN (E) | *LOCK | data-area-name | ER | |||
| ITER | ||||||
| KFLD | Key field | |||||
| KLIST | KLIST name | |||||
| LEAVE | ||||||
| LEAVESR | ||||||
| LOOKUP1 (array) | Search argument | Array name | HI | LO | EQ6 | |
| LOOKUP1 (table) | Search argument | Table name | Table name | HI | LO | EQ6 |
| MHHZO | Source field | Target field | ||||
| MHLZO | Source field | Target field | ||||
| MLHZO | Source field | Target field | ||||
| MLLZO | Source field | Target field | ||||
| MONITOR | ||||||
| MOVE (P) | Data Attributes | Source field | Target field | + | - | ZB |
| MOVEA (P) | Source | Target | + | - | ZB | |
| MOVEL (P) | Data Attributes | Source field | Target field | + | - | ZB |
| MULT (H) | Multiplicand | Multiplier | Product | + | - | Z |
| MVR | Remainder | + | - | Z | ||
| NEXT (E) | program-device | file-name | ER | |||
| OCCUR (E) | Occurrence value | Data structure | Occurrence value | ER | ||
| ON-ERROR | Status codes | |||||
| ON-EXIT | Status | |||||
| OPEN (E) | file-name | ER | ||||
| ORxx | Comparand | Comparand | ||||
| OTHER | ||||||
| OUT (E) | *LOCK | data-area-name | ER | |||
| PARM | Target field | Source field | Parameter | |||
| PLIST | PLIST name | |||||
| POST (E)3 | program-device | file-name | INFDS name | ER | ||
| READ (E N) | name (file or record format) | data- structure | ER | EOF5 | ||
| READC (E) | record-name | data- structure | ER | EOF5 | ||
| READE (E N) | search-arg | name (file or record format) | data- structure | ER | EOF5 | |
| READP (E N) | name (file or record format) | data- structure | ER | BOF5 | ||
| READPE (E N) | search-arg | name (file or record format) | data- structure | ER | BOF5 | |
| REALLOC (E) | Length | Pointer | ER | |||
| REL (E) | program-device | file-name | ER | |||
| RESET (E) | *NOKEY | *ALL | name (variable or record format) | ER | ||
| RETURN (H M/R) | Expression | |||||
| ROLBK (E) | ER | |||||
| SCAN (E) | Comparator string:length | Base string:start | Left-most position(s) | ER | FD2 | |
| SELECT | ||||||
| SETGT (E) | search-arg | name (file or record format) | NR2 | ER | ||
| SETLL (E) | search-arg | name (file or record format) | NR2 | ER | EQ6 | |
| SETOFF1 | OF | OF | OF | |||
| SETON1 | ON | ON | ON | |||
| SHTDN | ON | |||||
| SORTA (A/D) | array-name or keyed-ds-array | |||||
| SQRT (H) | Value | Root | ||||
| SUB (H) | Minuend | Subtrahend | Difference | + | - | Z |
| SUBDUR (E) (duration) | Date/Time/ Timestamp | Date/Time/Timestamp | Duration: Duration Code | ER | ||
| SUBDUR (E) (new date) | Date/Time/ Timestamp | Duration:Duration Code | Date/Time/ Timestamp | ER | ||
| SUBST (E P) | Length to extract | Base string:start | Target string | ER | ||
| TAG | Label | |||||
| TEST (E)8 | Date/Time or Timestamp Field | ER | ||||
| TEST (D E)8 | Date Format | Character or Numeric field | ER | |||
| TEST (E T)8 | Time Format | Character or Numeric field | ER | |||
| TEST (E Z)8 | Timestamp Format | Character or Numeric field | ER | |||
| TESTB1 | Bit numbers | Character field | OF | ON | EQ | |
| TESTN1 | Character field | NU | BN | BL | ||
| TESTZ1 | Character field | AI | JR | XX | ||
| TIME | Target field | |||||
| UNLOCK (E) | name (file or data area) | ER | ||||
| UPDATE (E) | name (file or record format) | data- structure | ER | |||
| WHEN (M/R) | indicator-expression | |||||
| WHENxx | Comparand | Comparand | ||||
| WRITE (E) | name (file or record format) | data- structure | ER | EOF5 | ||
| XFOOT (H) | Array name | Sum | + | - | Z | |
| XLATE (E P) | From:To | String:start | Target String | ER | ||
| XML-INTO | XML-INTO target-or-handler xml-document | |||||
| XML-SAX | XML-SAX{(E)} handler xml-document | |||||
| Z-ADD (H) | Addend | Sum | + | - | Z | |
| Z-SUB (H) | Subtrahend | Difference | + | - | Z | |
| Note: 1. At least one resulting indicator is required. 2. The %FOUND built-in function can be used as an alternative to specifying an NR or FD resulting indicator. 3. You must specify factor 2 or the result field. You may specify both. 4. You must specify factor 1 or the result field. You may specify both. 5. The %EOF built-in function can be used as an alternative to specifying an EOF or BOF resulting indicator. 6. The %EQUAL built-in function can be used to test the SETLL and LOOKUP operations. 7. For all operation codes with extender ‘E’, either the extender ‘E’ or an ER error indicator can be specified, but not both. 8. You must specify the extender ‘E’ or an error indicator for the TEST operation. |