Previous Topic: Organizing Input Data for a User-Written ProgramNext Topic: More Information


Loading the Database

To load a database for the first time using a user-written program, follow these steps:

Action

Statement

Write and compile a load program that specifies how to load the data.

 

Optionally, tailor the DMCL to be used for the load operation

ALTER DMCL

If altered, make the DMCL available to the local mode runtime environment

See Chapter 5, "Defining, Generating, and Punching a DMCL"

Format the database files to be loaded

FORMAT

Load the database using as input the sorted input file

Execute the user-written program

If necessary, connect members to sets treated as manual during the load

Execute the user-written program

Back up the database areas

BACKUP or any comparable backup utility

Verify the validity of the loaded database

CA OLQ, CA Culprit, or some other retrieval job to verify the data in the database

Example

The following example shows code to load the DEPARTMENT hierarchy:

read an input record
repeat until end-of-file
   if record-id = 410
         move DEPARTMENT record
         store DEPARTMENT
   else if record-id = 415
         move OFFICE key
         find calc OFFICE
         move EMPLOYEE record
         store EMPLOYEE
   else if record-id = 420
         move JOB key
         find calc job
         move EMPOSITION record
         store EMPOSITION
   else if record-id = 425
         move SKILL key
         find calc SKILL
         move EXPERTISE record
         store EXPERTISE
   end-if
read next input record
end-repeat