Data Division in the Communication Module [ COBOL/HP-UX Language Reference for the Series 700 and 800 ] MPE/iX 5.0 Documentation
COBOL/HP-UX Language Reference for the Series 700 and 800
Data Division in the Communication Module
Communication Section
In a COBOL program the Communication Description
entries (CD) represent the highest level of organization in the
Communication Section.
The COMMUNICATION SECTION header is followed by a CD entry consisting of
a level indicator, a data-name and a series of independent clauses.
These clauses indicate the queues and subqueues, the message date and
time, the source, the text length, the status and end keys, and message
count of input. They also specify the destination count, the text
length, the status and error keys, and destinations for output.
________________________________________________________________________
|(ANS85) |
|For an input-output CD entry the clauses specify the message date, |
|message time, symbolic terminal, text length, and key and status |
|key. |
________________________________________________________________________
The entry itself is terminated by a period. These record areas can be
implicitly redefined by user-specified record description entries
following the various CD clauses.
The Communication Description - Complete Entry Skeleton
Function
The CD specifies the interface area between the MCS and a COBOL program.
General Formats
Format 1
Format 2
Format 3
Syntax Rules
All Formats
1. A CD must appear only in the Communication Section.
Formats 1 and 3 (ANS85)
2. Within a single program, the INITIAL clause
can be specified in only one CD. The INITIAL clause must not be
used in a program that specifies the USING phrase of the PROCEDURE
DIVISION Header. (See The PROCEDURE DIVISION Header in the
chapter The Nucleus.)
3. Except for the INITIAL clause, the optional clauses can be written
in any order.
4. If neither option in the format is specified, a level 01 data
description entry must follow the CD entry. Either option can be
followed by a level 01 data description entry.
5. Record description entries following an input CD implicitly
redefine this record and must describe a record of exactly 87
standard data format characters. Multiple redefinitions of this
record are permitted; however, only the first redefinition can
contain VALUE clauses. However, the MCS will always reference the
record according to the data descriptions defined in General Rule
4.
6. Data-name-1, data-name-2, ..., data-name-6 must be unique within
the CD. Within this series, any data-name can be replaced by the
reserved word FILLER.
Format 2
________________________________________________________________________
| |
| 7. The optional clauses can be written in any order. (ANS85) |
| |
________________________________________________________________________
8. If none of the optional clauses of the CD is specified, a level 01
data description entry must follow the CD entry.
9. Record descriptions following an output CD implicitly redefine this
record. Multiple redefinitions of this record are permitted;
however, only the first redefinition can contain VALUE clauses.
Note that the MCS will always reference the record according to the
data descriptions defined in General Rule 18.
10. Data-name-1, data-name-2, ..., data-name-5 must be unique within a
CD.
11. If the DESTINATION TABLE OCCURS clause
is not specified, one ERROR KEY and one SYMBOLIC DESTINATION area
is assumed. In this case, neither subscripting nor indexing is
permitted when referencing these data items.
12. If the DESTINATION TABLE OCCURS clause is specified, data-name-4 and
data-name-5 can only be referred to by subscripting or indexing.
13. There is no restriction on the value of the data item referenced by
data-name-1 and integer-2.
________________________________________________________________________
|(ANS85) |
| |
|Format 3 |
| |
| |
| |
|14. Record descriptions following an input-output CD implicityly |
| redefine this record and must describe a record of exactly 33 |
| standard data characters. Multiple redefinitions of this record |
| are permitted; howerver, only the first redefinition may contain |
| VALUE clauses. The MCS will always reference the record |
| according to the data descriptions defined in General Rule |
| 26. |
| |
|15. Data-name-1, data-name-2, ..., data-name-6 must be unique within |
| the CD. Within this series, any data-name may be replaced by the |
| reserved word FILLER. |
| |
________________________________________________________________________
General Rules
All Formats
1. Table 9-1 indicates the possible contents of the data items
referenced by data-name-10 for Format 1, data-name-3 for Format 2
and by data-name-6 for Format 3 (ANS85) at the completion of each
statement shown. An "X" on a line in a statement column indicates
that the associated code shown for that line is possible for that
statement.
Table 9-1. Communication Status Key Condition
2. Table 9-2 indicates the possible content of the data item
referenced by data-name-4 for Format 2 at the completion of each
statement shown. An "X" on a line in a statement column indicates
that the associated error key value shown for that line is
possible for that statement.
Table 9-2. Error Key Values
Format 1
3. The input CD information constitutes the communication between the
MCS and the program as information about the message being
handled. This information does not come from the terminal as part
of the message.
4. For each input CD, a record area of 87 contiguous standard data
format characters is allocated. This record area is defined to
the MCS as follows:
a. The SYMBOLIC QUEUE clause
defines data-name-1 as the name of an elementary
alphanumeric data item of 12 characters occupying positions
1-12 in the record.
b. The SYMBOLIC SUB-QUEUE-1 clause
defines data-name-2 as the name of an elementary
alphanumeric data item of 12 characters occupying positions
13-24 in the record.
c. The SYMBOLIC SUB-QUEUE-2 clause
defines data-name-3 as the name of an elementary
alphanumeric data item of 12 characters occupying positions
25-36 in the record.
d. The SYMBOLIC SUB-QUEUE-3 clause
defines data-name-4 as the name of an elementary
alphanumeric data item of 12 characters occupying positions
37-48 in the record.
e. The MESSAGE DATE clause
defines data-name-5 as the name of a data item whose
implicit description is that of an integer of 6 digits
without an operational sign occupying character positions
49-54 in the record.
f. The MESSAGE TIME clause
defines data-name-6 as the name of a data item whose
implicit description is that of an integer of 8 digits
without an operational sign occupying character positions
55-62 in the record.
g. The SYMBOLIC SOURCE clause
defines data-name-7 as the name of an elementary
alphanumeric data item of 12 characters occupying positions
63-74 in the record.
h. The TEXT LENGTH clause
defines data-name-8 as the name of an elementary data item
whose implicit description is that of an integer of 4
digits without an operational sign occupying character
positions 75-78 in the record.
i. The END KEY clause
defines data-name-9 as the name of an elementary
alphanumeric data item of 1 character occupying position 79
in the record.
j. The STATUS KEY clause
defines data-name-10 as the name of an elementary
alphanumeric data item of 2 characters occupying positions
80-81 in the record.
k. The MESSAGE COUNT clause
defines data-name-11 as the name of an elementary data item
whose implicit description is that of an integer of 6
digits without an operational sign occupying character
positions 82-87 in the record.
The second option can be used to replace the above clauses by a
series of data-names which, taken in order, correspond to the
data-names defined by these clauses.
Use of either option results in a record whose implicit
description is equivalent to the following:
Phrase Implicit Description
01 data-name-0.
02 data-name-1 PIC X(12). SYMBOLIC QUEUE
02 data-name-2 PIC X(12). SYMBOLIC SUB-QUEUE-1
02 data-name-3 PIC X(12). SYMBOLIC SUB-QUEUE-2
02 data-name-4 PIC X(12). SYMBOLIC SUB-QUEUE-3
02 data-name-5 PIC 9(06). MESSAGE DATE
02 data-name-6 PIC 9(08). MESSAGE TIME
02 data-name-7 PIC X(12). SYMBOLIC SOURCE
02 data-name-8 PIC 9(04). TEXT LENGTH
02 data-name-9 PIC X. END KEY
02 data-name-10 PIC XX. STATUS KEY
02 data-name-11 PIC 9(06). MESSAGE COUNT
Note that in the above, the information under "COMMENT" is for
clarification and is not part of the description.
5. The contents of the data items referenced by data-name-2,
data-name-3, and data-name-4, when not being used must contain
spaces.
6. The data items referenced by data-name-1, data-name-2,
data-name-3, and data-name-4 contain symbolic names designating
queues, sub-queues, ..., respectively. All symbolic names must
follow the rules for the formation of system-names, and must have
been previously defined to the MCS.
7. A RECEIVE statement causes the serial return of the "next" message
or a portion of a message from the queue as specified by the
entries in the CD.
If during the execution of a RECEIVE statement, a message from a
more specific source is needed, the contents of the data item
referenced by data-name-1 can be made more specific by the use of
the contents of the data items referenced by data-name-2,
data-name-3, and in turn data-name-4. When a given level of the
queue structure is specified, all higher levels must also be
specified.
If not all levels of the queue hierarchy are specified, the MCS
determines the "next" message or portion of a message to be
accessed.
After the execution of a RECEIVE statement, the contents of the
data items referenced by data-name-1 through data-name-4 will
contain the symbolic names of all the levels of the queue
structure.
8. Whenever a program is scheduled by the MCS to process a message,
that program establishes a run unit and the symbolic names of the
queue structure that demanded this activity will be placed in the
data items referenced by data-name-1 through data-name-4 of the CD
associated with the INITIAL clause as applicable. In all other
cases, the contents of the data items referenced by data-name-1
through data-name-4 of the CD associated with the INITIAL clause
are initialized to spaces.
The symbolic names are inserted or the initialization to spaces is
completed prior to the execution of the first Procedure Division
statement.
The execution of a subsequent RECEIVE statement naming the same
contents of the data items referenced by data-name-1 through
data-name-4 will return the actual message that caused the program
to be scheduled. Only at that time will the remainder of the CD
be updated.
9. If the MCS attempts to schedule a program lacking an INITIAL
clause, the results are undefined.
10. Data-name-5 has the format "YYMMDD" (year, month, day). Its
contents represent the date on which the MCS recognizes that the
message is complete.
The contents of the data item referenced by data-name-5 are only
updated by the MCS as part of the execution of a RECEIVE
statement.
11. The contents of data-name-6 have the format "HHMMSSTT" (hours,
minutes, seconds, hundredths of a second) and its contents
represent the time at which the MCS recognizes that the message is
complete.
The contents of the data item referenced by data-name-6 are only
updated by the MCS as part of the execution of the RECEIVE
statement.
12. During the execution of a RECEIVE statement, the MCS provides, in
the data item referenced by data-name-7, the symbolic name of the
communications terminal that is the source of the message being
transferred. This symbolic move must follow the rules for the
formation of system names. However, if the symbolic name of the
communication terminal is not known to the MCS, the contents of
the data item referenced by data-name-7 will contain spaces.
13. The MCS indicates via the contents of the data item referenced by
data-name-8 the number of character positions filled as a result
of the execution of the RECEIVE statement. (See "The RECEIVE
Statement" later in this chapter.)
14. The contents of the data item referenced by data-name-9 are set
only by the MCS as part of the execution of a RECEIVE statement
according to the following rules:
a. When the RECEIVE MESSAGE phrase
is specified, then data-name-9 is set to one of the
following:
* If an end of group has been detected, the contents
of the data item referenced by data-name-9 are set
to 3;
* If an end of message has been detected, the contents
of the data item referenced by data-name-9 are set
to 2;
* If less than a message has been detected, the
contents of the data item referenced by data-name-9
are set to 0.
b. When the RECEIVE SEGMENT phrase
is specified, data-name-9 is set to one of the following:
* If an end of group has been detected, the contents
of the data item referenced by data-name-9 are set
to 3.
* If an end of message has been detected, the contents
of the data item referenced by data-name-9 are set
to 2.
* If an end of segment has been detected, the contents
of the data item referenced by data-name-9 are set
to 1.
* If less than a message segment is transferred, the
contents of the data item referenced by data-name-9
are set to 0.
c. When more than one of the above conditions is satisfied
simultaneously, the rule first satisfied in the order
listed determines the contents of the data item referenced
by data-name-9.
15. The contents of the data item referenced by data-name-10 indicate
the status condition of the previously executed RECEIVE, ACCEPT
MESSAGE COUNT, ENABLE INPUT, or DISABLE INPUT statements.
The actual association between the contents of the data item
referenced by data-name-10 and the status condition
itself is defined in Table 9-1 .
16. The contents of the data item referenced by data-name-11 indicate
the number of messages that exist in a queue, sub-queue-1, ... .
The MCS updates the contents of the data item referenced by
data-name-11 only as part of the execution of an ACCEPT statement
with the COUNT phrase.
Format 2
17. The nature of the output CD information is such that it is not
sent to the terminal, but constitutes the communication between
the program and the MCS as information about the message being
handled.
18. For each output CD, a record area of contiguous standard data
format characters is allocated according to the following formula:
(10 plus 13 times integer-2).
a. The DESTINATION COUNT clause
defines data-name-1 as the name of a data item whose
implicit description is that of an integer without an
operational sign occupying character positions 1-4 in the
record.
b. The TEXT LENGTH clause
defines data-name-2 as the name of an elementary data item
whose implicit description is that of an integer of 4
digits without an operational sign occupying character
positions 5-8 in the record.
c. The STATUS KEY clause
defines data-name-3 to be an elementary alphanumeric data
item of 2 characters occupying positions 9-10 in the
record.
d. Character positions 11-23 and every set of 13 characters
thereafter will form table items of the following
description:
* The ERROR KEY clause
defines data-name-4 as the name of an elementary
alphanumeric data item of 1 character.
* The SYMBOLIC DESTINATION clause
defines data-name-5 as the name of an elementary
alphanumeric data item of 12 characters.
Use of the above clauses results in a record whose implicit
description is equivalent to the following:
Implicit Description Comment
01 data-name-0.
02 data-name-1 PIC 9(04). DESTINATION COUNT
02 data-name-2 PIC 9(04). TEXT LENGTH
02 data-name-3 PIC XX. STATUS KEY
02 data-name OCCURS integer-2 TIMES. DESTINATION TABLE
03 data-name-4 PIC X. ERROR KEY
03 data-name-5 PIC X(12). SYMBOLIC DESTINATION
Note that in the above, the information under "COMMENT" is for
clarification and is not part of the description.
19. During the execution of a SEND, ENABLE OUTPUT, or DISABLE OUTPUT
statement, the contents of the data item referenced by data-name-1
will indicate to the MCS the number of symbolic destinations that
are to be used from the area referenced by data-name-5.
The MCS finds the first symbolic destination in the first
occurrence of the area referenced by data-name-5, the second
symbolic destination in the second occurrence of the area
referenced by data-name-5 ..., up to and including the occurrence
of the area referenced by data-name-5 indicated by the contents of
data-name-1.
If during the execution of a SEND, ENABLE OUTPUT, or DISABLE
OUTPUT statement the value of the data item referenced by
data-name-1 is outside the range of 1 through integer-2, an error
condition is indicated and the execution of the SEND, ENABLE
OUTPUT, or DISABLE OUTPUT statement is terminated.
20. It is the responsibility of the user to insure that the value of
the data item referenced by data-name-1 is valid at the time of
execution of the SEND, ENABLE OUTPUT, or DISABLE OUTPUT statement.
21. As part of the execution of a SEND statement, the MCS will
interpret the contents of the data item referenced by data-name-2
to be the user's indication of the number of leftmost character
positions of the data item referenced by the associated SEND
identifier from which data is to be transferred. (See "The SEND
Statement" later in this chapter.)
22. Each occurrence of the data item referenced by data-name-5
contains a symbolic destination previously known to the MCS. These
symbolic destination names must follow the rules for the formation
of system-names.
23. The contents of the data item referenced by data-name-3 indicate
the status condition of the previously executed SEND, ENABLE
OUTPUT or DISABLE OUTPUT statement.
The actual association between the contents of the data item
referenced by data-name-3 and the status condition itself is
defined in Table 9-1 .
24. If, during the execution of a SEND, an ENABLE OUTPUT, or a DISABLE
OUTPUT statement, the MCS determines that any specified
destination is unknown, the contents of the data item referenced
by data-name-3 and all occurrences of the data items referenced by
data-name-4 are updated.
The contents of the data item referenced by data-name-4 when equal
to 1 indicate that the associated value in the area referenced by
data-name-5 has not been previously defined to the MCS. Otherwise,
the contents of the data item referenced by data-name-4 are set to
zero.
________________________________________________________________________
|(ANS85) |
| |
|Format 3 |
| |
| |
| |
|25. The input-output CD information constitutes the communication |
| between the MCS and the program about the message being handled. |
| This information does not come from the terminal as part of the |
| message. |
| |
|26. Form each input-output CD, a record area of 33 contiguous |
| character positions is allocated. This record area is defined to|
| the MCS as follows: |
| |
| |
| a. The MESSAGE DATE clause defines data-name-1 as the name of|
| a data item whose implicit description is that of an |
| integer of 6 digits, without an operational sign, |
| occupying positions 1-6 in the record. |
| |
| b. The MESSAGE TIME clause defines data-name-2 as the name of|
| a data item whose implicit description is that of an |
| integer of 8 digits, without an operational sign, |
| occupying positions 7-14 in the record. |
| |
| c. The SYMBOLIC TERMINAL clause defines data-name-3 as |
| the name of an elementary alphanumeric data item |
| of 12 characters occupying positions 15-26 in the |
| record. |
| |
| d. The TEXT LENGTH clause defines data-name-4 as the name of |
| an elementary data item whose implicit description is that|
| of an integer is that of an integer of 4 digits, without |
| an operational sign, occupying positions 27-30 in the |
| record. |
| |
| e. The END KEY clause defines data-name-5 as the name of an |
| elementary alphanumeric data item of 1 character occupying|
| position 31 in the record. |
| |
| f. The STATUS KEY clause defines data-name-6 as the |
| name of an elementary alphanumeric data item of |
| 2 characters occupying position 32 and 33 in the |
| record. |
| |
| The second option may be used to replace the above clauses by a |
| series of data-names which, taken in order, correspond to the |
| data-names defined by these clauses. |
| |
| Use of either option results in a record whose implicit |
| description is equivalent to the following: ell |
| |
| The second option may be used to replace the above clauses by a |
| series of data-names which, taken in order, correspond to the |
| data-names defined by these clauses. |
| |
| Use of either option results in a record whose implicit |
| description is equivalent to the following: |
| |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
| Implicit Description Comment |
| |
| 01 data-name-0. |
| 02 data-name-1 PIC 9(6). MESSAGE DATE |
| 02 data-name-2 PIC 9(8). MESSAGE TIME |
| 02 data-name-3 PIC X(12). SYMBOLIC TERMINAL |
| 02 data-name-4 PIC 9(4). TEXT LENGTH |
| 02 data-name-5 PIC X. END KEY |
| 02 data-name-6 PIC XX STATUS KEY |
| |
|Note that in the above, the information under 'COMMENT' is for |
|clarification and is not part of the data description. |
| |
| |
| |
|27. When a program is scheduled by the MCS to process a message, the |
| first RECEIVE statement referencing the input-output CD with the |
| INITIAL clause returns the actual message that caused the program|
| to be scheduled. |
| |
|28. Data-name-1 has the format "YYMMDD" (year, month, day). Its |
| content represents the date on which the MCS recognizes that the |
| message is complete. |
| |
| The content of the data item referenced by data-name-1 is |
| updated only by the MCS as part of the execution of a RECEIVE |
| statement. |
| |
|29. Data-name-2 has the format "HHMMSSTT" (hours, minutes, |
| seconds, hundredths of a second) and its content represents |
| the time at which the MCS recognizes that the message is |
| complete. |
| |
| The content of the data item referenced by data-name-2 is updated|
| only by the MCS as part of the execution of the RECEIVE |
| statement. |
| |
|30. Whenever a program is scheduled by the MCS to process a |
| message, that program establishes a run unit, and the symbolic |
| name of the communication terminal that is the source of |
| the message that invoked this program, is placed in the |
| data item referenced by data-name-3 of the input-output CD |
| associated with the INITIAL clause as applicable. This |
| symbolic name must follow the rules for the formation of |
| system-names. |
| |
| In all other cases, the content of the data item referenced by |
| data-name-3 of the input-output CD associated with the INITIAL |
| clause is initialized to spaces. |
| |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
| |
| |
| The symbolic name is inserted, or the initialization to spaces is|
| completed, prior to the execution of the first Procedure Division|
| statement. |
| |
|31. If the MCS attempts to schedule a program lacking an INITIAL |
| clause, the results are undefined. |
| |
|32. When the INITIAL clause is specified for an input-output CD and |
| the program is scheduled by the MCS, the content of the data |
| item referenced by data-name-3 must not be changed by the |
| program. If this content is changed, the execution of any |
| statement referencing cd-name-1 is unsuccessful, and the data |
| item referenced by data-name-6 is set to indicate unknown |
| source or destination, as applicable. (See General Rule |
| 1.) |
| |
|33. For an input-output CD without the INITIAL clause, or for an |
| input-output CD with the INITIAL clause when the program is |
| not scheduled by the MCS, the program must specify the |
| symbolic name of the source or destination in data-name-3 |
| prior to the execution of the first statement referencing |
| cd-name-1. |
| |
| After executing the first statement referencing cd-name-1, the |
| content of the data item referenced by data-name-3 must not be |
| changed by the program. If this content is changed, the |
| execution of any statement referencing cd-name-1 is unsuccessful,|
| and the data item referenced by data-name-6 is set to indicate |
| unknown source or destination, as applicable. (See General Rule |
| 1.) |
| |
|34. The MCS indicates, through the content of the data item |
| referenced by data-name-4, the number of character positions |
| filled as a result of the execution of the RECEIVE statement. |
| See "The RECEIVE Statement" . |
| |
| As part of the execution of a SEND statement, the MCS interprets |
| the contents of the data item referenced by data-name-4 as an |
| indication of the number of leftmost character positions of the |
| data item referenced by the associated SEND identifier |
| from which data is transferred. See "The SEND Statement" |
| . |
| |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
| |
| |
|35. The content of the data item referenced by data-name-5 is set |
| only by the MCS as part of the execution of a RECEIVE statement |
| according to the following rules: |
| |
| |
| |
| a. When the RECEIVE MESSAGE phrase is specified: |
| |
| |
| |
| - If an end of group has been detected, the content of |
| the data item referenced by data-name-5 is set to |
| 3. |
| |
| - If an end of message has been detected, the content of |
| the data item referenced by data-name-5 is set to |
| 2. |
| |
| - If less than a message is transferred the content of |
| the data item referenced by data-name-5 is set to |
| 0. |
| |
| |
| |
________________________________________________________________________
________________________________________________________________________
|(ANS85) |
| |
| |
| |
| b. When the RECEIVE SEGMENT phrase is specified: |
| |
| |
| |
| - If an end of group has been detected, the content of |
| the data item referenced by data-name-5 is set to |
| 3. |
| |
| - If an end of message has been detected, the content of |
| the data item referenced by data-name-5 is set to |
| 2. |
| |
| - If an end of segment has been detected, the content of |
| the data item referenced by data-name-5 is set to |
| 1. |
| |
| - If less than a message segment is transferred, the content|
| of the data item referenced by data-item-5 is set to |
| 0. |
| |
| |
| c. When more than one of the conditions is satisfied |
| simultaneously, the rule first satisfied in the order listed |
| determines the content of the data item referenced by |
| data-name-5. |
| |
| |
|36. The content of the data item referenced by data-name-6 indicates |
| the status condition of the previously executed DISABLE, ENABLE, |
| PURGE, RECEIVE, or SEND statement. |
| |
| The actual association between the content of the data item |
| referenced by data-name-6 and the status condition itself is |
| defined in General Rule 1. |
| |
________________________________________________________________________
MPE/iX 5.0 Documentation