Position 20 (File Addition)

Position 20 indicates whether records are to be added to an input or update file. For output files, this entry is ignored. This entry must be blank if the LIKEFILE keyword is specified.

Entry
Explanation
Blank
No records can be added to an input or update file (I or U in position 17).
A
Records are added to an input or update file when positions 18 through 20 of the output record specifications for the file contain "ADD", or when the WRITE operation code is used in the calculation specification.

See Table 46 for the relationship between position 17 and position 20 of the file description specifications and positions 18 through 20 of the output specifications.

Table 46. Processing Functions for Files
Function Specification
File Description Output
Position 17 Position 20 Positions 18-20
Create new file1
or
Add records to existing file
O
O
Blank
A
Blank
ADD
Process file I Blank Blank
Process file and add records to the existing file I A ADD
Process file and update the records (update or delete) U Blank Blank
Process file and add new records to an existing file U A ADD
Process file and delete an existing record from the file U Blank DEL
Note:
Within RPG, the term create a new file means to add records to a newly created file. Thus, the first two entries in this table perform the identical function. Both are listed to show that there are two ways to specify that function.


[ Top of Page | Previous Page | Next Page | Contents | Index ]