Contents
To the COBOL Programmer iii
Before Using This Guide iii
Scope of the Guide iii
Organization ofthe Guide iii
Objectives of the Guide iii
Writing A Work Station Application
iv
Data Communications
iv
Diskette
I/O
iv
Printer and Other
I/O
iv
Compiling a COBOL Program
on
the Host System v
Executing a COBOL Program on an IBM 5280 System v
Debugging COBOL Programs v
Related Publications v
References for Coding and Debugging COBOL Programs v
Coding Aids for Transaction
I/O
v
References for Executing a COBOL Program v
General References for IBM 5280 System Information v
Compilation Under
OS/VSl
vi
Compilation Under
OS/VS2
vi
Compilation Under
DOS/VSE
vi
Chapter
1.
Transaction
I/O
-Introduction
1-1
Defining Display Screens
1-1
Uses ofData Definition Statements
1-1
The Copy Library and Data Definition Statements
1-1
Copying Members
1-2
General Rules for Data Definition Statements
1-2
The COBOL Program and Data Definition Statements 1-2
Steps
in
Writing an Interactive Program
1-2
The Keyboard
1-5
Command and Function Key Codes
1-5
Function Keys
1-7
Attention
1-7
Auto Dup/Skip
1-8
Auto Enter
1-8
Character Advance
1-8
Character Backspace
1-8
Character Delete
1-9
Character Insert
1-9
Cursor Left
1-9
Cursor Right
1-9
Duplicate 1-10
End-of-Job 1-10
Enter/Record Advance 1-10
Field Advance 1-10
Field Backspace 1-10
Field Exit
1-11
Field Exit Minus
1-11
Hexadecimal 1-12
Record Advance 1-12
Record Backspace 1-12
Reset 1-12
Skip 1-12
System Request 1-13
Chapter
2.
Transaction
I/O
-Screen Definition
2-1
Example ofCoding Data Definition Statements
2-1
Coding Conventions 2-9
Primary, Continuation, and Secondary Lines 2-9
Continuation Characters 2-9
Keywords 2-9
Constants 2-10
Comment Statements 2-10
Record Description Statements
2-11
Sequence Number Field (Columns 1 through 5)
2-11
Form Type Field (Column 6)
2-11
Name Type Field (Column 17)
2-11
Record Name Field (Columns
19
through 26)
2-11
Usage Field (Column 38)
2-11
Editing Field (Columns
45
through 80) 2-12
CHECK(DD)
2-12
DSPATR(attributes) 2-13
Field Description Statements 2-15
Sequence Number Field (Columns 1 through 5) 2-15
Form Type Field (Column 6) 2-15
Indicator Field (Columns 9 and 10) 2-15
Field
Name
Field (Columns
19
through 24) 2-15
Length Field (Columns 30 through 34) 2-16
Data Type Field (Column 35) 2-16
Decimal Positions Field (Column 37) 2-18
Usage Field (Column 38) 2-18
Location Field (Columns
39
through 44) 2-20
Editing Field (Columns
45
through 80) 2-21
CHECK
(parameters)
2-21
DSPATR (attributes) 2-22
PMT(message) 2-24
SHIFT(codes) 2-24
Keyword Conflicts and Compatibilities 2-25
Chapter 3. Transaction
I/O
-Writing the COBOL Program
3-1
Summary ofCOBOL Transaction
I/O
Statements
3-1
FILE-CONTROL
Paragraph
3-1
OPEN
3-2
WRITE
3-2
READ 3-3
Sequence ofTransaction
I/O
Statements 3-4
Clearing the Screen with
WRITE
3-4
CLOSE 3-4
I/O
Error Processing 3-4
Status Key 3-4
Coding the Status
Key
3-5
Exception/Error Procedures 3-5
Example Using Status Key and
ERROR
Procedures 3-5
Return Information 3-5
Attribute Data 3-6
Work Station Control Area 3-7
Transaction
I/O
Examples 3-7
Example -Interactive Entry and Processing 3-7
INDICATOR
Example 3-13
Chapter 4. Data Communications Programming With COBOL
4-1
Uses ofData Communications Programs
4-1
Eligible Systems
4-1
COBOL Programs and the Communications Access Method
4-1
COBOL Program Responsibilities 4-2
System Requirements for Communication Programs 4-2
Before Running a Data Communication Program 4-2
Writing COBOL Communication Statements 4-2
Communication Routine Parameters 4-3
Communication Program Example -Explanation 4-3
Open Routine 4-3
Close Routine 4-4
Read Routine 4-5
Write Routine 4-6
Communication Program Example -Listing 4-6
Chapter 5. Diskette Input/Output
5-1
Input-Output Summary
5-1
Contents
vii