OpenTP1 Version 7 Programming Reference COBOL Language

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

Create a main program (SUP, SPP, MHP)

Format

When creating main programs, comply with the specifications of the COBOL language for coding. To terminate processing, issue STOP RUN. OpenTP1 does not limit creation of main programs except that STOP RUN must be issued to terminate processing.

Description

After the UAP process starts, the OS first calls the main program.

SUP main program

The following OpenTP1 COBOL-UAP creation programs are always issued in the SUP main program:

  1. CBLDCRPC('OPEN ')
    Start an application program
  2. CBLDCADM('COMPLETE')
    Report the completion of user server start processing
  3. CBLDCRPC('CLOSE ')
    Terminate an application program (called after job termination)

In addition to the above COBOL-UAP creation programs, those for requesting the initialization processing of UAP processes required for jobs, termination processing, and remote procedure call (CBLDCRPC('CALL ')) can also be used in the SUP main program.

SPP main program

Service programs created as services which are provided by an SPP are grouped into one executable file. An executable file comprising one main program and multiple service programs corresponds to a service group.

The following OpenTP1 COBOL-UAP creation programs are always called from the SPP main program:

  1. CBLDCRPC('OPEN ')
    Start an application program
  2. CBLDCRSV('MAINLOOP')
    Start an SPP service
  3. CBLDCRPC('CLOSE ')
    Terminate an application program (called after job termination)

To use an MCF facility (call CBLDCMCF) with an SPP service, call the following COBOL-UAP creation programs:

After initialization processing, the main program stops when CBLDCRSV('MAINLOOP') is called. Meanwhile, the main program performs processing requested by service programs. In addition to the above OpenTP1 CALL statements, CALL statements for requesting the initialization of SPP processes required for jobs, termination processing, and remote procedure call (CBLDCRPC('CALL ')) can also be used in the main program.

MHP main program

Service programs created as applications for message processing are grouped into one executable file. An executable file comprising one main program and multiple service programs corresponds to a service group. The service group name must be unique in the domain (in the entire network).

The following OpenTP1 COBOL-UAP creation programs are always called from the MHP main program:

  1. CBLDCRPC('OPEN ')
    Start an application program
  2. CBLDCMCF('OPEN ')
    Open the MCF environment
  3. CBLDCMCF('MAINLOOP')
    Start an MHP service
  4. CBLDCMCF('CLOSE ')
    Close the MCF environment (called after job termination)
  5. CBLDCRPC('CLOSE ')
    Terminate an application program (called after job termination)

The MHP having the service program corresponding to the application name is started. After initialization processing, the main program stops when CBLDCMCF('MAINLOOP') is called. Meanwhile, the main program performs processing requested by service programs. In addition to the above COBOL-UAP creation programs, those for requesting the initialization processing of UAP processes required for jobs, termination processing, and remote procedure call (CBLDCRPC('CALL ')) can also be used in the MHP main program.

Note

When creating a main program with COBOL, use STOP RUN to terminate processing when the creation terminates normally. Do not use EXIT PROGRAM.