... {INIT DESTINATION dest}
| ALLOCATE
| ACCEPT
| {SEND BUFFER buf}
| {RECEIVE BUFFER buf DATAINFO dat STATUSINFO stat}
| DEALLOCATE ... .
1. ... INIT DESTINATION dest
2. ... ALLOCATE
3. ... ACCEPT
4. ... SEND BUFFER buf
5. ... RECEIVE BUFFER buf DATAINFO dat STATUSINFO stat
6. ... DEALLOCATE
There are different alternatives for specifying comstep, each of which is responsible for a connection step.
... INIT DESTINATION dest
The connection between the programs initialized by specifying dest. A flat character-like data object of the length 8 is expected for dest and when executing the statement, the data object contains a value from the column SDEST of database table TXCOM.
On initialization, the system automatically executes an authorization check on the
authorization object S_CPIC.
The authorization can be checked before the connection is established using the function module AUTHORITY_CHECK_CPIC.
... ALLOCATE
Establishes a connection to the partner identified in the previous addition
DESTINATION. At the same time, a start requestis passed to the partner, if it is a program.
... ACCEPT
This addition can be used to accept the established connection in a called partner program. After authentication, the called program is in receive status.
... SEND BUFFER buf
Sends data to the partner program. A data object can be specified for buf, for which all
flat elementary types are permitted and the
memory requirement of 32 KB cannot be exceeded. On execution of the statement
COMMUNICATE, the content of buf is passed to the partner program.
Information loss can occur if, for example, the communication partners have different number formats.
This can be avoided by using only character-like types for transferring the data. Furthermore, the data
is only completely transferred if the sending buffers and receiving buffers have the same structure and length.
... RECEIVE BUFFER buf DATAINFO dat STATUSINFO stat
Receives data from the partner program. A data object can be specified for buf, for which all flat elementary types are permitted and the memory requirement of 32 KB cannot be exceeded. On execution of the statement COMMUNICATE, the content of buf is received by the partner program.
After the execution of the statement, the data object dat
contains information about whether the data is sent completely and the content of the data object
stat indicates whether the current program is in send or receive mode. Only byte-like data
objects are allowed for dat and
stat, the length should not be less than 4 bytes. The code for the values in dat and stat can be extracted from the
include program RSCPICDF. Here, data objects with a descriptive name and
start values are declared which can be
compared with dat and stat.
A connection step opened with RECEIVE must be followed by a connection step opened with SEND.
... DEALLOCATE
The connection is terminated and all memory areas are released.