Work Station I/O With Sequential I/O - Example; Figure 6.3. Example Of Statements Used For Sequential I/O To A Work Station - IBM 5280 Programmer's Manual

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

Advertisement

Work Station I/O with Sequential I/O - Example
Figure 6.3 shows an example of work station I/O using the sequential access
method and data set organization. The interaction between the program and
the operator is as follows:
1. The program issues a prompt for the operator to enter data.
2. The operator enters data and presses the Enter key.
3. The program writes the data back to the display screen.
4. The above steps are repeated until the operator enters EOF to indicate
end of data.
IDENTIFICATION DIVISION.
PROGRAM-ID.
ECHO.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER.
IBM-370.
OBJECT-COMPUTER.
IBM-5280.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT IN-FILE
ASSIGN TO WORKSTATION 1920.
SELECT PRINT-FILE
ASSIGN TO WORKSTATION 1920.
SELECT CLEAR-FILE
ASSIGN WORKSTATION 1920.
DATA DIVISION.
FILE SECTION.
FD
CLEAR-FILE LABEL RECORDS STANDARD
BLOCK CONTAINS 80.
01
CLEAR-REC.
05 CLEAR-1
PICTURE X( 10).
05 CLEAR-2
PICTURE x(70) .
FD
IN-FILE LABEL RECORDS STANDARD
BLOCK CONTAINS 80.
01
IN-REC.
05 FIRST-REC
PICTURE X( 10).
05 SECOND-REC
PICTURE x(70) .
FD
PRINT-FILE LABEL RECORDS STANDARD
BLOCK CONTAINS 80.
01
OUT-REC.
05
REC-ONE
PICTURE X(10).
PICTURE X(70).
05
REC-TWO
PROCEDURE DIVISION.
DECLARATIVES.
ERROR-HANDLING SECTION.
USE AFTER STANDARD ERROR PROCEDURE ON IN-FILE.
ERROR-ROUTINE.
DISPLAY "I/o ERROR ON IN-FILE".
CLOSE IN-FILE.
STOP RUN.
END DECLARATIVES.
Figure 6.3. Example of statements used for sequential I/O to a work station
(Part 1 of 2)
Chapter 6. Other I/0
6- 5

Advertisement

Table of Contents
loading

Table of Contents