Previous Topic: Assembler ConsiderationsNext Topic: XA Considerations


Batch Access to DC Queues and Printers

This appendix explains how a batch application program can use services of the CA IDMS central version.

DC-BATCH Mode

DC-BATCH allows your batch program to access DC queues and printers. Using DC-BATCH, your program can access the database, issue CA IDMS queue management commands, and transmit data to DC printers.

Note: DC-BATCH uses the IDMS communications block.

Batch Access to CA IDMS Queues

You can use DC-BATCH to establish a task within a batch application program. This allows your program to read data from queue records while performing normal database activities. Additionally, you can take advantage of DC facilities for locking queue records and performing recovery.

Perform the following steps to access queue records from a DC-BATCH program:

  1. Link edit the program with the batch interface module, IDMS.
  2. Specify a mode of DC-BATCH.
  3. Initiate the DC task by issuing a BIND TASK statement before any other BIND statements. BIND TASK establishes communication with the DC system and allocates a packet-data-movement buffer to contain the queue data.
  4. Issue retrieval and modification statements beginning with BIND RUN-UNIT and ending with FINISH. Within a task, you can code as many BIND/READY/FINISH sequences as required.
  5. Issue GET QUEUE, PUT QUEUE, and DELETE QUEUE statements to access queue records. Queue access requests must fall between the BIND TASK and the FINISH TASK statements; they need not fall between BIND RUN-UNIT and FINISH.
  6. Terminate the DC task by issuing a FINISH TASK statement. FINISH TASK relinquishes control over all database areas associated with the task and establishes an end-of-task checkpoint in the journal file for the queue areas that have been accessed by the task.

Within the task, you can issue COMMIT TASK and ROLLBACK TASK statements to write checkpoints and effect recovery coordinated with the CA IDMS run unit.

Note: Be sure to issue a BIND TASK statement and a FINISH TASK statement and to include the TASK parameter of the COMMIT and ROLLBACK statements.

Batch Access to DC Printers

To access DC printers from a batch application program, perform the following steps:

  1. Link edit the program with the batch interface module, IDMS.
  2. Specify a mode of DC-BATCH.
  3. Issue a BIND TASK statement.
  4. Issue WRITE PRINTER requests as needed to build a report and direct it to a printer.

    Note: Batch programs cannot issue WRITE PRINTER SCREEN requests.

    Terminate the DC task with a FINISH TASK statement.