Product Documentation

FairCom RTG COBOL Edition User's Guide

Previous Topic

Next Topic

Appending Indices to Existing Files from the RTG FSI Interface (ACUCOBOL)

If the MAKE function of the RTG FSI interface is called with the l_param parameter having both maxlen and minlen set to 0, the MAKE operation appends the specified new indices to the specified file instead of creating the file. The specified key definitions must include both the new and existing indices. The specified number of keys must be the sum of the new and existing keys. The operation fails if the existing indices do not match the specified key definitions.

In an ACUCOBOL application, it is possible use the I$IO routine to call the MAKE function with zero maxlen/minlen. For instance:

SET MAKE-FUNCTION TO true

MOVE 0 TO MIN-REC-SIZE MAX-REC-SIZE

MOVE 2 TO NUM-KEYS

MOVE SPACES TO KEY-INFO

MOVE "1,0,4,0,1,0,4,4" TO KEY-INFO

INSPECT KEY-INFO REPLACING TRAILING spaces BY low-value

CALL "I$IO" USING IO-FUNCTION filename 0 PHYSICAL-INFO LOGICAL-INFO KEY-INFO

TOCIndex