
RPG
-
RPG/400 is a programming language designed to make it easier to create business software
-
A language under evolution
-
Used for development of Batch and On-line programs
-
Is a fixed format (position dependent) language, unlike C, specifications need to be entered into specific columns - SEU prompts for entering these specifications
Valid character set consists of
-
Letters A-Z
-
Numbers 0-9
-
Characters + - * , . ‘ & / $ # : @
-
Blank character
Directives
-
Compiler directive statements /TITLE, /EJECT, /SPACE, and /COPY
-
Allow a programmer to
specify heading information to appear at top of each page of compiler listing
indicate that subsequent specifications are to begin on a new page of compiler listing
control line spacing within compiler listing, and
insert records from other file members during a compile, at the point where the /COPY occurs
-
/TITLE (Positions 7-12)
-
/EJECT (Positions 7-12)
-
/SPACE (Positions 7-12)
-
/COPY (Positions 7-11)
Note : For complete syntax refer RPG/400 Reference
Symbolic Names
-
A name that uniquely identifies a specific entity in a program
-
Common rules, exceptions may occur for different symbolic names
-
First character of the name must alphabetic, including $, #, and @, remaining can be any listed in the character set and must be left-adjusted
-
Blanks can fill out the entry but not to be embedded in the name
-
Cannot be a RPG/400 reserve word
-
Can be 1-6 characters long, and must be unique
Symbolic names can be assigned to entities as
-
Arrays
-
Constants
-
Data Structure
-
EXCPTs (exception output records)
-
Fields
-
Files
-
Subroutines
-
Tables
-
KLISTs (key field lists)
-
Labels
-
Named constants
-
PLISTs (parameter lists)
-
Record names
-
Subfields