The communication facility provides the ability to access, process, and create messages or portions thereof. It provides the ability to communicate through a Message Control System (MCS) with local and remote communication devices.
Message Control System
The implementation of the communication facility requires that an MCS be present in the operating environment of the object program.
The MCS is the logical interface to the operating system under which the object program operates. The primary functions of the MCS are the following:
The first function that of interfacing the object program with the communication devices, is the most obvious to the user. In fact, the user may be unaware that the other two functions exist. Messages from communication devices are placed in input queues by the MCS while awaiting disposition by the object program. Output messages from the object program are placed in output queues by the MCS while awaiting transmission to communication devices. The structures, formats, and symbolic names of the queues are defined by the user to the MCS at some time prior to the execution of the object program. Symbolic names for message sources and destinations are also defined at that time. The user must specify, in the program, symbolic names that are known to the MCS.
During the execution of an object program, the MCS performs all necessary actions to update the various queues as required.
The object program interfaces with the MCS when it is necessary to send data, receive data, or to interrogate the status of the various queues that are created and maintained by the MCS.In addition, the object program may direct the MCS to establish or break the logical connection between the communication device and a specified portion of the MCS queue structure. The method of handling the physical connection is a function of the MCS.
Relationship of the Object Program to the Message Control System and Communication Devices
The interfaces that exist in a communication environment are established by the use of a CD and associated clauses in the Communication Section of the Data Division. There are two such interfaces:
The source program uses four statements to control the interface with the MCS:
The source program uses two statements to control the interface between the MCS and communication devices:
Invoking the Object Program
There are two methods of invoking an object program that makes use of the communication facility:
The only operating difference between the two methods is that MCS invocation causes the areas referenced by the symbolic queue and subqueue names in the specified CD to be filled.
Scheduled Initiation of the Object Program
An object program using the communication facility may be scheduled for execution through the normal means available in the operating environment of the program, such as job control language. In that case, the program can use three methods to determine what messages, if any, are available in the input queues:
Invocation of the Object Program by the Message Control System
It is sometimes desirable to schedule an object communication program only when there is work available for it to do. Such scheduling occurs if the MCS determines what object program is required to process the available message and subsequently causes that program to be scheduled for execution. Each object program scheduled by the MCS establishes a run unit. Prior to the execution of the object program, the MCS places the symbolic queue and subqueue names in the associated data items of the communication description entry that specifies the FOR INITIAL INPUT clause, or the MCS places the symbolic terminal name in the associated data item of the communication description entry that specifies the FOR INITIAL I-O clause.
A subsequent RECEIVE statement directed to that CD will result in the available message being passed to the object program.
Determining the Method of Scheduling
A source program can be written so that its object program can operate with either of the two modes of scheduling. The following technique may be used to determine which method was used to load the object program:
Concept of Messages and Message Segments
A message consists of an arbitrary amount of information, usually character data, whose beginning and end are defined or implied. As such, messages comprise the fundamental but not necessarily the most elementary unit of data to be processed in a communication environment.
Messages may be logically subdivided into smaller units of data called message segments, which are delimited within a message by means of end of segment indicators (ESI). A message consisting of one or more segments is delimited from the next message by means of an end of message indicator (EMI). In a similar manner, a group of several messages may be logically separated from succeeding messages by means of an end of group indicator (EGI). When a message or message segment is received by the program, a communication description interface area is updated by the MCS to indicate which, if any, delimiter was associated with the text transferred during the execution of that RECEIVE statement. On output the delimiter, if any, to be associated with the text released to the MCS during the execution of a SEND statement is specified or referenced in the SEND statement. Thus, the presence of these logical indicators is recognized and specified both by the MCS and by the object program; however, no indicators are included in the message text processed by programs.
A precedence relationship exists between the indicators EGI, EMI and ESI. EGI is the most inclusive indicator and ESI is the least inclusive indicator. The existence of an indicator associated with message text implies the association of all less inclusive indicators with that text. For example, the existence of the EGI implies the existence of EMI and ESI.
Concept of Queues
The following discussion applies only when the communication environment is established using a CD without the FOR I-O clause.
Queues consist of one or more messages from or to one or more communication devices. They form the data buffers between the object program and the MCS. Input queues are logically separate from output queues.
The MCS logically places in queues or removes from queues only complete messages. Portions of messages are not logically placed in queues until the entire message is available to the MCS. That is, the MCS does not pass a message segment to an object program until all segments of that message are in the input queue, even though the source program uses the SEGMENT phrase of the RECEIVE statement.For output messages, the MCS does not transmit any segment of a message until all of its segments are in the output queue. The number of messages that exist in a given queue reflects only the number of complete messages that exist in the queue.
The process by which messages are placed into a queue is called enqueueing. The process by which messages are removed from a queue is called dequeueing.
Independent Enqueueing and Dequeueing
It is possible that a message may be received by the MCS from a communication device prior to the execution of the object program. In this case, the MCS enqueues the message in the proper input queue until the object program requests dequeueing with the RECEIVE statement. It is also possible that an object program will cause the enqueueing of messages in an output queue, which are not transmitted to a communication device until after the object program has terminated. Two common reasons for such occurrences are as follows:
Enabling and Disabling Queues
Usually, the MCS enables and disables queues based on circumstances not necessarily related to the program, such as time of day or message activity. However, the program has the ability to enable and disable queues itself by using the ENABLE and DISABLE statements.
A key is required in both statements in order to prevent indiscriminate use of the facility by a user who is not aware of the total network environment, and who may, therefore, disrupt system functions by the untimely issuance of ENABLE and DISABLE statements. However, this action never interrupts a transmission.
In order to control more explicitly the messages being enqueued and dequeued, it is possible to define in the MCS a hierarchy of input queues, that is, queues comprising queues. Four levels of queues are available. In order of decreasing significance, the queue levels are named queue, sub-queue-1, sub-queue-2 and sub-queue-3.
COBOL Related Interview Questions
|VSAM Interview Questions||IBM - VSAM Interview Questions|
|IBM-CICS Interview Questions||JCL Interview Questions|
|IBM DB2 Interview Questions||IBM-JCL Interview Questions|
|DB2 Using SQL Interview Questions||IBM-JCL&VSAM Interview Questions|
|IBM Mainframe Interview Questions||COBOL, CICS, JCL, VSAM, DB2 Interview Questions|
|DB2 SQL Programming Interview Questions||IMS/DB Interview Questions|
|Mainframe DB2 Interview Questions|
Procedure Division Statements
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.