Communication Routine Parameters; Communication Program Example - Explanation; Open Routine; Figure 4.1. The Cobol Library Routines That Perform Data Communications - IBM 5280 Programmer's Manual

Distributed data system, cobol
Hide thumbs Also See for 5280:
Table of Contents

Advertisement

Routine
Function
AVCHOPEN
Open routine. Prepares for read and write operations between two
systems.
AVCHCLOZ
Close routine. Provides three options: (1) ends communications
operations or (2) signals an end-of-file to the receiver and the beginning
of a new file or (3) turns around the direction of transmission from send
to receive.
AVCHREAD
Read routine. Reads a record into a buffer in the COBOL program from
the sending station.
AVCHWRT
Write routine. Writes a record from a buffer in the COBOL program to
the receiving station.
Figure 4.1. The COBOL library routines that perform data communications
These routines are invoked in the COBOL program with CALL statements.
The following sections explains how to code the CALL statements, the
parameters you must supply, and the information returned to your program
after the routines have executed.
Communication Routine Parameters
In each CALL to a communications routine, you point to a parameter list in
either the Working Storage Section or the Linkage Section of your program
(the detailed layouts of these areas are given in the routine descriptions that
follow).
Communication Program Example - Explanation
Open Routine
Figure 4.4 at the end of the chapter gives an example of a COBOL program
using data communications, both sending and receiving data; the program in
the example:
1. Reads records from a diskette file containing information for updating an
employee master file on line at another system.
2. Transmits the records to the remote system.
3. After sending all the update records, reads records sent by the remote
system confirming receipt and giving diagnostics, if any.
The text in the following section will refer to this example by numbered keys
in explaining the pertinent COBOL statements.
The following is the format of the CALL statement used to initiate the Open
routine:
CALL"AVCHOPEN"USINGparameter-1buffer-2
parameter-l points to a status area you code in either the Working Storage
Section or the Linkage Section in the Data Division of your program in the
following format:
01
parameter-1
02 return-code
02 FILLER
02 buffer-size
PIC 99.
PIC 9999.
PIC 9999.
Chapter 4. Data Communications Programming with COBOL
4- 3

Advertisement

Table of Contents
loading

Table of Contents