Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
IBM RPG II
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== RPGII specifications == In the [[System/36]] implementation of RPG II, there are eight different specification (spec) types, that is a fixed-format line of text, 80 characters (bytes) in length, derived from the original use of [[punched card]] input for earlier IBM systems, like the [[System/3]]. Like specifications were grouped together, and each type was required to be in a specific order: ''U'', ''T'', ''H'', ''F'', ''E'', ''L'', ''I'', ''C'' AND ''O''. ''Specification'' codes appear in column 6 of an RPG-II specification: {| class="wikitable sortable" border="1" |- ! Specification code ! Name |- | U || Auto Report spec is only required for Auto Report programs. |- | T || Telecommunications. This ninth specification was added later in 1977:<ref name="compilerspecs">[https://archive.org/details/bitsavers_ibmsystem3rsSpecificationsNov77_499431 "IBM System/3 Model 8, Model 10, Model 12, and Model 15 RPG II Compilers"], IBM Program Product Specifications, November 1977, p. 3</ref> |- | H || Header spec is at the top of the program and describes compiler options such as maximum compile size, whether the program is an MRT (Multiple Requestor Terminal) program, and what type of listing is generated when the program is compiled. The object name of the program created is located in columns 75–80; if a source does not have an H spec, the name RPGOBJ is used. |- | F || File spec(s) are next, and describes the files used in the program. Files may be disk files (DISK) or may be devices such as a printer (PRINTER), the workstation (WORKSTN), keyboard (KEYBORD), unformatted display (CRT or DISPLAY), or user-defined (SPECIAL). Record size, block size, overflow indicators, and external indicators are described. It is possible that an RPG program will not use any F specs. |- | E || Extension spec(s) are next, and describe arrays and tables, which may be prefetched from disk files (an Input table), drawn from constants placed at the end of the source between ** and /* symbols, or built from calculations. |- | L || Line Counter spec(s) are next, and if present, describe the form to be printed. It defines the number of lines in a page and the positions where printing begins and ends. |- | I || Input specs are next, and describe the data areas within files. RPG II permits redefinition of data areas so that a field named FLDA might occupy the same area as an array AR that contains 8 elements of 1 character each. Non-record areas such as data structures can be described. Depending on the values of the input record, indicators may be conditioned. |- | C || Calculation spec(s) are next. Total fields may be described and accumulated. Complex computations and string manipulations are possible. Indicators may be conditioned. |- | O || Output specifications, which describe the output record in terms of fields and output positions. |} ''Operation codes'' appear in columns 28–32 of an RPG-II calculation specification. {| class="wikitable sortable" border="1" |- ! Operation code ! Name |- | ADD | Add |- | SUB | Subtract |- | MULT | Multiply |- | DIV | Divide |- | Z-ADD | Zero and Add |- | Z-SUB | Zero and Subtract |- | MVR | Move Remainder |- | MOVE | Move |- | MOVEL | Move Left |- | MHLZO | Move High to Low Zone |- | MLHZO | Move Low to High Zone |- | MLLZO | Move Low to Low Zone |- | MHHZO | Move High to High Zone |- | BITON | Bit On |- | BITOF | Bit Off |- | TESTB | Test Bit |- | GOTO | Go To |- | TAG | Tag (destination of a GOTO) |- | EXSR | Execute Subroutine |- | BEGSR | Begin Subroutine |- | ENDSR | End Subroutine |- | SETON | Set On |- | SETOF | Set Off |- | EXCPT | Exception |- | EXIT | Exit |- | RLABL | Redefine Label |- | ULABL | User Label |- | CALL<sup>1</sup> | Call |- | PARM<sup>1</sup> | Parameter |- | CHAIN | Chain |- | READ | Read |- | READE | Read Equal |- | READP | Read Previous |- | REDPE | Read Previous Equal |- | SETLL | Set Lower Limits |- | SET | Set |- | TIME | Time of day (000000-235959) |- | DSPLY | Display |- | SORTA | Sort Array |- | XFOOT | Crossfoot |- | MOVEA | Move Array |- | LOKUP | Lookup (find in array) |} # CALL/PARM was added to RPG II with Release 6.0 (also known as the VASP). CHAIN retrieves the record in the indexed file named in Factor 2 that matches the exact key specified by the value in Factor 1. SETLL causes the index pointer for the file named in Factor 2 to be positioned at the location specified by the value in Factor 1. SORTA causes the named array to be sorted in place; that is, the elements appear in order. Z-SUB calculates Factor 2 with opposite sign and moved to result field. XFOOT causes an array to be summed and the result moved to result field. MVR must follow a DIV operation. The integer remainder of the DIV operation is placed in the result field. MVR following the DIV operation for "56 divided by 3" would place the value 2 in the result field.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)