Chapter 6: Program Organization


OVERVIEW

The procedure specification is used to name and delineate RPG subprocedures. See chapter 2 for more information on all RPG IV specifications. Zero or more subprocedures can be included in a source file. The term source file, as used in this text, refers to a single container of RPG source. It relates directly to an AS/400 source file member or to a plain ASCII text file on another computer operating system. When a source file is compiled, an object of type *MODULE is created. A machine-readable RPG program is created by linking (referred to as program binding) one or more modules.

Machine-readable RPG IV programs consist of one or more mainline procedures and zero or more subprocedures. The mainline procedure is the entry point of an RPG program. It is the area traditionally referred to as the mainline calculations, but also includes the file, input, definition, and output specifications. The mainline procedure is the same as the program name. Hence, when an RPG program is called, the mainline procedure is being evoked.

Subprocedures are isolated by beginning and ending procedure specifications. These subprocedures can be called through the CALLP or CALLB operations. In addition, when a procedure is prototyped, it is also considered a function, and can be evoked similarly to RPG built-in functions.




The Modern RPG IV Language
The Modern RPG IV Language
ISBN: 1583470646
EAN: 2147483647
Year: 2003
Pages: 156
Authors: Robert Cozzi

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net