RPG Opcodes
Arithmetic Opcodes
i.
ADD
ii.
SUB
iii.
MULT
iv.
SQRT
v.
DIV
vi.
MVR
vii.
Z-ADD
viii.
Z-SUB
String Opcodes
ix.
MOVE
x.
MOVEL
xi.
CHECK
xii.
CHEKR
xiii.
CHECKR (ILE)
xiv.
CAT
xv.
SCAN
xvi.
SUBST
xvii.
XLATE
Data Base File
Operation Opcodes
xviii.
READ
xix.
READE
xx.
READP
xxi.
READPE
xxii.
CHAIN
xxiii.
WRITE
xxiv.
DELET (E)
xxv.
UPDAT (E)
xxvi.
SETLL
xxvii.
SETGT
Display/Subfile File
Opcodes
xxviii.
EXFMT
xxix.
CLEAR
xxx.
RESET
xxxi.
READC
Array Related Opcodes
xxxi.
XFOOT
xxxii.
MOVEA
xxxiii.
SORTA
xxxiv.
LOKUP
xxxv.
LOOKUP (ILE)
xxxvi.
DEFN
xxxvii.
DEFINE
Structured RPG Opcodes
xxxvi. DO
xxxvii.
DOWxx
xxxviii.
DOUxx
xxxix.
IFxx
xl. ELSE
xli. ANDxx
xlii. ORxx
xliii. SELEC(T)
xliv. WHxx
xlv. WHENxx
xlvi. OTHER
xlvii.
ENDxx
Others
xxxvi.
CALL
xxxvii.
PARM
xxxviii.
PLIST
xxxix.
KLIST
xl.
KFLD
xli.
EXSR
xlii.
BEGSR
xliii.
ENDSR
xliv.
COMP
xlv.
CASxx
xlvi.
CAB
xlvii.
ENDCS
xlviii.
SETON
xlix.
SETOF (F)
l. EXCEP (T)
li.
EVAL
lii.
TEST
liii. TESTN
liv.
TESTZ
lv.
ADDDUR
lvi. SUBDUR
lvii.
EXTRCT
lviii.
GOTO
lix. RETRN
lx.
RETURN (ILE)
lxi.
LEAVE
lxii.
ITER
lxiii.
TIME ( )
lxiv.
OCCUR
FACTOR 1 OPCODE FACTOR
2 RESULT INDICATOR
The following Opcodes should be of the mentioned format.
1. XXXX
CHAIN YYYY
IF (%FOUND)
MOVE BAS VAR1
IF NOT % FOUND
MOVEL BAS VAR1
ENDIF
ENDIF
2. VAR1 DIV VAR2 VAR3
3.
MVR VAR1
4.
Z-ADD VAR1 VAR2
5.
MOVE VAR2 VAR3
6.
SQRT VAR1 FLD1
7. *LIKE DEFINE FLD1 FLD2
{FLD
1 is already defined field FLD 2 is the field to be defined with the attribute
of FLD 1}
8. FLD1 COMP FLD2 304050
9. GOTO TAGNAM
10.
TAGNAM TAG
11.
FLD1 CABxx FLD2 (optional)
12. Optional DO Optional
13.
EXCEPT Recfmt
14. SRNAM BEGSR
15. FLD 1 CASGT FLD 2 SRNAM
16. CALL ‘PGM’
17. CALL ‘PGM’ LSTNAM
18.
LSTNAM PLIST
19. *ENTRY PLIST
20. PARM PARAMETER
21. FLD 1 CAT FLD 2 FLD
22. *NAMVAR DEFINE DTAARANAM
23. *NAMVAR DEFINE DTAARANAM D.S.NAM
(General
DS)
24. *LOCK (Opt) IN DTAARANAM
25. OUT DTAARANAM
26. UNLOCK DTAARANAM
HiLoEq
27. VAR/ELEM LOOKUP ARAYNAM 70
28.
70 VAR/ELEM LOOKUP ARAYNAM 40
29 XFOOT ARYNAM FLDx
30. MOVEA ARY1, 5 ARY2,
9
31. SORTA ARY1
32. ‘AB’ SCAN ‘MNBABS’ FLDy (Eq
Lo is option)
Check matching character (Found
error Seton)
33. FLD1 SCAN FLD2 FLDx ’’
’’
(FLDx,y
contain the position value in numeric)
34. 5 SUBST VAR1: 3 FLD2
VAR1=TIRUMALAI
(Moves ‘RUMAL’ to FLD2)
35. ‘AB’ CHECK
FLD1 FLDx ” ”
Check non matching
character
A logical file is a database file that describes
how data records contained in one or
more physical files are presented to a program.
The logical file does not contain data
records.
No comments