COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Table 72 How Final Values of #RECEIVE Arguments Are Chosen
Final Value#RECEIVE Argument
Maximum value specified by a TABLE OCCURS argument in any #RECEIVE blockTABLE OCCURS
Maximum value specified by a SYNCDEPTH argument in any #RECEIVE blockSYNCDEPTH
Maximum value specified by a REPLY CONTAINS argument in any #RECEIVE blockREPLY CONTAINS
Logical ORREPORT
Maximum value specified by a QUEUE DEPTH argument in any #RECEIVE block*QUEUE DEPTH
* HP COBOL does not have a QUEUE DEPTH argument, so the value is assumed to be 1.
The first HP COBOL external file to open $RECEIVE determines the values of the #RECEIVE
arguments. Subsequent opens of $RECEIVE fail if they specify incompatible values.
Subsequent value is incompatible with first value if …#RECEIVE Argument
subsequent value > first valueTABLE OCCURS
subsequent value > first valueSYNCDEPTH
subsequent value > first valueREPLY CONTAINS
subsequent value <> first valueREPORT
QUEUE DEPTH first value = 1 and subsequent value <>1
or
first value > 1 and
subsequent value <= 1 or subsequent value > first value
If an internal file opens $RECEIVE, the values of the #RECEIVE arguments depend on whether the
program that describes the internal file has a RECEIVE-CONTROL paragraph. If so, the #RECEIVE
block associated with the program’s RECEIVE-CONTROL paragraph is used as the internal file’s
#RECEIVE block (even in a TNS program whose RECEIVE-CONTROL paragraph is EXTERNAL). If
the program does not have a RECEIVE-CONTROL paragraph, the #RECEIVE arguments have these
default values:
Default Value#RECEIVE Argument
1TABLE OCCURS
1SYNCDEPTH
0REPLY CONTAINS
NoneREPORT
1QUEUE DEPTH
If an external file opens $RECEIVE, its #RECEIVE block is the one associated with the run unit, if
one exists; otherwise, the #RECEIVE arguments have the default values.
When sharing $RECEIVE, be aware that:
• If one opener requests system messages and another does not, the one that does not might
get them anyway.
• The ERROR CODE and MESSAGE SOURCE phrases of the RECEIVE-CONTROL paragraph
are always local to the program unit. They apply to all READ and WRITE requests in that
program unit, even if $RECEIVE was opened in another program unit.
• Opening a file that references $RECEIVE uses the #RECEIVE arguments specified by the
program that contains the OPEN statement, even if the file is EXTERNAL. If the file is EXTERNAL,
Compilation Details 523










