Every authorized user program exchanges its messages via the DCAM applications. DCAM offers interfaces for the programming languages COBOL and Assembler:
If the problem to be solved makes no special demands on message transmission, COBOL can be used.
If, however, asynchronous processing of incoming messages is required, the programmer has to use Assembler (with macro calls for event-driven processing). For details refer to the manuals “DCAM Program Interfaces” [13], “DCAM COBOL Calls” [11], “DCAM Macros” [12] and “Executive Macros” [30].
Schema of an authorized user program
The following diagram gives an overview of how an authorized user program exchanges messages with the system.
Figure 26: Message exchange between BS2000 and an authorized user program
As every authorized user program exchanges its messages with the system via DCAM applications, such programs have two basic structures for such programs: synchronous and asynchronous.
Synchronous processing
The following figure shows the schema of a program that processes incoming messages synchronously. The contents of the loop in this figure may be arranged differently, according to the functional requirements.
The applicable COBOL calls or macro calls appear in parentheses.
Figure 27: Schema of an authorized user program (process messages synchronously)
Asynchronous processing
The schema of a program that processes incoming messages asynchronously differs from the above mainly in the contents of the loop and a minor change in the “Prepare processing” step: event items must be created and contingency definitions communicated to the system; see macro calls ENAEI and ENACO in the “Executive Macros” manual [30]).
Here, the loop contains only the message request; when the message arrives, it may be processed in a contingency process, including transmission of a response. Further activities not belonging to message processing may be included in the loop. Asynchronous processing of messages is therefore recommended for situations where additional coordination operations are required or several communication partners have to be serviced.Figure 28: Schema of an authorized user program (processing messages asynchronously)
Monitoring message acceptance
The UCON tasks checks on a cyclical basis (every minute) whether authorized user programs accept the messages sent to them. If it is found that the next message pending for output has been waiting longer than a minute for receipt by the authorized user program, this fact is reported to the console with message NBR0600
.
If it is also found that the next message has been pending longer than the maximum waiting time laid down by the system parameter NBRCSCK or NBRCSCKN, the system reacts in accordance with the DISCON specification in the connection message (see "DISCON" in section "Connections with dynamic authorization names"):
DISCON=YES: | The connection of the relevant authorized user program to the UCON task ($CONSOLE) is aborted. |
DISCON=NO: | All messages waiting to be output to the authorized user program are deleted and replaced by a single |