OpenTP1 Version 7 Programming Reference COBOL Language

[Contents][Index][Back][Next]

Create a service program (MHP)

Format

PROGRAM-ID.    program-name.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
         :
DATA DIVISION.
WORKING-STORAGE SECTION.
         :
         :
PROCEDURE DIVISION.
         :
         :
Service processing
         :
         :
EXIT PROGRAM.

Description

The MHP service program executes a service and returns the execution results. When the MCF receives a message, the MHP having the service program that corresponds to the application name is started.

Create the MHP service program in the above format as required. The service name corresponds to the program ID of the service program. Specify this correspondence in the user service definition of the process that executes the service program.

Specify the correspondence of the service name and the application name in the MCF application definition.

Data area specification

None

Notes on service program processing

  1. If the service program is a COBOL initialization program (the INITIAL clause is specified in the program header), the values of data items and others are initialized each time the service program is executed. If the INITIAL clause is not specified in the program header, data items still assume the values which were given during the previous service program processing. Initialize them if necessary.
  2. The following COBOL-UAP creation programs cannot be called from the MHP service program:
    CBLDCRPC('OPEN ') - Start an application program
    CBLDCRPC('CLOSE ') - Terminate an application program
    CBLDCADM('COMPLETE') - Report the completion of user server start processing
    CBLDCRSV('MAINLOOP') - Start an SPP service
    CBLDCMCF('MAINLOOP') - Start an MHP service
    CBLDCMCF('OPEN ') - Open the MCF environment
    CBLDCMCF('CLOSE ') - Close the MCF environment
    Do not use the statement in the service program to exit the program. If used, UAP operation is not guaranteed. Once a system call is used to create a child process, COBOL-UAP creation programs can no longer be called from the child process.
  3. Another UAP cannot request a service to the MHP service program by CBLDCRPC('CALL ').
  4. Data areas such as CBLDCMCF unique-name-1 must begin at an even-numbered address. If a data area such as unique-name-1 begins at an odd-numbered address, a bus error will occur.
    For example, assume that the unique-name-3 data area to be used for CBLDCMCF is defined as an array, the send data contains an odd number of bytes, and SYNC is not specified in the structure (no boundary adjustment used). In this situation, using the second element of the array as a CBLDCMCF parameter will cause a bus error during function execution.

Status code

There is no status code. The return of -1 from the service program would not mean a request for rollback.