Writing Virtual Field Derivation Code

Before attempting to write any virtual field derivation code several things should be understood:

When virtual field derivation code is to be input it must be input into one (or more) of the following "sections" of the file I/O module:

I/O Module Code Section

Allowable RPG Type

File specifications

"F" specs

Array specifications

"E" specs

External record format or field renames

"I" specs

Data structure specifications

"I" specs

Calculations after input from file

"C" specs

Calculations before output to file

"C" specs

Internal subroutines

"C" specs

Output specifications

"O" specs

Compile time array data

N/Applicable

 

In addition, certain restrictions and considerations must be followed to ensure that the virtual field derivation code will compile and work correctly: