Communication Description Entry COBOL

The communication description entry specifies the interface area between the Message Control System (MCS) and a COBOL program.

Format 1:Input CD

Input CD

Format 2:Output CD

Output CD

Format 3:Input-Output CD

Input-Output CD

A CD entry may appear only in the Communication Section.

Within a single program, the INITIAL clause may 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.

For Format 1 (Input CD):

  • If the INITIAL clause is present, it must appear in the position shown; the other optional clauses may be specified in any order.
  • If neither option for specifying the interface area is used, a level 01 data description entry must follow the CD entry. Either option may be followed by a level 01 data description entry.
  • Record description entries following an input CD entry implicitly redefine the record area established by the input CD entry and must describe a record of exactly 87 standard data format characters.Multiple redefinitions of this record are permitted. VALUE clauses for data items not in the first redefinition do not cause those data items to have an initial value when the program is placed into its initial state, but will be used for the INITIALIZE statement with the VALUE phrase.The MCS always references the record according to the data description defined in item 2k of the general rules for Format 1.
  • data-name-1, data-name-2, data-name-3, data-name-4, data-name-5, data-name-6, data-name-7, data-name-8, data-name-9, data-name-10 and data-name-11 must be unique within the CD entry. Within this series any data-name may be replaced by the reserved word FILLER.

For Format 2 (Output CD):

  • If none of the optional clauses of the CD entry is specified, a level 01 data description entry must follow the CD entry.
  • Record description entries subordinate to an output CD entry implicitly redefine the record area established by the output CD entry.Multiple redefinitions of this record are permitted.VALUE clauses for data items not in the first redefinition do not cause those data items to have an initial value when the program is placed into its initial state, but will be used for the INITIALIZE statement with the VALUE phrase. The MCS always references the record according to the data description defined in item 2d of the general rules for Format 2.
  • data-name-1, data-name-2, data-name-3, data-name-4 and data-name-5 must be unique within a CD entry.
  • If both the DESTINATION TABLE OCCURS clause and the ERROR KEY clause are present, the ERROR KEY clause must not precede the DESTINATION TABLE OCCURS clause.If both the DESTINATION TABLE OCCURS clause and the SYMBOLIC DESTINATION clause are present, the SYMBOLIC DESTINATION clause must not precede the DESTINATION TABLE OCCURS clause.Except for these restrictions, the optional clauses of an output CD entry may appear in any order.
  • If the DESTINATION TABLE OCCURS clause is not specified, one error key and one symbolic destination area are assumed.In this case, subscripting is not permitted when referencing these data items.
  • If the DESTINATION TABLE OCCURS clause is specified, data-name-4 and data-name-5 may be referenced only by subscripting.

For Format 3 (Input-Output CD):

  • If the INITIAL clause is present, it must appear in the position shown; the other optional clauses may be specified in any order.
  • If neither option for specifying the interface area is used, a level 01 data description entry must follow the CD entry. Either option may be followed by a level 01 data description entry.
  • Record description entries following an input-output CD entry implicitly redefine the record area established by the input-output CD entry and must describe a record of exactly 33 standard data format characters.Multiple redefinitions of this record are permitted.VALUE clauses for data items not in the first redefinition do not cause those data items to have an initial value when the program is placed into its initial state, but will be used for the INITIALIZE statement with the VALUE phrase.The MCS always references the record according to the data description defined in item 2f of the general rules for Format 3.
  • data-name-1, data-name-2, data-name-3, data-name-4, data-name-5 and data-name-6 must be unique within the CD entry. Within this series, any data-name may be replaced by the reserved word FILLER.

Input CD General Rules

The following general rules apply to Format 1:

  1. The input 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.
  2. For each input CD entry, a record area of 87 contiguous character positions is allocated.This record area is defined to the MCS as follows:
    • The SYMBOLIC QUEUE clause defines data-name-1 as the name of an elementary alphanumeric data item of 12 characters occupying positions 1 through 12 in the record.
    • 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 through 24 in the record.
    • 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 through 36 in the record.
    • 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 through 48 in the record.
    • The MESSAGE DATE clause defines data-name-5 as the name of a data item whose implicit description is that of an integer of six digits, without an operational sign, occupying character positions 49 through 54 in the record.
    • The MESSAGE TIME clause defines data-name-6 as the name of a data item whose implicit description is that of an integer of eight digits, without an operational sign, occupying character positions 55 through 62 in the record.
    • The SYMBOLIC SOURCE clause defines data-name-7 as the name of an elementary alphanumeric data item of 12 characters occupying positions 63 through 74 in the record.
    • 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 four digits, without an operational sign, occupying character positions 75 through 78 in the record.
    • The END KEY clause defines data-name-9 as the name of an elementary alphanumeric data item of one character occupying position 79 in the record.
    • The STATUS KEY clause defines data-name-10 as the name of an elementary alphanumeric data item of two characters occupying positions 80 and 81 in the record.
    • 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 six digits, without an operational sign, occupying character positions 82 through 87 in the record.
  3. The second option (data-name-1, data-name-2, . . ., data-name-11) 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:

    implicit description is equivalent

  4. The contents of data items referenced by data-name-2, data-name-3 and data-name-4, when not being used must contain spaces.
  5. The data items referenced by data-name-1, data-name-2, data-name-3 anddata-name-4 contain symbolic names designating queues, sub-queues, . . ., respectively.These symbolic names must follow the rules for the formation of system-names, and must have been previously defined to the MCS.
  6. 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.At the time of execution of a RECEIVE statement, the data-name-1 field in the input CD area must contain the name of a symbolic queue.The data items specified by data-name-2, data-name-3 and data-name-4 may contain symbolic sub-queue names or spaces.When a given level of the queue structure is specified, all higher levels must also be specified.If less than all the levels of the queue hierarchy are specified, the MCS determines the next message or portion of a message to be accessed within the queue or sub-queue specified in the input CD.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.
  7. 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.
  8. 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. During the execution of a RECEIVE statement, the MCS provides, in the data item referenced by data-name-5, the date on which it recognized that the message was complete in the form YYMMDD (year, month, day).The contents of the data item referenced by data-name-5 are not updated by the MCS other than as part of the execution of a RECEIVE statement
  11. During the execution of a RECEIVE statement, the MCS provides, in the data item referenced by data-name-6, the time at which it recognized that the message was complete in the form HHMM SShh (hours, minutes, seconds, hundredths of a second).The contents of the data item referenced by data-name-6 are not updated by the MCS other than as part of the execution of a 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 communication terminal that is the source of the message being transferred.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 through 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.
  14. The contents of the data item referenced by data-name-9 are set by the MCS only as part of the execution of a RECEIVE statement according to the following rules:
  15. When the RECEIVE MESSAGE phrase is specified:

    • 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 is transferred, the contents of the data item referenced by data-name-9 are set to 0.

    When the RECEIVE SEGMENT phrase is specified:

    • 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 is transferred, the contents of the data item referenced by data-name-9 are set to 0.
      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.
  16. 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 statement.
  17. The contents of the data item referenced by data-name-11 indicate the number of messages that exist in a queue, sub-queue-1, and so on.The MCS updates the contents of the data item referenced by data-name-11 only as part of the execution of an ACCEPT . . . MESSAGE COUNT statement.

Output CD General Rules

The following general rules apply to Format 2:

  1. 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 about the message being handled.
  2. A record area of contiguous character positions is allocated for each output CD.If the CD entry does not contain a DESTINATION TABLE OCCURS clause, the length of the allocated record area is 23 characters. If the CD entry does contain a DESTINATION TABLE OCCURS clause, the length of the allocated record area is 10 plus 13 times the value of integer-1.
  3. The implicit description of the allocated record area is:

    • 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 through 4 in the record.
    • 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 four digits, without an operational sign, occupying character positions 5 through 8 in the record.
    • The STATUS KEY clause defines data-name-3 to be an elementary alphanumeric data item of two characters occupying positions 9 and 10 in the record.

    Character positions 11 through 23 and every set of 13 characters thereafter will form table items of the following description:

    1. The ERROR KEY clause defines data-name-4 as the name of an elementary alphanumeric data item of one character.
    2. 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

  4. During the execution of a SEND, PURGE, ENABLE OUTPUT or DISABLE OUTPUT statement, the content 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, and so forth, up to and including the occurrence of the area referenced by data-name-5 that is indicated by the contents of data-name-1.If during the execution of a SEND, PURGE, 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-1, inclusive, an error condition is indicated, no action is taken for any destination, and the execution of the SEND, PURGE, ENABLE OUTPUT or DISABLE OUTPUT statement is terminated.The user must ensure that the value of the data item referenced by data-name-1 is valid at the time of the execution of the SEND, PURGE, ENABLE OUTPUT or DISABLE OUTPUT statement.
  5. As part of the execution of a SEND statement, the MCS will interpret the content 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 identifier in the SEND statement from which data is to be transferred.
  6. Each occurrence of the data item referenced by data-name-5 contains a symbolic destination name previously known to the MCS.These symbolic destination names must follow the rules for the formation of system-names.
  7. The content of the data item referenced by data-name-3 indicates the status condition of the previously executed SEND, PURGE, ENABLE OUTPUT or DISABLE OUTPUT statement.
  8. If, during the execution of a SEND, PURGE, ENABLE OUTPUT or DISABLE OUTPUT statement the MCS determines that an error has occurred, the content of the data item referenced by data-name-3 and all occurrences of the data items referenced by data-name-4 are updated.The content of the error key data item referenced by data-name-4, when nonzero, indicates that an error has occurred for the destination specified by the associated value in the symbolic destinationdata item referenced by data-name-5 .Otherwise, the content of the error key data item referenced by data-name-4 is set to zero.

Input-Output CD General Rules

The following general rules apply to Format 3:

  1. 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.
  2. For each input-output CD, a record area of 33 contiguous character positions is allocated.This record area is defined to the MCS as follows:
    • The MESSAGE DATE clause defines data-name-1 as the name of a data item whose implicit description is that of an integer of six digits, without an operational sign, occupying character positions 1 through 6 in the record.
    • The MESSAGE TIME clause defines data-name-2 as the name of a data item whose implicit description is that of an integer of eight digits, without an operational sign, occupying character positions 7 through 14 in the record.
    • The SYMBOLIC TERMINAL clause defines data-name-3 as the name of an elementary alphanumeric data item of 12 characters occupying positions 15 through 26 in the record.
    • The TEXT LENGTH clause defines data-name-4 as the name of an elementary data item whose implicit description is that of an integer of four digits, without an operational sign, occupying character positions 27 through 30 in the record.
    • The END KEY clause defines data-name-5 as the name of an elementary alphanumeric data item of one character occupying position 31 in the record.
    • The STATUS KEY clause defines data-name-6 as the name of an elementary alphanumeric data item of two characters occupying positions 32 and 33 in the record.

      The second option (data-name-1, data-name-2, . . ., data-name-6 ) may be used to replace the above clauses 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:

      Input-Output CD General Rules
  3. 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.
  4. data-name-1 has the format YYMMDD (year, month, day).Its contents represent the date on which the MCS recognizes that the message is complete.
  5. The contents of the data item referenced by data-name-1 are updated only by the MCS as part of the execution of a RECEIVE statement.

  6. data-name-2 has the format HHMMSShh (hours, minutes, seconds, hundredths of a second) and its contents represent the time at which the MCS recognizes that the message is complete.
  7. The contents of the data item referenced by data-name-2 are updated only by the MCS as part of the execution of a RECEIVE statement.

  8. 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.
  9. In all other cases, the contents of the data item referenced by data-name-3 of the input-output CD associated with the INITIAL clause are initialized to spaces.

    The symbolic name is inserted, or the initialization to spaces is completed, prior to the execution of the first Procedure Division statement.

  10. If the MCS attempts to schedule a program lacking an INITIAL clause, the results are undefined.
  11. When the INITIAL clause is specified for an input-output CD and the program is scheduled by the MCS, the contents of the data item referenced by data-name-3 must not be changed by the program.If the contents are changed, the execution of any statement referencing cd-name is unsuccessful, and the data item referenced by data-name-6 is set to indicate unknown source or destination, as applicable.
  12. 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.
  13. After executing the first statement referencing cd-name, the contents of the data item referenced by data-name-3 must not be changed by the program.If the contents are changed, the execution of any statement referencing cd-name is unsuccessful, and the data item referenced by data-name-6 is set to indicate unknown source or destination, as applicable.

  14. The MCS indicates, through the contents 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.
  15. As part of the execution of a SEND statement, the MCS interprets the contents of the data item referenced by data-name-4 as 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 transferred.

  16. The contents of the data item referenced by data-name-5 are set only by the MCS as part of the execution of a RECEIVE statement according to the following rules:
  17. When the RECEIVE MESSAGE phrase is specified:

    • If an end of group has been detected, the contents of the data item referenced by data-name-5 are set to 3.
    • If an end of message has been detected, the contents of the data item referenced by data-name-5 are set to 2.
    • If less than a message is transferred, the contents of the data item referenced by data-name-5 are set to 0.

    When the RECEIVE SEGMENT phrase is specified:

    • If an end of group has been detected, the contents of the data item referenced by data-name-5 are set to 3.
    • If an end of message has been detected, the contents of the data item referenced by data-name-5 are set to 2.
    • If an end of segment has been detected, the contents of the data item referenced by data-name-5 are set to 1.
    • If less than a message is transferred, the contents of the data item referenced by data-name-5 are set to 0.

    When more than one of the conditions is satisfied simultaneously, the rule first satisfied in the order listed determines the contents of the data item referenced by data-name-5.

  18. The contents of the data item referenced by data-name-6 indicate the status condition of the previously executed PURGE, RECEIVE or SEND statement

Status Key Conditions

Table indicates the possible content of the data item referenced by data-name-10 (Format 1), data-name-3 (Format 2), or data-name-6 (Format 3) at the completion of each statement shown.A ¦ symbol on a line in a statement column indicates that the associated code shown for that line is possible for that statement.

Communication Status Key Conditions

Communication Status Key Conditions

Communication Status Key Conditions

Error Key Values

Table indicates the possible content of the data item referenced by data-name-4 (Format 2) at the completion of each statement shown.A ¦ symbol on a line in a statement column indicates that the associated error key value shown for that line is possible for that statement.

Error Key Values

Error Key Values



Face Book Twitter Google Plus Instagram Youtube Linkedin Myspace Pinterest Soundcloud Wikipedia

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

COBOL Topics