OpenTP1 Version 7 Programming Reference COBOL Language

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

CBLDCRSV('MAINLOOP') - Start an SPP service

Format

PROCEDURE DIVISION specification

CALL  'CBLDCRSV'  USING  unique-name-1

DATA DIVISION specification

01  unique-name-1.
    02  data-name-A    PIC X(8) VALUE 'MAINLOOP'.
    02  data-name-B    PIC X(5).
    02  FILLER        PIC X(3).
    02  data-name-C    PIC S9(9) COMP VALUE ZERO.

Description

CBLDCRSV('MAINLOOP') starts the receiving of service requests to a service program of the SPP which is being executed in the process. CBLDCRSV('MAINLOOP') must be called in the main program. Use CBLDCRSV('MAINLOOP') only once in the process.

CBLDCRSV('MAINLOOP') does not return until it receives a termination request from OpenTP1. CBLDCRSV('MAINLOOP') receives a termination request from OpenTP1 in the following cases:

Data areas whose values are set in the UAP

data-name-A

Specify VALUE 'MAINLOOP' for the request code indicating SPP service start.

data-name-C

Specify 0.

Data area whose value is returned from OpenTP1

data-name-B

A status code of 5 digits is returned.

Status codes

Status code Explanation
00000 A termination request was received from OpenTP1. Execute termination processing for the SPP immediately, then call CBLDCRPC('CLOSE ') to enable exit().
00301 The value specified for the data-name is invalid.
This error also occurs if the request code (data-name-A) is invalid.
00302 CBLDCRPC('OPEN ') was not called, or CBLDCMCF('MAINLOOP') or CBLDCRSV('MAINLOOP') was called.
00303 The SPP service could not be started.

Notes

CBLDCRSV('MAINLOOP') returns when it receives a termination request from OpenTP1. However, CBLDCRSV('MAINLOOP') does not return but the process terminates in the following cases:

Even if the SPP is created in such a way that termination processing will be executed after CBLDCRSV('MAINLOOP') returns normally, the processing is not executed in the above cases.