Basic initial load program

You should write a basic initial load program (one that is not restartable) when the volume of data you need to load is not so great that you would be seriously set back if problems occurred during program execution.

If problems do occur, the basic initial load program must be rerun from the beginning.

Fast Path Data Entry Databases (DEDBs) cannot be loaded in a batch job as can DL/I databases. DEDBs are first initialized by the DEDB Initialization Utility and then loaded by a user-written Fast Path application program that executes typically in a BMP region.

Fast Path Main Storage Databases (MSDBs) are not loaded until the IMS control region is initialized. These databases are then loaded by the IMS start-up procedure when the following requirements are met:

  • The MSDB= parameter on the EXEC Statement of Member Name IMS specifies a one-character suffix to DBFMSDB in IMS.PROCLIB.
  • The member contains a record for each MSDB to be loaded.

    The record contains a record for each MSDB, the number of segments to be loaded, and an optional F which indicates that the MSDB is to be fixed in storage.

  • A sequential data set, part of a generation data group (GDG) with dsname IMS.MSDBINIT(0), is generated.

    This data set can be created by a user-written program or by using the INSERT function of the MSDB Maintenance utility. Records in the data set are sequenced by MSDB name, and within MSDBs by key.

The following figure shows the logic for developing a basic initial load program.

Figure 1. Basic initial load program logic
1: Open input files 2: Read input 3: End of file? Yes: load completed normally. No: continue 4: Insert segment 5: Status code non-blank? Yes: go to step 2. No: go to error routine and end program.

The following code is a sample load program that satisfies the basic IMS database loading requirements. A sample program showing how this can be done with the Utility Control Facility is also provided.

DLITCBL  START
         PRINT   NOGEN
         SAVE    (14,12),,LOAD1.PROGRAM   SAVE REGISTERS
         USING   DLITCBL,10               DEFINE BASE REGISTER
         LR      10,15                    LOAD BASE REGISTER
         LA      11,SAVEAREA              PERFORM
         ST      13,4(11)                  SAVE
         ST      11,8(13)                   AREA
         LR      13,11                       MAINT
         L       4,0(1)                   LOAD PCB BASE REGISTER
         STCM    4,7,PCBADDR+1            STORE PCB ADDRESS IN CALL LIST
         USING   DLIPCB,4                 DEFINE PCB BASE REGISTER
         OPEN    (LOAD,(INPUT))           OPEN LOAD DATA SOURCE FILE
LOOP     GET     LOAD,CARDAREA            GET SEGMENT TO BE INSERTED
INSERT   CALL    CBLTDLI,MF=(E,DLILINK)   INSERT THE SEGMENT
         AP      SEGCOUNT,=P'1'           INCREMENT SEGMENT COUNT
         CLC     DLISTAT,=CL2' '          WAS COMPLETION NORMAL?
         BE      LOOP                     YES - KEEP GOING
ABEND    ABEND   8,DUMP                   INVALID STATUS
EOF      WTO     'DATABASE 1 LOAD COMPLETED NORMALLY'
         UNPK    COUNTMSG,SEGCOUNT        UNPACK SEGMENT COUNT FOR WTO
         OI      COUNTMSG+4,X'F0'         MAKE SIGN PRINTABLE
         WTO     MF=(E,WTOLIST)           WRITE SEGMENT COUNT
         CLOSE   (LOAD)                   CLOSE INPUT FILE
         L       13,4(13)                 UNCHAIN SAVE AREA
         RETURN  (14,12),RC=0             RETURN NORMALLY
         LTORG
SEGCOUNT DC      PL3'0'
         DS      0F
WTOLIST  DC      AL2(LSTLENGT)
         DC      AL2(0)
COUNTMSG DS      CL5
         DC      C' SEGMENTS PROCESSED'
LSTLENGT EQU     (*-WTOLIST)
DLIFUNC  DC      CL4'ISRT'                FUNCTION CODE
DLILINK  DC      A(DLIFUNC)               DL/I CALL LIST
PCBADDR  DC      A(0)
         DC      A(DATAAREA)
         DC      X'80',AL3(SEGNAME)
CARDAREA DS      0CL80                    I/O AREA
SEGNAME  DS      CL9
SEGKEY   DS      0CL4
DATAAREA DS      CL71
SAVEAREA DC      18F'0'
LOAD     DCB     DDNAME=LOAD1,DSORG=PS,EODAD=EOF,MACRF=(GM),RECFM=FB
DLIPCB   DSECT   ,                        DATABASE PCB
DLIDBNAM DS      CL8
DLISGLEV DS      CL2
DLISTAT  DS      CL2
DLIPROC  DS      CL4
DLIRESV  DS      F
DLISEGFB DS      CL8
DLIKEYLN DS      CL4
DLINUMSG DS      CL4
DLIKEYFB DS      CL12
         END