Figure 9.1. Coding Example With Cobol Debugging Language - IBM 5280 Programmer's Manual

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

Advertisement

where the statements, beginning with SUBTRACT, execute.
You can control whether or not this procedure executes through the debug
option when you load the program. See "Prompts for Run-Time Options" in
Chapter 8 for more information.
The debugging lines (a D in column 7) at
II
are compiled and execute as any
other source statement. The use of debugging lines is another method of
tracing program flow during execution. Debugging lines will execute
regardless of what you specify as the debug option when the program is
loaded.
IDENTIFICATION DIVISION.
PROGRAM-ID.
UPEMPMAS.
AUTHOR.
A NAME.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
II
SOURCE-COMPUTER. IBM-370 WITH DEBUGGING MODE.
OBJECT-COMPUTER. IBM-5280.
SPECIAL-NAMES.
ATTRIBUTE-DATA IS TERMINAL-INFO.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT SCREEN-FILE-PR3 ASSIGN TO WORKSTATION 1920
ORGANIZATION IS TRANSACTION
ACCESS MODE IS SEQUENTIAL
FILE STATUS IS TUBE-STAT
CONTROL-AREA IS WSTATION-CONTROL-AREA.
SELECT EMPMAS-FILE ASSIGN TO DISK
ORGANIZATION IS RELATIVE
ACCESS MODE IS RANDOM
RELATIVE KEY IS RKEY
FILE STATUS IS DISK-STAT.
DATA DIVISION.
PROCEDURE DIVISION.
DECLARATIVES.
EI
DEBUG-SECTION SECTION.
USE FOR DEBUGGING ON READ-MASTER.
DISPLAY "READ-MASTER ENTERED".
DISPLAY "REKEY- " RKEY.
DISPLAY "EMPNO- " EMPNO.
IO-ERROR SECTION.
USE AFTER ERROR PROCEDURE ON SCREEN-FILE-PR3.
WORK-STATION.
DISPLAY "ERROR ON WORK STATION 1/0".
DISPLAY "FILE STATUS IS " TUBE-STAT.
DISPLAY "RUN STOPPED.".
STOP RUN.
DISKETTE-IO-ERROR SECTION.
USE AFTER ERROR PROCEDURE ON EMPMAS-FILE.
DISKETTE.
DISPLAY "ERROR ON DISKETTE 1/0".
DISPLAY "FILE STATUS IS " DISK-STAT.
DISPLAY "RUN STOPPED." .
STOP RUN.
END DECLARATIVES.
Figure 9.1. Coding example with COBOL debugging language (Part 1 of 2)
Chapter 9. Debugging
9- 5

Advertisement

Table of Contents
loading

Table of Contents