Close Routine; Figure 4.2. Return Codes From The Cobol Communication Library Routines - IBM 5280 Programmer's Manual

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

Advertisement

Close Routine
return-code is a two-digit completion code returned by the Open routine after
execution; the codes that can be returned and their meanings are given in
figure 4.2.
buffer-size is the length in bytes of the records to be read or the maximum
length of records to be written.
buffer-2 is a 01 level data-item which you define in the Data Division of your
program for the area from which data is to be sent or in which data is to be
received.
An example of the statements used to call the Open routine is shown at
m
in
figure 4.4. Note that the CALL statement points to the parameter list
OPEN-READ-WRITE-PARAMS at
fJ
and the buffer EMPRECD at
II,
defined in the Data Division.
[J'
For SNA users: If the host requires logon data, the first 80 bytes of buffer-2
must contain the data when the Open routine is invoked in the program.
[J'
For switched line users: A timeout may occur which causes a line drop if data
transfer doesn't take place within a specified amount of time. You might
want to prompt the operator with a STOP statement, as is shown at
II
in
figure 4.4, to ensure the stations are connected.
For BSC, a line connection with the remote station should be made
immediately before the first READ or WRITE; for SNA, before the OPEN.
Code
Meaning
00
Execution was successful.
04
For the Read routine only. End of data. Successful completion.
08
Exception condition. Conditions on the line or at the remote station
caused an unsuccessful completion of the last message, but there is no
error in the COBOL program.
12
Application error. An error in the logic of the COBOL communication
statements. For example: the program attempted to call the Read
routine without having previously called the Open routine.
16
Permanent error. An unrecoverable error in, for example, the hardware,
CAM, the line, etc., has been found.
Figure 4.2. Return codes from the COBOL communication library routines.
The format of a call to the Close routine is:
CALL" AVCHCLOZ" USING parameter-1
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
foliowing format:
01
parameter-1
02
return code
02
FILLER
PIC 99.
PIC 9999.
02
close-option
PIC A.
4- 4
IBM 5280 COBOL Programmer's Guide

Advertisement

Table of Contents
loading

Table of Contents