In BS2000 most functions from version 1.1 up can be performed both synchronously and asynchronously. This is thanks to the BS2000-specific interfaces.
Synchronous execution
In the case of synchronous execution, control is only restored to the program when the function has been executed. This may entail some waiting, for example, whilst keys are being generated. The advantage of synchronous execution is its simple operation.
Asynchronous execution
In the case of asynchronous execution, control is restored to the program before the function has been fully executed. The program can therefore make use of waiting time.
Proceed as follows for asynchronous execution:
Define an event code using the ENAEI call.
If an interrupt routine is to be started when an event occurs, define this routine with the ENACO call.
Using the call CGENRAL ACTION=*INITIALIZE, EXEC=*ASYNCHRON specify that the task works asynchronously with CRYPT.
Specify the event code for CRYPT macro calls with the operand BOID=....
In addition, specify a postcode area (RPOSTAD=, RPOSTL=).
CRYPT uses the postcode1 which comprises the following:ETC
SC1
MC2
MC1
ETC
Event Code Type; for CRYPT is ’23’
The macro call CPKC11T contains a symbolic value for this.SC1
Subcode1; corresponds to the value in the standard header
MC2
Maincode2; corresponds to the value in the standard header
MC1
Maincode1; corresponds to the value in the standard header
The main code X’8000’ – parameter area not accessible – can only appear in postcode1: CRYPT could not access the parameter area at the time the function was being performed.
Use postcode2, especially when using a contingency, for a relationship to the corresponding function call (see section “Asynchronous execution – example”).
Write access to the parameter area and any data areas specified there must be assured until the end of function processing has been signaled.
The session will remain locked for other function calls until the end of the function processing has been signaled.
- CRYPT sends a signal for the event code as soon as execution is complete. The program can request the processing signal using the SOLSIG call.
You can find more details about eventing and the necessary macro calls in the “Executive Macros” user guide [3].