Previous Topic: Moving Data to Construct Key values

Next Topic: Data Placement Chart

When and Where does CA-Datamacs/II Place Data?

When a field is moved it must be identified by its elementary (simple) field name and must be qualified as to its buffer location. See the MOVE command in the command section of this document for an explanation of the syntax. Compound or group level names are not supported.

READ, SCAN, EQUI-JOIN

For any database retrieval command (for example, READ, SCAN, EQUI-JOIN) and any CA-Datamacs/II DATACOM function the data returned from CA-Datamacs/II is placed in a unique 'input buffer'; one per table. For a LOCATE command with a partial key, the additional keys returned are placed in a unique key value area; one pair per table.

Automatic LOAD Function

A record is read from the input DMIFILE and automatically placed in the output buffer. Any field generators will be applied to the output buffer and the record will be automatically added. No user coded commands are allowed in the automatic load.

Manual Load

For a manual LOAD, a record is read from the DMIFILE input file, the table name is matched to all paragraph names coded and, if an equal match is found, the record is moved to the output buffer and any field generators are applied. It is at this time that any commands coded in the paragraph are executed. If an ADDIT is coded, the record will be placed in the database. If no paragraph name match is made, the input DMIFILE record is bypassed and the next one is automatically read.

Create Function

Whenever a paragraph name equal to a table name is PERFORM'd, the field generator process will fill the output buffer. Any MOVE and database access commands coded in the paragraph will then be executed.

For example:

Prior to adding the contents of the output buffer to the database, it may be desirable to see if certain keys exist in other tables. This can be accomplished by coding a MOVE to transfer the contents of a field located in the output buffer to a key value area of the same or a different table. Coding a READ command would then read or optionally locate (index-only) the key.

UNLOAD function (WRITE)

Any database retrieval command will place the data in the corresponding table input buffer, at which time the data in any of the fields can be moved to a key value area for another database retrieval.

When the WRITE command is executed, it will take its data from the input buffer of the named table and output it to the intermediate (DCOMOUT) work file to be used in a subsequent load.

MODIFY function (DELETE, UPDATE)

The MODIFY function requires exclusive control on the database record. A READ or SCAN command with the HOLD option must be specified prior to issuing a DELETE or UPDATE command. The READ or SCAN command will place the data returned from CA -DATACOM/DB CA-DATACOM/DB in the table-owned input buffer. The DELETE or UPDATE command will move the data in the input buffer to the common output buffer. Any field generators will be applied to the output buffer and the record will be updated or deleted.