Scobol
Scobol
Scobol
Pathway/iTS SCREEN
COBOL Reference
Manual
Abstract
This manual describes the SCREEN COBOL programming language, which Compaq
NonStop™ Pathway/iTS application programmers use to write programs that communicate with
operator terminals or intelligent devices and send data to users.
Product Version
Pathway/iTS 1.0
Ordering Information
For manual ordering information: domestic U.S. customers, call 1-800-243-6886; international customers, contact
your local sales representative.
Document Disclaimer
Information contained in a manual is subject to change without notice. Please check with your authorized
representative to make sure you have the most recent information.
Export Statement
Export of the information contained in this manual may require authorization from the U.S. Department of
Commerce.
Examples
Examples and sample programs are for illustration only and may not be suited for your particular purpose. The
inclusion of examples and sample programs in the documentation does not warrant, guarantee, or make any
representations regarding the use or the results of the use of any examples or sample programs in any
documentation. You should verify the applicability of any example or sample program before placing the software
into productive use.
U.S. Government Customers
FOR U.S. GOVERNMENT CUSTOMERS REGARDING THIS DOCUMENTATION AND THE ASSOCIATED
SOFTWARE:
These notices shall be marked on any reproduction of this data, in whole or in part.
NOTICE: Notwithstanding any other lease or license that may pertain to, or accompany the delivery of, this
computer software, the rights of the Government regarding its use, reproduction and disclosure are as set forth in
Section 52.227-19 of the FARS Computer Software—Restricted Rights clause.
RESTRICTED RIGHTS NOTICE: Use, duplication, or disclosure by the Government is subject to the
restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in Technical Data and Computer Software clause at
DFARS 52.227-7013.
RESTRICTED RIGHTS LEGEND: Use, duplication or disclosure by the Government is subject to restrictions
as set forth in paragraph (b)(3)(B) of the rights in Technical Data and Computer Software clause in
DAR 7-104.9(a). This computer software is submitted with “restricted rights.” Use, duplication or disclosure is
subject to the restrictions as set forth in NASA FAR SUP 18-52 227-79 (April 1985) “Commercial Computer
Software—Restricted Rights (April 1985).” If the contract contains the Clause at 18-52 227-74 “Rights in Data
General” then the “Alternate III” clause applies.
U.S. Government Users Restricted Rights — Use, duplication or disclosure restricted by GSA ADP Schedule
Contract.
Unpublished — All rights reserved under the Copyright Laws of the United States.
Compaq NonStop™ Pathway/iTS
SCREEN COBOL Reference
Manual
3. Identification Division
PROGRAM-ID Paragraph 3-1
DATE-COMPILED Paragraph 3-2
4. Environment Division
Configuration Section 4-1
SOURCE-COMPUTER Paragraph 4-2
OBJECT-COMPUTER Paragraph 4-2
SPECIAL-NAMES Paragraph 4-6
Input-Output Section 4-10
5. Data Division
Data Division Sections 5-2
Working-Storage Section 5-2
Linkage Section 5-3
Screen Section 5-4
Message Section 5-4
Data Structure 5-4
Level Numbers 01-49 5-5
Level Numbers 66, 77, and 88 5-5
Data Description Entry 5-6
Screen Description Entry 5-22
Base Screen 5-24
Screen Overlay Area 5-24
Overlay Screen 5-25
Screen Group 5-26
Screen Field 5-27
Input-Control Character Clauses 5-29
Field-Characteristic Clauses 5-33
Message Description Entry 5-60
FILLER Restrictions 5-61
FILLER Usage 5-61
PICTURE and TO/FROM/USING Restrictions 5-62
USER CONVERSION and PRESENT IF Restrictions 5-63
6. Procedure Division
Division Structure 6-1
Declarative Procedures 6-2
Sections 6-2
Paragraphs 6-3
Sentences and Statements 6-3
Procedures 6-4
Procedure Division Statements 6-4
7. Compilation
Running the SCREEN COBOL Compiler 7-1
Using Compiler-Generated Files 7-3
Using PARAM SAMECPU 7-3
Using PARAM SWAPVOL 7-4
Using Compiler Commands 7-5
Specifying Compiler Commands 7-5
When Compiler Commands Take Effect 7-5
Compiler Command Summary 7-6
Compiler Command Descriptions 7-7
Compilation Statistics 7-17
Stopping the Compiler 7-18
Conserving Disk Space 7-18
SCREEN COBOL Limits 7-19
A. Advisory Messages
Messages and Descriptions A-1
Modifying or Replacing the Advisory Message Routine A-4
B. Diagnostic Screens
C. SCREEN COBOL Compiler Diagnostic Messages
D. Errors for Message Section Statements
E. SCREEN COBOL Reserved Words
F. Data Type Correspondence and Return Value Sizes
Index
Examples
Example A-1. ADVISORY^MESSAGE Source Listing A-6
Example B-1. DIAG^FORMAT Parameter for Diagnostic Message Generation B-3
Example B-2. DIAGNOSTIC^MESSAGE Source Listing B-4
Figures
Figure 1-1. Operations Performed by SCREEN COBOL Programs 1-2
Figure 1-2. Multiple Terminal Control Through the TCP 1-5
Figure 1-3. Message Description Correspondence 1-6
Figure 1-4. Communication Between Processes in a PATHMON Environment 1-8
Figure 1-5. Generating SCREEN COBOL Object Files 1-9
Figure 1-6. Managing SCREEN COBOL Object Files With SCUP 1-10
Figure 1-7. Program Organizations 1-11
Figure 2-1. Tandem Standard Reference Format 2-11
Figure 2-2. ANSI Standard Reference Format 2-12
Tables
Table 2-1. SCREEN COBOL Character Set 2-4
Table 2-2. Editing Characters 2-5
Table 2-3. Punctuation Characters 2-5
Table 2-4. Separators 2-6
Table 2-5. Figurative Constants 2-9
Table 2-6. Binary Arithmetic Operators 2-14
Table 2-7. Unary Arithmetic Operators 2-14
Table 2-8. Digits Held for Intermediate Results 2-16
Table 2-9. Logical Operators 2-22
Table 2-10. Storage Occupied by COMPUTATIONAL Data Items 2-29
Table 4-1. System Names for Function Keys 4-7
Table 4-2. System Names for Display Attributes 4-8
Table 5-1. Data Description Entry PICTURE Character-String Symbols 5-11
Table 5-2. Storage Occupied by COMPUTATIONAL Data Items 5-19
Table 5-3. Screen Field Types and Allowable Field-Characteristic Clauses 5-28
Table 5-4. Effect of CONTROLLED Clause on Screen Field Display
Attribute 5-38
Table 5-5. Screen Description Entry PICTURE Character-String Symbols 5-48
Table 5-6. RETURN and ENTER Bit Values on Execution of an ACCEPT
Statement 5-54
Table 5-7. Effect of Shadowed Fields with DISPLAY Operation and
DYNAMIC Modifier 5-54
Table 5-8. Corresponding Shadow Item Values and Bit Values 5-55
Table 5-9. FIELD STATUS Clause Shadow Values 5-67
Table 5-10. Relationship Between Selected State and PRESENT IF 5-68
Table 5-11. Relevant SEND MESSAGE Edit Advisory Error Numbers 5-69
Table 5-12. Message Description Entry PICTURE Character-String Symbols 5-78
Table 5-13. Association Clauses and Message-Field Types 5-91
Table 6-1. Categories of Statements 6-5
Table 6-2. BEGIN-TRANSACTION Statement Errors 6-19
Table 6-3. CALL Statement Errors 6-21
Table 6-4. MOVE Summary Table 6-51
Table 6-5. PRINT SCREEN Statement Errors 6-58
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
vi
Contents Tables (continued)
Tables (continued)
Table 6-6. TERMINATION-SUBSTATUS Values for SEND MESSAGE
Statement 6-88
Table 6-7. Screen Field Selection Criteria in TURN Operation 6-104
Table 7-1. Compiler Option Commands 7-6
Table 7-2. Compiler Cross-Reference Commands 7-7
Table 7-3. Compiler Toggle Commands 7-7
Table F-1. Integer Types, Part 1 F-1
Table F-2. Integer Types, Part 2 F-2
Table F-3. Floating, Fixed, and Complex Types F-3
Table F-4. Character Types F-4
Table F-5. Structured, Logical, Set, and File Type F-4
Table F-6. Pointer Types F-5
Abstract
This manual describes the SCREEN COBOL programming language, which Compaq
NonStop™ Pathway/iTS application programmers use to write programs that
communicate with operator terminals or intelligent devices and send data to users.
Product Version
Pathway/iTS 1.0
Document History
Part Number Product Version Published
127341 Pathway/TS D42 August 1996
136664 Pathway/TS D42+ October 1997
139453 Pathway/TS D42+ January 1998
426750-001 Pathway/iTS 1.0 October 2000
Product Changes
This manual edition adds information about the CONVERT command, which converts a
SCREEN COBOL object program to a web client consisting of Java code and HTML
pages. This new information includes:
This manual edition reflects the following changes to Pathway/iTS:
• The new capability of Pathway/iTS to convert SCREEN COBOL object files to web
clients through the SCUP CONVERT command, as described in Managing Object
Files With SCUP on page 1-10.
• Filtering of 3161 timeout error messages when the ON ERROR clause is used with a
SEND MESSAGE statement, as described under TIMEOUT timeout-value on
page 6-82 in the description of the SEND MESSAGE statement.
Related Documentation
In addition to this manual, information about Pathway/iTS appears in the following
publications:
Compaq NonStop™ Describes managing a SCREEN COBOL library with the
Pathway/iTS SCREEN COBOL Utility Program (SCUP).
SCUP Reference Manual
Compaq NonStop™ Describes how to convert SCREEN COBOL requesters to
Pathway/iTS web clients, explains how to build and deploy those
Web Client clients, and also provides the information Java developers
Programming Manual and web designers need to to modify and enhance the Java
and HTML portions of the converted clients.
Compaq NonStop™ A guide for programmers who are writing SCREEN
Pathway/iTS COBOL requesters to be used in Pathway applications.
TCP and Terminal
Programming Guide
Compaq NonStop™ Describes the interactive management interface to the
Pathway/iTS Pathway/iTS product and describes how to manage
System Management Pathway/iTS objects.
Manual
Compaq NonStop™ Describes the management programming interface for
Pathway/iTS Pathway/iTS objects in the PATHMON environment.
Management
Programming Manual
Compaq NonStop™ Defines technical terms used in this manual and in other
Pathway Products manuals for the Pathway products: Pathway/iTS,
Glossary NonStop™ TS/MP, and Pathway/XM.
Operator Messages Describes all messages that are distributed by the Event
Manual Management Service (EMS), including those generated by
NonStop™ TS/MP and Pathway/iTS processes.
Notation Conventions
General Syntax Notation
The following list summarizes the notation conventions for syntax presentation in this
manual.
UPPERCASE LETTERS. Uppercase letters indicate keywords and reserved words; enter
these items exactly as shown. Items not enclosed in brackets are required. For example:
MAXATTACH
lowercase italic letters. Lowercase italic letters indicate variable items that you supply.
Items not enclosed in brackets are required. For example:
file-name
{ } Braces. A group of items enclosed in braces is a list from which you are required to
choose one item. The items in the list may be arranged either vertically, with aligned
braces on each side of the list, or horizontally, enclosed in a pair of braces and separated
by vertical lines. For example:
LISTOPENS PROCESS { $appl-mgr-name }
{ $process-name }
ALLOWSU { ON | OFF }
| Vertical Line. A vertical line separates alternatives in a horizontal list that is enclosed in
brackets or braces. For example:
INSPECT { OFF | ON | SAVEABEND }
… Ellipsis. An ellipsis immediately following a pair of brackets or braces indicates that you
can repeat the enclosed sequence of syntax items any number of times. For example:
M address-1 [ , new-value ]...
[ - ] {0|1|2|3|4|5|6|7|8|9}...
An ellipsis immediately following a single syntax item indicates that you can repeat that
syntax item any number of times. For example:
"s-char..."
Punctuation. Parentheses, commas, semicolons, and other symbols not previously described
must be entered as shown. For example:
error := NEXTFILENAME ( file-name ) ;
LISTOPENS SU $process-name.#su-name
Quotation marks around a symbol such as a bracket or brace indicate the symbol is a
required character that you must enter as shown. For example:
"[" repetition-constant-list "]"
Item Spacing. Spaces shown between items are required unless one of the items is a
punctuation symbol such as a parenthesis or a comma. For example:
CALL STEPMOM ( process-id ) ;
If there is no space between two items, spaces are not permitted. In the following
example, there are no spaces permitted between the period and any other items:
$process-name.#su-name
Line Spacing. If the syntax of a command is too long to fit on a single line, each continuation
line is indented three spaces and is separated from the preceding line by a blank line.
This spacing distinguishes items in a continuation line from items in a vertical list of
selections. For example:
ALTER [ / OUT file-spec / ] CONTROLLER
[ , attribute-spec ]...
Nonitalic text. Nonitalic letters, numbers, and punctuation indicate text that is displayed or
returned exactly as shown. For example:
Backup Up.
lowercase italic letters. Lowercase italic letters indicate variable items whose values are
displayed or returned. For example:
p-register
process-name
ACCEPT data
SEND message to server
Receive reply
DISPLAY data
CDT 001.CDD
PATHCOM
PATHCOM is the command interface that is used to define and manage other objects
controlled by the PATHMON process. PATHCOM supports several sets of object-
related commands. These commands describe which terminals are controlled by each
TCP, describe the capacity of the PATHMON environment by indicating the maximum
number of objects that can exist, start and stop objects, and display status and statistical
information.
SCREEN COBOL
SCREEN COBOL is the programming language used to define terminal displays and
process data entered at terminals. The language is similar to COBOL. SCREEN
COBOL and COBOL have the same program organization, coding conventions, and
language elements. Both languages have the same major divisions:
• Identification Division
• Environment Division
• Data Division
• Procedure Division
Data descriptions in the SCREEN COBOL Working-Storage and Linkage Sections are
the same format as those in COBOL.
Unlike COBOL, SCREEN COBOL provides features for screen handling and for
exchanging messages with intelligent devices. Note that the term intelligent
device as used within the context of Pathway/iTS covers a broad spectrum of entities
ranging from personal computers, automated teller machines, and point-of-sale devices
to Guardian operating environment processes and communication lines. In SCREEN
COBOL, a Screen Section or a Message Section replaces the COBOL File Section. The
Screen Section defines the data fields and other characteristics of a terminal screen; the
Message Section defines the messages sent to, and replies received from, an intelligent
device (or the process that controls it). SCREEN COBOL verbs allow you to display
and accept terminal screen data and to communicate with intelligent devices.
SCREEN COBOL source code is not compiled into machine-language instructions. The
source code is compiled into object code called pseudocode. The pseudocode for
SCREEN COBOL programs is stored in a library and interpreted by the terminal control
process.
TCP SCREEN
COBOL
Library
CDT 002.CDD
Requesters
Requesters usually provide presentation services for terminal devices and communicate
with server processes. Requesters may be tasks executing SCREEN COBOL code
within a (multithreaded) terminal control process, or they may be Pathsend processes
written in Transaction Application Language (TAL), C, COBOL85, or Pascal.
Pathway/iTS requesters are written as SCREEN COBOL programs. SCREEN COBOL
programs control screen displays, manage terminals, manage messages for intelligent
devices, and perform calls to other SCREEN COBOL programs. SCREEN COBOL
programs also send data to and receive replies from Pathway server processes. A
request to a server, generated by the execution of a SCREEN COBOL SEND statement,
is managed by a terminal control process (TCP).
Requester programs may also be written as Guardian processes in the Transaction
Application Language (TAL), C, COBOL85, or Pascal. Such requester programs include
calls to the Pathsend procedures provided as part of the NonStop™ TS/MP product. For
information about writing Pathsend requesters, refer to the NonStop™ TS/MP Pathsend
and Server Programming Manual.
Servers
Servers are programs written in C, C++, COBOL85, pTAL, TAL, FORTRAN, or Pascal
in the Guardian environment to respond to requests to perform database operations. The
requests are made in the form of interprocess messages. When a SCREEN COBOL
requester program is used, these messages are generated according to the statements in
the SCREEN COBOL program and sent by a TCP. Servers receive the requests,
perform database I/O functions, and return appropriate replies to the TCP.
A server is configured to be a member of a particular server class. The server class itself
has specific characteristics that are defined within the PATHMON configuration.
Individual servers within a server class use copies of the same server program code and
separate data areas; the PATHMON process creates new servers from a single server
program according to the configuration instructions.
A SCREEN COBOL program and its associated servers require corresponding message
descriptions. To ensure message description correspondence, both programs can use
common code for the description obtained from a source code library.
Figure 1-3 illustrates the message description correspondence between a SCREEN
COBOL requester and a COBOL server.
IDENTIFICATION DIVISION.
Data Descriptions
IDENTIFICATION DIVISION.
. .
. COBLIB .
. .
DATA DIVISION. DATA DIVISION.
WORKING-STORAGE SECTION. FILE SECTION.
COPY MESSAGE-IN OF COBLIB FD F-MESSAGE-IN
. MESSA GE-IN
LABEL RECORDS ARE OMITTED.
. COPY MESSAGE-IN OF COBLIB.
. .
.
.
CDT 003.CDD
CDT 003.CDD
Inspect
Inspect is an interactive symbolic program-debugging tool that you can use to examine
and modify SCREEN COBOL programs. Inspect runs as a separate process that
communicates through the TCP with the SCREEN COBOL program running on a
Pathway/iTS terminal. By issuing commands to Inspect, you can control and modify an
executing program.
Before you can use Inspect, the PATHMON environment must be configured for
communication with Inspect. In addition, a symbol-table file generated for the program
by the SCREEN COBOL compiler must be available to the TCP.
PATHCOM PATHMON
SCREEN
TCP
COBOL
Library
Server Class
Server Database
CDT 004.CDD
To execute a SCREEN COBOL program, the directory and code files must be available
to the TCP. The symbol-table file is required when INSPECT is used for program
debugging. In addition to generating object code, the compiler builds a SCREEN
COBOL library. Each time the compiler successfully compiles a source program, the
compiler adds the new version of the object file to the previously compiled versions.
The compiler, however, has no features for managing the object files.
Figure 1-5 illustrates the generating of SCREEN COBOL object files. In this figure,
input to the compiler includes the program source code and code copied from a screen
library file. The compiler output includes three object files (code, directory, and symbol
table) and a listing that can include a compilation listing, a cross-reference listing, and a
map.
Library
of screen SCREEN
Copies screen COBOL
definitions into definitions
Source
program unit
SCOBOLX2
SCOBOLX
SCREEN
COBOL SCREEN
Compiler COBOL
SYMSERV Source
Program unit
Listing
SCREEN
COBOL Directory Symbol
Object Code Table
CDT 005.CDD
Note. In earlier releases, the version of the TCP under which a SCREEN COBOL program
was executed had to be the same or later than that of the SCREEN COBOL compiler under
which the program was compiled. For D40 and later releases, the version of the TCP under
which a SCREEN COBOL program is executed can also be earlier than that of the SCREEN
COBOL compiler unless it uses newer incompatible features, in which case the program will be
assigned the version corresponding to the latest feature used. For example, you can now use
a C31 TCP with a SCREEN COBOL program compiled under a D40 compiler provided the
SCREEN COBOL program does not use any new incompatible features. New data structures,
new statements, and new versions of statements are often generated by a given release of the
compiler. These enhancements can be processed only by a TCP of the same or a later
release.
Commands:
INFO
ALTER
DELETE
COMPRESS SCUP
COPY
...
SCREEN
Directory Symbol
COBOL
Table
Object Code
Command:
CONVERT
SCUP
CDT 006.CDD
For further information about SCUP and how to use it, refer to the Compaq NonStop™
Pathway/iTS SCUP Reference Manual.
MENU PROG-A
PROG-C
CDT 007.CDD
Both organizations are hierarchical with entry to the group through a single program. In
the menu organization, the main menu screen displays a selection of operations, with
any selection resulting in a call to another simple SCREEN COBOL program that
handles one operation.
The chain organization consists of a series of programs. In the chain, the terminal
operator's selections can call PROG-B from PROG-A and PROG-C from PROG-B.
Program Organization
A SCREEN COBOL program is organized into four divisions that must appear in the
following order:
1. The Identification Division identifies the program. Comments such as the name of
the programmer, the date the program was written, and a description of the program
can be declared in this division.
2. The Environment Division specifies the program execution environment. Display
error attributes, processing options, computer equipment, and terminal equipment
can be described in this division.
3. The Data Division defines the program data structures in terms of their formats and
usage. In the Data Division are the following sections:
• The Working-Storage Section in this division describes data local to the
program.
• The Linkage Section describes data passed from another program.
• The Screen Section describes data displayed on and accepted from a terminal.
• The Message Section describes messages sent to and replies returned from an
intelligent device.
4. The Procedure Division specifies the processing steps of the program.
Language Elements
The SCREEN COBOL language elements fall into one of two categories:
• Character strings—strings of contiguous characters
• Separators—characters that separate one character string from another
The language elements that comprise the SCREEN COBOL source program are
described in the following paragraphs.
In addition, you can use characters from a double-byte character set if you specify the
CHARACTER-SET IS KANJI-KATAKANA clause in the OBJECT-COMPUTER
paragraph of the Environment Division. See the Compaq NonStop™ Pathway/iTS TCP
and Terminal Programming Guide for more information about double-byte character
sets.
Note. Existing program units that do not use double-byte characters need not specify the
CHARACTER-SET IS KANJI-KATAKANA clause (even if 1-byte Katakana characters are
used). If a program unit specifies the CHARACTER-SET IS KANJI-KATAKANA clause, 1-byte
Katakana or 2-byte Katakana character sets (or both) are supported, depending on the
terminal. Your application can use whichever Katakana character set is supported by the
terminal; however, Kanji characters are only supported for program units that specify the
CHARACTER-SET IS KANJI-KATAKANA clause.
Editing Characters
Editing characters are symbols that can be used in PICTURE clauses to format screen
data. Table 2-2 lists the editing characters.
Punctuation Characters
Punctuation characters are used to separate words, sentences, or special clauses, and to
group arithmetic relationships. Table 2-3 lists the punctuation characters.
Separators
Separators are strings of one or more punctuation characters; they can have leading or
trailing blanks. Table 2-4 lists and defines the separators.
Some character strings include punctuation characters, in which case those characters do
not act as separators. Any character in the ASCII character set can appear in a
nonnumeric literal, provided the character does not have special meaning to a hardware
device.
Reserved Words
A reserved word has special meaning for the compiler. A reserved word cannot be used
as a data item name or a system name. Reserved words are any of the following:
• Keywords
• Special registers
• Figurative constants
Reserved words must be spelled correctly and can be used only as specified in syntax.
User-Defined Words
A user-defined word can consist of any of the following characters:
• The letters A through Z
• The digits 0 through 9
• Hyphen (-)
A user-defined word must begin with a letter of the alphabet, must not begin or end with
a hyphen, and must not contain embedded spaces. User-defined words are used for the
following types of items:
• Procedure name
• Data name
• Mnemonic name
• Condition-name
• Program name
• Library name
• Text name
Note. A user-defined word cannot contain double-byte characters.
System Names
A system name is a SCREEN COBOL word that identifies part of the Guardian
operating environment. System names are defined for equipment and operating system
access. Use of each system name is restricted to a specific category, such as terminal
function key or display attribute.
Literals
A literal is a character string whose value is specified either by a set of characters or by
a reserved word that represents a figurative constant. A literal is numeric or
nonnumeric.
Numeric Literals
A numeric literal is one or more digits (0 through 9), a plus or minus sign, and an
optional decimal point. The value of the literal is the value of the digits. The following
rules apply to numeric literals:
• A numeric literal can have a maximum of 18 digits.
• One sign character is allowed and must be the first character. The absence of a sign
character indicates the literal is a nonnegative number.
• A numeric literal can have one decimal point, which can appear anywhere within the
literal except as the last character. The absence of a decimal point indicates that the
literal is an integer.
The following examples illustrate numeric literals:
• Integer numeric literals:
+601
-234116
0
15
• Noninteger numeric literals:
+601.1
89.6
0.0051
-.1
Nonnumeric Literals
A nonnumeric literal is any ASCII character string enclosed in quotation marks. The
value of the literal is the string of characters between the quotation marks. The
following rules apply to nonnumeric literals:
• Nonnumeric literals can have a maximum length of 120 characters, not including the
surrounding quotation marks.
• If a quotation mark is part of the literal, it must be represented in the string as two
contiguous quotation marks. Only one of these two quotation marks is included in
the character count.
The following example illustrates a nonnumeric literal:
"THIS IS A NONNUMERIC LITERAL"
"12345 THIS IS A NONNUMERIC LITERAL ALSO"
The following example illustrates a nonnumeric literal with an embedded quotation
mark:
"A "" IS PART OF THIS NONNUMERIC LITERAL"
Figurative Constants
A figurative constant is a constant that has been prenamed and predefined for the
SCREEN COBOL compiler so that it can be written in the source program without
having to be defined in the Data Division. Figurative constants do not require quotation
marks. Table 2-5 lists and defines the figurative constants. The singular and plural
forms of the various figurative constants are equivalent in meaning.
Mixed data items are allowed in the Working-Storage Section, the Linkage Section, and
the Screen Section. A PIC X(10) field can contain, for example, any of the following
(without truncation):
• Five 2-byte characters and no other alphanumeric characters
• Four 2-byte characters and one or two 1-byte Katakana or other alphanumeric
characters
• Three 2-byte characters and one to four 1-byte Katakana or other alphanumeric
characters
• Two 2-byte characters and one to six 1-byte Katakana or other alphanumeric
characters
• One 2-byte character and one to eight 1-byte Katakana or other alphanumeric
characters
• No 2-byte characters and one to ten 1-byte Katakana or other alphanumeric
characters
If the data item contains less than the maximum number of characters allowed, the
appropriate number of padding space characters is added to the right.
Reference Format
A SCREEN COBOL source program can be written in Tandem standard reference
format (specific to Compaq NonStop™ Himalaya systems) or ANSI standard reference
format. The Tandem standard reference format has no sequence number field (columns
1-6), has no identification field (columns 73-80), and is restricted to lines of up to 132
characters.
Although the SCREEN COBOL compiler assumes Tandem standard reference format, a
SCREEN COBOL program can be written in either format or in a combination of both.
Refer to source text options in Running the SCREEN COBOL Compiler on page 7-1
for information regarding format specification.
1 2 3 4 5 6 7 8 9 10 ... 132
• Division, section, and paragraph headers must begin in Area A. The first sentence
of a paragraph can begin on the same line as the paragraph header, provided at least
one space follows the period terminator of the paragraph name.
• In general, SCREEN COBOL ignores the distinction between Area A and Area B.
The lexical elements of a source program can occur anywhere between Margin A
and Margin B.
• Level numbers 01 and 77 must begin in Area A.
• Level numbers 02-49, 66, and 88 can begin in either Area A or Area B.
• Area A of a continuation line should always be left blank.
• An * or / in the indicator field indicates a comment; a - indicates continuation;
a ? indicates a compiler command line. If any other character appears in the
indicator field, the last character in the preceding line is assumed to be followed by a
space.
The positions following Margin R (73 through 80) represent the identification field.
Their contents, which can include any ASCII character, are treated as a comment, and
have no effect on the meaning of the program.
Figure 2-2 shows the ANSI standard reference format.
1 2 3 4 5 6 7 8 9 10 11 12 13 ... 72 73 ... 80
CDT 009.CDD
• Division, section, and paragraph headers must begin in Area A. The first sentence
of a paragraph can begin on the same line as the paragraph header, provided at least
one space follows the period terminator of the paragraph name.
• In general, SCREEN COBOL ignores the distinction between Area A and Area B.
The lexical elements of a source program can occur anywhere between Margin A
and Margin B.
• Level numbers 01 and 77 must begin in Area A.
• Level numbers 02-49, 66, and 88 can begin in either Area A or Area B.
• An * or / in the indicator field indicates a comment; a - indicates continuation;
a ? indicates a compiler command line. If any other character appears in the
indicator field, the last character in the preceding line is assumed to be followed by a
space.
Comment Lines
Comment lines can appear anywhere in a SCREEN COBOL program. Comment lines
are indicated by an asterisk (*) or forward slash (/) character in the indicator field, which
is column 1 in the Tandem standard reference format and column 7 in the ANSI
standard reference format. These special characters indicate that the entire line is a
comment.
When a listing of the program is printed, with comment lines indicated by a forward
slash (/), a page eject is performed before printing the comment line.
Continuation Lines
Any word or literal in a SCREEN COBOL program can be continued. Continuation
lines are indicated by the hyphen character in the indicator field.
If the previous line has a nonnumeric literal without a closing quotation mark, the first
nonblank character in Area B of the continuation line must be a quotation mark. The
continuation begins with the character immediately following that quotation mark.
Arithmetic Operations
Arithmetic operations are specified in the Procedure Division with the ADD,
COMPUTE, DIVIDE, MULTIPLY, and SUBTRACT statements. These operations
have the following common features:
• The data descriptions of the operands do not have to be the same. Any necessary
conversion and decimal point alignment is supplied throughout the calculation.
• The maximum size of each operand is 18 decimal digits.
• Each arithmetic operation is evaluated using an intermediate data item. If the size of
the result being developed is larger than this intermediate data item, the SCREEN
COBOL program will be suspended by the TCP with an arithmetic overflow error.
The contents of the intermediate data item are moved to the receiving data item
according to the rules of a MOVE statement.
When a sending and receiving item in an arithmetic statement share part of their storage
areas, the result is undefined.
Arithmetic Expressions
An arithmetic expression is one of the following:
• A numeric elementary item
• A numeric literal
• A numeric elementary item and a numeric literal separated by arithmetic operators
• An arithmetic expression enclosed in parentheses
Data items and literals appearing in an arithmetic expression must be either numeric
elementary items or numeric literals on which arithmetic operations can be performed.
Any arithmetic expression can be preceded by a plus or minus sign.
Arithmetic Operators
Five binary arithmetic operators and two unary arithmetic operators are used in
arithmetic expressions. These operators are represented by specific characters and must
be preceded and followed by a space. Table 2-6 lists binary arithmetic operators.
Table 2-7 lists unary arithmetic operators.
When a plus or minus sign immediately precedes a numeric literal (with no intervening
spaces) the sign becomes a part of that literal, making it a signed numeric literal. The
sign is neither a binary or unary operator. For example,
X +2
is equivalent to:
X, +2
which is two separate expressions.
A plus sign in any other situation is treated as a binary operator if it is preceded by an
operand, and treated as a unary operator if it is not preceded by an operand. For
example, the following are equivalent expressions:
X + 2
X + + 2
Evaluation of Expressions
Parentheses can be used to specify the order in which the operations of an arithmetic
expression are performed. Expressions within parentheses are evaluated first.
Evaluation of expressions within nested parentheses proceeds from the innermost set to
the outermost set. When parentheses are not used, or expressions in parentheses are at
the same level, the order of execution is as follows:
1. Unary plus and minus
2. Multiplication and division
3. Addition and subtraction
Parentheses are used to eliminate ambiguities in logic or to modify the normal sequence
of execution in expressions where it is necessary to have some deviation. When the
sequence of execution is not specified by parentheses, the order for consecutive
operations at the same level is from left to right. The following example illustrates the
normal evaluation order in the absence of parentheses:
a + b / c + d * f - g
is interpreted as:
(a + (b / c)) + (d * f) - g
with the sequence of operations proceeding from the innermost parentheses to the
outermost. Expressions ordinarily considered ambiguous, such as:
a / b * c, a / b / c
are permitted in SCREEN COBOL. They are interpreted as if they were written:
(a / b) * c, (a / b) / c
Data items and literals appearing in an arithmetic expression must represent either
numeric elementary data items or numeric literals.
Multiple Results
The ADD, COMPUTE, MULTIPLY, and SUBTRACT statements can have multiple
results. Such statements behave as though they had been written in the following way:
1. One statement performs all necessary arithmetic to arrive at a result, and stores that
result in a temporary storage location.
2. A sequence of statements transfers or combines the value of this temporary location
with each result. These statements are considered to be written in the same left-to-
right sequence in which the multiple results are listed.
For example, the result of the following statement:
ADD a, b, c TO c, d(c), e
is equivalent to:
ADD a, b, c GIVING temp
ADD temp TO c
ADD temp TO d(c)
ADD temp TO e
where temp is the temporary storage location.
Intermediate Results
Intermediate results are maintained by SCREEN COBOL during the evaluation of
arithmetic expressions. The maximum number of digits held for an intermediate result
is 18. If this limit is exceeded, arithmetic overflow occurs. Table 2-8 uses the following
abbreviations to explain intermediate operations:
• IR—the number of integer places carried for an intermediate result
• DR—the number of decimal places carried for an intermediate result
• OP1—the first operand in an arithmetic expression, which has the form
9(I1)V9(D1), where:
° I1 is the number of integer places carried.
° D1 is the number of decimal places carried for the first operand.
• OP2—the second operand in an arithmetic expression, which has the form
9(I2)V9(D2), where:
° I2 is the number of integer places carried.
° D2 is the number of decimal places carried for the second operand.
• OPR—the desired result, which has the form 9(IR)V9(DR), where IR is the number
of places carried for the integer result and DR is the number of places carried for the
decimal result
Note. If (I1+D2+DR) is greater than 18, the low-order digits of the quotient are lost; in other
words,any part of the quotient less than the following number is lost: 10 ** (I1+D2+DR-18)
Example 1
A normal divide computation proceeds as follows:
03 A1 PIC S9(9)V9(9) VALUE 2.
03 A2 PIC S9(9)V9(8) VALUE 3.
03 AR PIC SV9(9).
:
DIVIDE A1 BY A2 GIVING AR.
where:
____________
3.00000000 | 2.000000000
is computed as:
000000000.666666666
000000003.00000000 | 2.00000000000000000
then moved to AR as:
.666666666
Example 2
Here is a second example:
03 A1 PIC S9(2)V9(9) VALUE 2.
03 A2 PIC S9(2)V9(8) VALUE 3.
03 AR PIC SV9(9).
:
DIVIDE A1 BY A2 GIVING AR.
where:
____________
3.00000000 | 2.000000000
is computed as:
000000000.666666666
03.00000000 | 02.0000000000000000
then moved to AR as:
.666666666
When a division operation in an arithmetic expression involves a COMPUTE statement
or a relational expression, the intermediate results are evaluated in two steps:
1. The actual division
2. The adjustment of that result for use in further computations
Example 3
In the following example, with either of the following:
COMPUTE AX = A1/A2 + A3 * A4.
IF A1/A2 + A3 * A4 LESS THAN AX GO TO ...
the division is performed before further evaluation of either of the above statements.
The intermediate result is then adjusted to fit the conceptual PICTURE derived by
examining the other operands in the expression.
Incompatible Data
An incompatible data condition occurs when a data item is referenced by a statement in
the Procedure Division and that item contains characters not permitted by the statement.
For example, if a position in a display numeric item contains an alphabetic character, A,
and that item is used as an operand in an ADD statement, an incompatible data condition
occurs. The result of this reference is undefined.
The class condition test is an exception to this rule because its purpose is to determine
whether or not items contain legal data.
Conditional Expressions
Conditional expressions identify conditions that are tested by the program to select
between alternate paths of control. Conditional expressions are specified in the IF and
PERFORM statements.
The two categories of conditions for conditional expressions are: simple conditions and
complex conditions. Either kind of condition can be enclosed within any number of
paired parentheses without changing the category of the condition.
Simple Conditions
Simple conditions are of four kinds:
• Class conditions
• Condition-name conditions
• Relation conditions
• Sign conditions
Simple conditions have a truth value of true or false. Parentheses can enclose a simple
condition without changing the truth value of the condition.
Class Condition
The class condition determines whether a DISPLAY item value is numeric or alphabetic.
Class condition syntax is:
When NOT is included, the test condition is reversed. NOT NUMERIC tests for a field
being nonnumeric; NOT ALPHABETIC tests for a field being nonalphabetic.
The NUMERIC test cannot be used with an item described as alphabetic. The
NUMERIC test cannot be used with a group item composed of elementary items with
data descriptions that include operational signs. If the data item being tested is signed,
the item is numeric only if the contents are numeric and a valid sign is present. If the
item is not signed, the item passes the test only if the contents are numeric and no sign is
present. Valid signs for items with SIGN IS SEPARATE clause are + and -.
The ALPHABETIC test cannot be used with an item described as numeric.
Condition-Name Condition
A condition-name condition determines whether or not the value of a conditional
variable is equal to one of the values predefined for the condition-name.
Condition-name condition syntax is:
condition-name
The condition-name must be a level 88 item defined in the Data Division and given
a value or a range of values.
The condition is true if the value of the conditional variable is equal to one of the
condition-name values or falls within one of the ranges of values (including both
ends of the range) given with condition-name.
Relation Condition
A relation condition causes a comparison of two values. Each value can be a data item,
a literal, or a value resulting from an arithmetic computation; both values cannot be
literals. A relation condition has a truth value of true if the relation exists between the
values.
Relation condition syntax is:
The relational operators <, =, > (less than, equal to, greater than) determine the type of
comparison made. A space must precede and follow each word of the relational
operator. When NOT is included, the word NOT and the next keyword or relation
character are one operator. NOT EQUAL is a truth test for an unequal comparison;
NOT GREATER is a truth test for an equal or less comparison.
Two numeric values can be compared regardless of their usage (as defined by a USAGE
clause). For all other comparisons, however, the values must have the same usage. If
either of the values is a group item, nonnumeric comparison rules apply.
data item of the same size as the numeric data item; the content of this
alphanumeric data item is then compared to the nonnumeric operand.
• If the nonnumeric operand is a group item, the numeric operand is treated as though
it were moved to a group item of the same size as the numeric data item; the content
of this group item is then compared to the nonnumeric operand.
Sign Condition
The sign condition determines whether or not the algebraic value of an arithmetic
expression is greater than, less than, or equal to zero.
Sign condition syntax is:
Complex Conditions
Complex conditions are formed by using simple conditions, combined conditions and/or
complex conditions with logical connectives AND or OR, or by negating these
conditions with the keyword NOT. The truth value of a complex condition, whether or
not the value is enclosed in parentheses, is that truth value which results from the
interaction of all the logical operators on the individual truth values of simple
conditions, or on the intermediate truth values of conditions connected or negated.
Table 2-9 lists and defines the logical operators.
NOT simple-condition
If NOT appears within the abbreviated condition and is not followed by an operator, the
keyword negates that portion of the condition, but does not automatically carry forward
to the next relation. The following examples illustrate abbreviated combined relation
conditions and their expanded equivalents.
Abbreviated Combined Relation
Condition Expanded Equivalent
a > b AND NOT < c OR d ((a > b) AND (a NOT < c))
OR (a NOT < d)
a NOT EQUAL b OR c (a NOT EQUAL b) OR (a NOT EQUAL c)
NOT a = b OR c (NOT (a = b)) OR (a = c)
NOT (a GREATER b OR < c) NOT ((a GREATER b) OR (a < c))
NOT (a NOT > b AND c NOT ((((a NOT > b)
AND NOT d) AND (a NOT > c))
AND (NOT (a NOT > d))))
(a + b - c) > d (a + b - c) > d
AND NOT < e OR f AND (a + b - c) NOT < e
OR (a + b - c) NOT < f
Tables
Tables of data are common in data processing problems. For example, a data structure
might have 20 total fields, described as twenty identical data items named total-one,
total-two, ..., total-twenty. This would mean twenty different names, which could
obscure the interrelated nature of the totals and make references awkward. A table
structure simplifies this situation.
Tables are defined with an OCCURS clause in their data description. This clause
specifies that an item is repeated as many times as stated. The item is considered to be a
table element, and its name and description apply to each repetition. For example, the
one-dimensional table mentioned in the preceding paragraph could be defined with this
entry:
02 total OCCURS 20 TIMES ...
In the Screen Section, a table must be an elementary item. In the Working-Storage
Section and Linkage Section, the elements of a table can be groups of subordinate
structures, some of which can also be tables. Thus, the previous example might appear
in greater detail as:
02 total-g OCCURS 20 TIMES.
03 total-a ...
03 total-b OCCURS 3 TIMES ...
The expanded example describes total-a as a one-dimensional table, and describes total-
b as a two-dimensional table because an OCCURS clause is applied to an item
subordinate to the first OCCURS clause. If the description of a data item subordinate to
total-b also had an OCCURS clause, the item would be a three-dimensional table.
SCREEN COBOL allows a maximum of three dimensions in the Working-Storage
Section and Linkage Section.
Frequently, tables are built in the Working-Storage Section with constant values that a
program needs in addition to the data from external sources. An example of coding for a
table containing the full calendar month names is:
WORKING-STORAGE SECTION.
01 month-name-table.
05 FILLER PIC X(9) VALUE "JANUARY".
05 FILLER PIC X(9) VALUE "FEBRUARY".
05 FILLER PIC X(9) VALUE "MARCH".
05 FILLER PIC X(9) VALUE "APRIL".
05 FILLER PIC X(9) VALUE "MAY".
05 FILLER PIC X(9) VALUE "JUNE".
05 FILLER PIC X(9) VALUE "JULY".
05 FILLER PIC X(9) VALUE "AUGUST".
05 FILLER PIC X(9) VALUE "SEPTEMBER".
05 FILLER PIC X(9) VALUE "OCTOBER".
05 FILLER PIC X(9) VALUE "NOVEMBER".
05 FILLER PIC X(9) VALUE "DECEMBER".
01 month-name-rtable REDEFINES month-name-table.
05 month-name OCCURS 12 TIMES PIC X(9).
The term FILLER is a keyword that takes the place of a data name when it is
unimportant to name an item. Because occurrences of a table element do not have
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
2- 24
SCREEN COBOL Source Program Data Reference
individual names, a reference to an occurrence must give its position number along with
the data name of the table. The method of giving the position number, called
subscripting, is described later in this section.
Data Reference
All items must be named so they can be referenced. Items given unique names can be
referenced with no difficulty, but many programs contain items that do not have unique
names. All elements of a table, for example, share a single name. Also, the same name
can be used for more than one data item, and the same paragraph name can be used in
different sections of the Procedure Division.
Names must be unique or made unique through qualification or subscripting.
Qualification
Every name must be unique, either because no other name has the same spelling and
hyphenation, or because the name is subordinate to a unique name. In the latter case,
including one or more of the higher-level names qualifies the subordinate item and
makes it unique. Although enough qualification must be present to make a name
unique, it is not necessary to include all levels.
• For data name references, group names can be used for qualification. Level 01
names are the most significant qualifiers, then level 02, and so forth.
• For condition-name references, the name of the condition variable can be used as
qualification, even if the variable is an elementary item.
• For paragraph name references, the section name is the only qualifier available.
References to paragraphs within the same section never require qualification.
• For copy text references in COPY statements, the copy text name must be qualified
if the text library that defines it is not the default library for the compilation.
• Level 01 names and section names must be unique because they cannot be further
qualified. Regardless of available qualification, a name cannot be both a data name
and a procedure name.
An item is qualified by following a data name, a condition-name, a paragraph name, or a
copy text name by one or more phrases composed of a qualifier preceded by connective
IN or OF. IN and OF are equivalent.
Qualification syntax is:
paragraph-name [ { OF } section-name ]
[ { IN } ]
copy-text [ { OF } library-name ]
[ { IN } ]
Subscripting
Subscripts are used to reference elements in a table. They are needed because all table
elements have the same name.
The subscript can be an integer numeric literal or a data item that represents a numeric
integer. When the subscript is a data item, the data item name can be qualified but not
subscripted itself. The subscript can be signed and, if signed, it must be positive.
The lowest possible subscript value is 1. This value selects the first element of a table.
The other elements of the table are selected by subscripts whose values are 2, 3, 4, and
so forth. If a subscript value greater than the size of the table is used, the result is
undefined.
Note that a multiple-subscripted data item must have a space character preceding all
subscripts except the first.
The following examples illustrate subscripting:
MOVE total(8) TO report-total-8.
MOVE day of date(3) TO print-line-date.
MOVE month-name(month-number) TO report-month.
MOVE matrix(row, column) TO output-display-line.
Referencing a subscripted data item defined using a PIC X(n) clause (where n is an
integer from 1 through 32,000) containing double-byte data redefined as PIC X(1)
OCCURS n TIMES might reference only the left or right byte of a double-byte
character. The left or right byte of a double-byte character by itself has no meaning and
therefore the byte is undefined. For example:
WORKING-STORAGE SECTION.
:
01 WS-KANJI-DATA PIC N(05).
01 WS-UNDEFINED-DATA PIC X.
01 WS-NAME-1 PIC N(05).
01 WS-GROUP-REDEF REDEFINES WS-NAME-1.
02 WS-BYTE-DATA PIC X OCCURS 10 TIMES.
:
:
PROCEDURE DIVISION.
:
:
MOVE WS-KANJI-DATA TO WS-NAME-1.
MOVE WS-BYTE-DATA(1) TO WS-UNDEFINED-DATA.
The receiving data in the example is undefined because the left or right byte of a double-
byte character has no meaning.
Note. Arrays defined using a PIC N clause are referenced in units of two bytes.
Using Identifiers
An identifier is a data name made unique by qualifiers, subscripts, or qualifiers and
subscripts. A data name being used as a subscript or qualifier cannot itself be
subscripted.
Identifier syntax is:
item-1 OF group-a
Using Condition-Names
Items are tested frequently by a program. Assigning a condition-name to an item is a
convenient way to refer to the item and determine its value.
Every condition-name must be unique or capable of being made unique through
qualification and/or subscripting. If qualification is used to make a condition-name
unique, the conditional variable can be used as the first qualifier. The containing data
names of the conditional variable can also be used as qualifiers. If references to a
conditional variable require subscripting, then any of its condition-names must have the
same subscripting.
The following example illustrates a condition-name called restricted-use:
01 inventory.
02 part-number OCCURS 100 TIMES ...
03 prefix PIC 99.
03 use-code PIC 9.
88 restricted-use VALUE 1.
03 supplier-suffix PIC 99.
The condition-name, restricted-use, might be referenced as:
IF restricted-use OF use-code IN part-number (30)
NEXT SENTENCE,
ELSE...
Data Representation
In the Working-Storage Section and Linkage Section, data items are stored in a certain
number of bytes; each byte is an 8-bit unit of storage. Bytes are grouped in pairs to form
words.
Data items whose usage (as defined by a USAGE clause) is DISPLAY occupy one byte
per character. Table 2-10 indicates the storage occupied by data items whose usage is
COMPUTATIONAL.
In the Screen Section, items do not have individual storage assigned; storage of these
items is of no consequence to SCREEN COBOL programming.
Standard Alignment
The standard rules for positioning data within an elementary item depend on the
category of the receiving item. The rules are as follows:
• If the receiving data item is described as numeric, the sending data is aligned either
by decimal point with zero fill on either end of the value or by truncation on the low
end, as required. Truncation on the high end is not permitted, and if required, causes
suspension of the program. When no decimal point is specified, the receiving data
item is treated as if it had an assumed decimal point immediately following the
rightmost character.
• If the receiving data item is described as alphanumeric or alphabetic, the sending
data is aligned at the leftmost character position in the data item with space fill or
truncation to the right as required.
Optional Alignment
Standard data representation and alignment rules are not always appropriate, so
provisions exist to override them. The JUSTIFIED clause can be used in the data
description to right justify data within a data item.
Sometimes a server requires that data items in messages be aligned on word boundaries.
Data items aligned on word boundaries are said to be synchronized. Synchronization
typically is achieved by organizing and describing data so that item boundaries coincide
with word boundaries. This task can be eliminated by using the SYNCHRONIZED
clause to force alignment of data items to their natural boundaries.
IDENTIFICATION DIVISION.
PROGRAM-ID. program-unit-name.
[ AUTHOR. [ comment-entry ] ]
[ INSTALLATION. [ comment-entry ] ]
[ DATE-WRITTEN. [ comment-entry ] ]
[ DATE-COMPILED. [ comment-entry ] ]
[ SECURITY. [ comment-entry ] ]
IDENTIFICATION DIVISION.
PROGRAM-ID Paragraph
The required PROGRAM-ID paragraph names the SCREEN COBOL program unit.
The syntax of the PROGRAM-ID paragraph is:
PROGRAM-ID. program-unit-name.
program-unit-name
is the user-defined name of the SCREEN COBOL program unit. The name must
follow the rules for user-defined names (see Section 2, SCREEN COBOL Source
Program) and can differ from the file name of the source code or the object file.
This name is used in a CALL statement when the program is referred to in another
SCREEN COBOL program unit. This name is also used by the PATHCOM SET
TERM INITIAL and SET PROGRAM TYPE commands.
DATE-COMPILED Paragraph
The optional DATE-COMPILED paragraph causes the compiler to generate the current
date and time and insert it in the corresponding line of the source listing. The syntax of
the DATE-COMPILED paragraph is:
DATE-COMPILED. [ comment-entry ]
comment-entry
is any combination of characters from the SCREEN COBOL character set.
When this paragraph is included, the compiler generates the current date and time,
replacing the DATE-COMPILED line and any comment-entry with this line:
yyyy
is the year and ranges from 0000 through 9999.
mm
is the month and ranges from 01 through 12.
dd
is the day and ranges from 01 through 31.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. comment-entry
OBJECT-COMPUTER. object-computer-entry
[ SPECIAL-NAMES. special-names-entry ]
ENVIRONMENT DIVISION.
Configuration Section
The required Configuration Section declares the operating environment of the program
unit. These declarations can include terminal type characteristics and screen display
attributes.
The section header is:
CONFIGURATION SECTION.
The header must begin in Area A and must be terminated with a period separator.
The Configuration Section contains two required paragraphs, the SOURCE-
COMPUTER and OBJECT-COMPUTER paragraphs, and an optional SPECIAL-
NAMES paragraph.
SOURCE-COMPUTER Paragraph
The required SOURCE-COMPUTER paragraph names the computer system by which
the program unit is compiled. The SCREEN COBOL compiler assumes the system is a
Compaq NonStop™ Himalaya system and treats any name given as a comment.
The SOURCE-COMPUTER paragraph syntax is:
SOURCE-COMPUTER. comment-entry.
comment-entry
is one or more words and cannot consist of blank or null characters.
OBJECT-COMPUTER Paragraph
The required OBJECT-COMPUTER paragraph names the computer system on which
the object program runs. The SCREEN COBOL compiler assumes the system is a
NonStop™ Himalaya system and treats the name given as a comment.
The OBJECT-COMPUTER paragraph syntax is:
OBJECT-COMPUTER. comment-word,
[ TERMINAL IS { T16-6510 } [ , ] ]
[ { T16-6520 } ]
[ { T16-6530 } ]
[ { T16-6540 } ]
[ { IBM-3270 } ]
[ { CONVERSATIONAL } ]
[ { INTELLIGENT-0 } ]
[ { INTELLIGENT-1 } ]
[ { INTELLIGENT-2 } ]
[ { INTELLIGENT } ]
[ CHARACTER-SET IS { USASCII } ] .
[ { FRANCAIS-AZ } ]
[ { FRANCAIS-QW } ]
[ { DEUTSCH } ]
[ { ESPANOL } ]
[ { UK } ]
[ { SVENSK-SUOMI } ]
[ { DANSK-NORSK } ]
[ { KANJI-KATAKANA } ]
comment-word
is a single word.
TERMINAL IS
specifies whether the program is a screen-oriented requester program that
communicates with a terminal or a message-oriented requester program that
T16-6510
T16-6520
T16-6530
T16-6540
specify the particular terminal operating in block mode.
• Program units compiled for a T16-6520 terminal can be run on a T16-6530
or T16-6540 terminal.
• Program units compiled for a T16-6530 can be run on a T16-6540.
• Program units compiled for one terminal type and run on another terminal
type can use only those features available for the compiled terminal type.
IBM-3270
specifies an IBM 3270 type terminal operating in block mode.
CONVERSATIONAL
denotes any of the following terminals operating in conversational mode: 6510,
6520, 6530, or 6540 type terminals, IBM 3270 type terminals, or any other
device that the operating system recognizes as operating in conversational
mode.
Features unique to terminal types in block mode are not recognized for the same
terminal types in conversational mode.
For Intelligent Device Support (IDS), the message-oriented requester program can
communicate with AM3270, SNAX, TERMPROCESS, AM6520, X25AM, or a
Guardian operating environment process. The TERMINAL IS clause specifies
whether the terminal communicates in conversational mode or block mode.
INTELLIGENT-0
specifies conversational mode. WRITEREAD I/O protocol: write to a device
and wait for a reply in conversational mode.
INTELLIGENT-1
specifies block mode. WRITE and READ I/O protocol: write to a device and
then read from the device in block mode.
INTELLIGENT-2
specifies block mode. WRITEREAD I/O protocol: write to a device and wait
for a reply in block mode.
INTELLIGENT
specifies that the PATHCOM SET TERM TYPE parameter determines
conversational or block mode. If INTELLIGENT is specified but no
PATHCOM SET TERM TYPE parameter is specified, the default is
conversational mode.
The syntax for PATHCOM to enable these settings is given under the description of
the SET TERM command in the Compaq NonStop™ Pathway/iTS System
Management Manual.
Selecting INTELLIGENT-0 is appropriate if the device is to be placed in
conversational mode and the device is configured to communicate with a Compaq
access method for NonStop™ Himalaya systems, such as SNAX or X25AM. If
INTELLIGENT-0 is selected and the TCP executes a SEND MESSAGE statement
without a REPLY phrase, only a WRITE is issued to the device. If INTELLIGENT-
0 is selected and the TCP executes a SEND MESSAGE statement without data, a
WRITEREAD with a write count of 0 is issued.
Selecting INTELLIGENT-1 is appropriate if it is desired to have the device in block
mode and the device is configured to communicate with a Compaq access method
for NonStop™ Himalaya systems, such as SNAX or X25AM. If INTELLIGENT-1
is selected and the TCP executes a SEND MESSAGE statement without a REPLY
phrase, a READ is not issued. If INTELLIGENT-1 is selected and the TCP
executes a SEND MESSAGE statement without data, a WRITE is not issued.
Selecting INTELLIGENT-2 is appropriate if it is desired to have the device in block
mode and the device is configured such that other processes are simultaneously
requesting data from it. If this is the case, the WRITEREAD protocol guarantees
that each reply is returned to its intended requester. If INTELLIGENT-2 is selected
and the TCP executes a SEND MESSAGE statement without a REPLY phrase, a
WRITE is issued. If INTELLIGENT-2 is selected and the TCP executes a SEND
MESSAGE statement without data, a READ is issued.
When communicating with Guardian user processes, INTELLIGENT-0 or
INTELLIGENT-2 should be used in order to invoke a WRITEREAD call to
communicate with the process.
CHARACTER-SET IS
specifies a character set other than USASCII. This clause can be used only with
terminal types IBM-3270, T16-6530, and T16-6540. For other terminal types, the
USASCII character set is assumed. If specified, this clause must follow the
TERMINAL IS clause. The only language that can be declared for IBM 3270
terminals is KANJI-KATAKANA.
If this clause is omitted for a program running on an IBM 3270 or a 6540 terminal,
USASCII is used. If this clause is omitted for a program compiled for and running
on a 6530 terminal, USASCII is used until the first DISPLAY BASE statement is
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
4 -4
Environment Division OBJECT-COMPUTER Paragraph
executed. After the first DISPLAY BASE, the character set specified in the
terminal's configuration menu is used.
KANJI-KATAKANA
indicates that the program unit source file might contain double-byte characters
in data fields or literals and instructs the compiler to allow the PIC N picture
clause.
You must be aware that depending on the terminal, support for 1-byte Katakana
characters, 2-byte Katakana characters, and lowercase and uppercase alphabetic
characters varies.
• On 6530 terminals, both 1-byte and 2-byte Katakana character sets, as well
as uppercase and lowercase alphabetic characters, are supported if
CHARACTER-SET IS KANJI-KATAKANA is specified.
• On IBM 3270 terminals, either lowercase alphabetic characters or 1-byte
Katakana characters are supported.
° On IBM 3270 terminals configured to use both lowercase and uppercase
alphabetic characters, a program unit cannot use 1-byte Katakana
characters.
° On IBM 3270 terminals configured to use 1-byte Katakana characters,
the TCP upshifts lowercase alphabetic characters in the outbound data
stream. Such terminals can run applications with both lowercase and
uppercase alphabetic characters as well as 1-byte Katakana characters,
but inbound data does not contain lowercase alphabetic characters that
the terminal does not generate when thus configured.
Note. Applications that use 1-byte alphabetic characters only can run on any terminal for
which the CHARACTER-SET IS KANJI-KATAKANA clause is valid. Applications that use
1-byte alphabetic characters as well as 1-byte Katakana characters can run only on a 6530
terminal or on an IBM 3270 terminal specifically configured to support EBCDIC/Katakana.
If the CHARACTER-SET IS clause is included and the character set type differs from
the current setting in the terminal, or the terminal setting is unknown, the terminal is
signaled the character set type at the execution of the first DISPLAY BASE statement in
a program unit. After the program unit completes execution, the terminal is reset to its
original character set.
The programmatic support of national-use characters affects the following areas:
• Field-characteristic clause UPSHIFT—Lowercase national-use characters are
upshifted to their uppercase equivalents.
• Class condition—The condition ALPHABETIC checks for characters in the
national-use characters.
• Symbol A in PICTURE clauses—A check is made for characters in the national-use
character set.
Programmatic support of national-use characters does not affect the following areas:
• Field-characteristic clause MUST BE—Range tests are not supported for national
use characters.
• Tests that involve collating sequence matters—Any comparison tests, such as less-
than or greater-than relations, are not supported for national-use characters.
SPECIAL-NAMES Paragraph
The optional SPECIAL-NAMES paragraph allows you to select names and to have
those names assigned to certain system names. The paragraph also matches features of a
specific terminal with the words used in the program to refer to those features. With
careful use of the correspondences established in the SPECIAL-NAMES paragraph, you
can remove much of the dependence on terminal type from the body of the program unit.
The SPECIAL-NAMES paragraph syntax is:
SPECIAL-NAMES.
[ , DECIMAL-POINT IS COMMA ] .
mnemonic-name
is an identifier you select to be associated with a sys-name and can be used later
in the Screen Section or the Procedure Division of the program to refer to a function
key or display attribute indicated by sys-name.
A list of system names can be equated to a single mnemonic-name only if the
system names refer to display attributes that can be combined. This causes the
mnemonic-name to represent the combination of the display attributes. Except
for terminals in the IBM 3270 family, only highlight display attributes can be
combined.
sys-name
specifies a function key or display attribute available on the terminal. Table 4-1 lists
the system names for function keys; Table 4-2 lists the system names for display
attributes.
DECIMAL-POINT IS COMMA
exchanges the function of comma and period in PICTURE character strings and
numeric literals in the remainder of the program.
The following example illustrates the SPECIAL-NAMES paragraph:
SPECIAL-NAMES.
ENTER-KEY IS F1,
EXIT-KEY IS F16,
INPUT-ATTR IS UNDERLINE,
SIGNAL-ATTR IS (REVERSE, NOUNDERLINE).
You must observe the following restrictions when combining display attributes in a
mnemonic name declared in the SPECIAL-NAMES paragraph:
• You must not combine extended field attributes for 3270 terminals that Pathway
does support with those that Pathway does not support. Pathway does not support
DIM on 3270 terminals.
• You can combine any of the following display attributes with one another:
BRIGHT
HIDDEN
MDTON
NUMERIC-SHIFT
PROTECTED
• You can combine one of the following highlight display attributes with one or more
of the other highlight display attributes (that is, BRIGHT, HIDDEN, MDTON,
NUMERIC-SHIFT, or PROTECTED).
• If a 3270 terminal supports the following outline display attributes, you can combine
them with one another and with any highlight display attribute (that is, with
BRIGHT, HIDDEN, MDTON, NUMERIC-SHIFT, PROTECTED, BLINK,
REVERSE, or UNDERLINE.):
TOPLINE or NOTOPLINE
LEFTLINE or NOLEFTLINE
RIGHTLINE or NORIGHTLINE
BOTTOMLINE or NOBOTTOMLINE
BOXFIELD
• You can combine outline display attributes with one or more highlight display
attributes. For example, you can set up fields that combine a highlight display
attribute with the attribute for a blinking field:
(BLINK, TOPLINE, BOTTOMLINE)
(REVERSE, LEFTLINE, RIGHTLINE)
(UNDERLINE, BOTTOMLINE, TOPLINE)
Input-Output Section
The optional Input-Output Section provides error reporting for screen input operations.
If this section is omitted, the error display attribute is dependent on the terminal type
specified in the Configuration Section.
The section header is:
INPUT-OUTPUT SECTION.
The header must begin in Area A and must be terminated with a period separator.
The Input-Output Section syntax is:
SCREEN-CONTROL.
ERROR-ENHANCEMENT [ IS ] mnemonic-name [ IN { FIRST } ]
[ { ALL } ]
[ WITH [ NO ] AUDIBLE ALARM ] .
ERROR-ENHANCEMENT [ IS ] mnemonic-name
specifies the display attribute with which fields found to be in error are to be
enhanced. mnemonic-name must be specified in the SPECIAL-NAMES
Paragraph.
If this clause is omitted for terminals in block mode, the BLINK attribute is used for
the 6510, 6520, 6530, and 6540 terminals; the BRIGHT attribute is used for the
IBM 3270 terminal. If this clause is omitted for terminals in conversational mode,
no error enhancement occurs. For error enhancement, BELL must be specified.
IN FIRST
enhances the first field that is found to be in error. For terminals operating in
conversational mode, IN FIRST is the only recognized enhancement option.
IN ALL
enhances all fields that are found to be in error. If IN ALL is not specified, only the
first field containing an error is enhanced.
DATA DIVISION.
DATA DIVISION.
[ WORKING-STORAGE SECTION.
data-description-entries ]
[ LINKAGE SECTION.
data-description-entries ]
[ SCREEN SECTION.
[ input-control-entries ]
screen-description-entries ]
[ MESSAGE SECTION.
message-description-entries ]
Working-Storage Section
The Working-Storage Section defines records and miscellaneous data items used for
internal purposes. Data entries in this section can be set to initial values. When local
data items or intermediate storage are not needed, this section can be omitted.
The section begins with a section header. The format of the header is:
WORKING-STORAGE SECTION.
Data description entries for individual items follow the header. All item names must be
unique. Subordinate data names can be duplicated as long as they can be qualified.
The maximum size of elementary items, group items and 01 level data items in the
Working-Storage Section is 32,000 bytes. The maximum size of a data item that
contains only double-byte characters is 16,000 double-byte characters (32,000 bytes) for
a Working-Storage Section entry.
An 01 level data item can have a maximum size of 32,000 bytes and can comprise
elementary and/or group items. For example:
WORKING-STORAGE SECTION.
01 BIG-01-ITEM PIC X(32000) VALUE SPACES.
01 BIG-GROUP-ITEM-1.
03 BIG-GROUP. PIC X(16000) VALUE SPACES.
01 BIG-GROUP-ITEM-2.
03 BIG-GROUP.
05 BIG-ITEM-2-A. PIC X(16000) VALUE SPACES.
05 BIG-ITEM-2-B. PIC X(16000) VALUE SPACES.
01 BIG-ELEMENTARY-ITEM-01.
03 BIG-ELEMENTARY-GROUP.
05 BIG-ELEMENTARY-ITEM PIC X(32000) VALUE SPACES.
Note. When very large data items are displayed using the Compaq Inspect debugging tool,
truncation might occur.
Linkage Section
The Linkage Section describes data passed from the calling program to the program
containing the Linkage Section (the called program). The Linkage Section associates
the data items defined in the section with data items defined in the Working-Storage
Section of the calling program. A Linkage Section is required in a called program even
when no data is passed.
The section begins with a section header. The format of the header is:
LINKAGE SECTION.
Definitions in the Linkage Section should be the same size as the corresponding items in
the Working-Storage Section of the calling program. If the definitions are larger, then an
error is returned; if the definitions are smaller, then data might be truncated but no error
is returned.
The calling program must contain a USING clause in the CALL statement to refer to the
data structures to be passed to the called program. The called program must contain a
USING clause in the Procedure Division header to refer to the data structures being
passed to it.
The Linkage Section does not cause the system to allocate additional memory in the
called program. The called and calling programs share the calling program's memory
for the common data structures.
The structure of the Linkage Section is the same as that of the Working-Storage Section
except the VALUE clause is prohibited for items other than level 88 items.
The maximum size of elementary items, group items, and 01 level data items in the
Linkage Section is 32,000 bytes. The maximum size of a data item that contains only
double-byte characters is 16,000 double-byte characters (32,000 bytes) for a Linkage
Section entry. A more detailed explanation of this size limit is provided in the
subsection SCREEN COBOL Limits on page 7-19.
An 01 level data item can have a maximum size of 32,000 bytes and can comprise
elementary and/or group items. For example:
LINKAGE SECTION.
01 BIG-01-ITEM PIC X(32000).
01 BIG-GROUP-ITEM-1.
03 BIG-GROUP. PIC X(16000).
01 BIG-GROUP-ITEM-2.
03 BIG-GROUP.
05 BIG-ITEM-2-A. PIC X(16000).
05 BIG-ITEM-2-B. PIC X(16000).
01 BIG-ELEMENTARY-ITEM-01.
03 BIG-ELEMENTARY-GROUP.
05 BIG-ELEMENTARY-ITEM PIC X(32000).
Note. When very large data items are displayed using INSPECT, truncation might occur.
Screen Section
The Screen Section describes the screens that are referred to in the Procedure Division.
The structure of the Screen Section is similar to that of the Working-Storage Section.
The section makes provision for two types of screens: base and overlay.
The section begins with a section header. The format of the header is:
SCREEN SECTION.
Message Section
The Message Section describes the messages that are referred to in the Procedure
Division. The structure of the Message Section is similar to that of the Working-Storage
Section.
The section begins with a section header. The format of the header is:
MESSAGE SECTION.
Data Structure
Data is described through a set of entries that name the components of a structure,
describe the attributes of those components, and describe the structure into which the
components are organized. Each entry has a level number followed by a data name and
possibly a series of independent clauses. The level numbers depict the structure,
dividing the data into its smallest parts.
The lowest subdivisions of a structure, that is, those not further subdivided, are called
elementary items. A structure can be a single elementary item or a series of elementary
items.
Sets of elementary items can be referred to by combining them into groups. Groups, in
turn, can be combined into groups; an elementary item, therefore, can belong to more
than one group.
• Level 88 defines a condition name, including a value or range of values that define
the condition to be tested.
{ WORKING-STORAGE SECTION. }
{ LINKAGE SECTION. }
Format 1 is:
level-number { data-name-1 }
{ FILLER }
[ JUSTIFIED clause ]
[ OCCURS clause ]
[ PICTURE clause ]
[ REDEFINES clause ]
[ SIGN clause ]
[ SYNCHRONIZED clause ]
[ USAGE clause ]
[ VALUE clause ]
Note. The VALUE clause in Format 1 applies to the Working-Storage Section only.
Format 2 is:
Format 3 is:
• Format 1 describes data of levels 01 through 49 and level 77. The data-name-1
entry is the name of the storage area defined by the subordinate items. In the
following example, store-address refers to everything from street through zip-code.
01 sample-record.
05 store-id.
10 store-number PIC 999.
10 store-region PIC X.
05 store-manager PIC X(35).
05 store-address.
10 street PIC X(25).
10 city PIC X(15).
10 state PIC X(2).
10 zip-code PIC 9(5).
05 FILLER PIC X(14).
The FILLER keyword takes the place of a data name when it is unimportant to name
an item. FILLER is commonly used when building Working-Storage records, such
as error messages, where most of the text is groups of constants. The text groups
can be separated by the filler. In the following example, FILLER defines an area in
storage that cannot be referred to in the program except as part of the enclosing item,
first-record:
01 first-record.
05 record-code PIC 99.
05 record-type PIC XX.
05 FILLER PIC X(30).
05 division-code PIC 999.
A level 77 entry cannot itself be subdivided. Level 77 entries, like level entries 01
through 49, must be immediately followed by a data name or keyword FILLER. For
example:
01 first-record.
05 record-code PIC 99.
05 record-type PIC XX.
77 temp-1 PIC X(4).
77 temp-2 PIC X(3).
Various examples of level 77 items appear in Section 6.
• Format 2 describes a level 66 entry, which renames one or more contiguous
elementary items. In the following example, the group card-codes is renamed code:
05 card-codes.
10 store-code PIC 9.
10 state-code PIC 9(4).
66 code RENAMES card-codes.
• Format 3 describes a level 88 entry, which assigns condition name values. In the
following example, item tax-code is defined with a range of values:
05 tax-code PIC 99.
88 tax-range VALUES ARE 01 THRU 20.
JUSTIFIED Clause
The JUSTIFIED clause causes nonstandard positioning of data within a receiving item.
The clause can only appear in the data description of an elementary item; the clause
cannot be used for a data item that is described as numeric.
{ JUST } RIGHT
{ JUSTIFIED }
When the JUSTIFIED clause is omitted, standard alignment rules dictate that alignment
is left justified and truncation or padding, when necessary, occurs on the right.
When a receiving data item is described with the JUSTIFIED clause, the standard
alignment rules do not apply. If a sending item is too big for the receiving item, the
sending item is truncated on the left. If the sending item is smaller than the receiving
item, the rightmost character of the sending item is aligned with the rightmost character
of the receiving field and the value is extended to the left with space characters.
Right justification does not strip trailing blanks from the sending field. Suppose, for
example, that the Working-Storage Section includes:
01 WS-FIELD-1 PIC X(12)
01 WS-FIELD-2 PIC X(14) JUSTIFIED RIGHT.
In addition, in the Screen Section a field is defined as:
05 SCREEN-FIELD-1 PIC X(10)
USING WS-FIELD-1.
Suppose the user enters “ABCDEFGHIJ” into SCREEN-FIELD-1, presses a valid
function key, and an ACCEPT statement causes data to be moved into WS-FIELD-1.
The data is then moved from WS-FIELD-1 to WS-FIELD-2 using the MOVE statement.
As a result of this sequence of operations, the three fields then appear as follows:
SCREEN-FIELD-1 = "ABCDEFGHIJ" (ten bytes)
WS-FIELD-1 = "ABCDEFGHIJ " (twelve bytes)
WS-FIELD-2 = " ABCDEFGHIJ " (fourteen bytes)
Although right justification and leading-blank padding have occurred, trailing blanks
from the input field were not stripped. Trailing blanks can be stripped from screen input
fields during the execution of an ACCEPT statement by means of an alphanumeric input
user conversion routine. Alternatively, logic for stripping trailing blanks can be
included in a server program.
Note. The JUSTIFIED clause is ignored when an item with the literal given in a VALUE clause
is initialized.
OCCURS Clause
The OCCURS clause defines tables and other sets of repeating items, thus eliminating
the need for separate item entries. These tables can be a fixed number of elements or
can vary within given limits. An OCCURS clause cannot be used in an 01 level entry.
max
is an integer that represents the number of elements in the table.
Format 2 (for Variable Length Tables) is:
min
is an integer that represents the smallest number of elements in the table at any time.
The integer must be zero or greater and less than or equal to max.
max
is an integer that represents the greatest number of elements the table can have at
any time.
depend
is an integer data item that controls the size of the table. As the value of the
depend item increases or decreases, the number of elements in the table increases
or decreases. When the table size decreases, those elements beyond the new
depend limit are lost even if the next statement increases the table to include them.
When the table size increases, you must assign values to the new elements before
using them.
The following example illustrates the OCCURS clause:
01 table-group.
02 activity-count PIC 99.
02 activity-table OCCURS 10 TO 20 TIMES
DEPENDING ON activity-count.
05 activity-entry PIC 999.
When using the data name that represents a table item, you must use subscripts to access
the item. You can use the data name without subscripts only when you want the entire
table (for example, in a MOVE statement). If the data name is a group item, you must
use subscripts for all items belonging to the group whenever they are used as operands.
Subordinate data names used as objects of a REDEFINES clause are not considered
operands and, therefore, cannot be subscripted.
A data description entry with an OCCURS DEPENDING ON clause can be followed,
within its data description, only by descriptions of subordinate items. In other words,
only one table with a variable number of occurrences can appear in a single data
description, and the data items contained by the table must be the last data items in the
data description.
Data items subordinate to an entry described with an OCCURS clause can themselves
contain an OCCURS clause. Tables can consist of such multiple occurrences of
subordinate tables for a maximum of three levels. A data description entry containing
either format of the OCCURS clause can be followed by subordinate entries containing
a fixed length table OCCURS clause; however, a data description entry with an
OCCURS DEPENDING ON clause cannot be subordinate to a group entry described
with either format of the OCCURS clause.
PICTURE Clause
The PICTURE clause defines the characteristics of an elementary item.
{ PIC } [ IS ] character-string
{ PICTURE }
character-string
is one or more symbols that determines the category of an elementary item and
places restrictions on the values assignable to the item.
A maximum of 30 characters is allowed in character-string. When the same
PICTURE character repeats, you can write it once followed by an unsigned integer
enclosed in parentheses. The integer indicates how many times that character is
repeated. For example, the following PICTURE clauses are equivalent:
PIC 9(5)
PIC 99999.
Although a character string can be no longer than 30 characters, you can use the
repetition technique to define items that otherwise would be longer than 30 characters.
Table 5-1 lists the character-string symbols that are used to describe a data item.
Item Size
The size of a data item is determined by the symbols in its PICTURE string. Each A, X,
and 9 count as one character position. An S counts as one character only if the item is
subject to a SIGN IS SEPARATE clause.
If a data item is described as DISPLAY in a USAGE clause, the size of the item includes
the PICTURE string symbols. If the item is described as COMPUTATIONAL, the size
of the item is computed differently, as described under the USAGE clause.
Categories of Data
The PICTURE clause can describe categories of data: alphabetic, numeric,
alphanumeric, and double-byte data items. The results of most statements in the
Procedure Division depend on the categories of the data items. Some statements require
certain categories for some or all of their operands. In some cases, a statement can take
different actions depending on the category of the data items.
In the discussion that follows, 9 and A symbols within the PICTURE string are
described as representing character positions that have only numbers or letters and
spaces. For reasons of efficiency, the SCREEN COBOL compiler does not always
require this restriction. Characters other than those permitted can be moved into these
positions if they appear in the corresponding group positions of a sending data item.
SCREEN COBOL considers every group item to be alphanumeric. Manipulations on
group items ignore all PICTURE strings. For example, a move operation into a group
item can cause any position of an item to contain any ASCII character.
Alphabetic Data
An alphabetic data item can have only A symbols in the PICTURE string. The contents
of this type of item are represented externally as some combination of the 26 letters of
the alphabet and the space character.
The following examples illustrate alphabetic data:
05 package-code PIC AAA.
05 dept-id PIC AA(6)AA.
05 dept-code PIC AA(2)AA.
Numeric Data
A numeric data item can have 9, P, S, and V symbols in the PICTURE string. The
number of digits described must be greater than zero but not more than 18. The contents
of this type of item are represented externally as a combination of digits 0 through 9.
If the item is signed, a plus or minus is included when the data is moved to a screen
item, or when a SIGN IS SEPARATE clause is specified. In all other instances, the sign
is encoded within one of the digits.
The following examples illustrate numeric data:
05 division-total PIC S9(10)V99.
05 fraction-amount PIC PP99.
Alphanumeric Data
An alphanumeric data item can have combinations of A, X, and 9 symbols in the
PICTURE string, but the item is treated as though the string contained all X symbols.
The length of the item must be greater than zero but not more than 32,000 bytes. The
contents of the item can be any combination of ASCII characters. A PICTURE string of
all A symbols or all 9 symbols is not an alphanumeric item.
The following examples illustrate alphanumeric data:
10 stock-item-name PIC X(25).
10 zone-id PIC A(4)99.
Double-Byte Data
A double-byte data item that allows only double-byte data contains only N symbols in
the PICTURE string.
If a VALUE clause is declared for a PIC N Working-Storage Section field, the value can
consist only of characters from the Shift-JIS character set (X 0208) enclosed in
quotation marks ("").
You can use the THRU/THROUGH clause with level 88 data items associated with
double-byte character set literals. Byte-by-byte comparisons of all items in the
THRU/THROUGH clause are performed. Double-byte character set data used in the
THRU/THROUGH clause is treated as a byte string.
The following examples illustrate PICTURE strings for double-byte data:
10 data-id PIC N.
10 data-name-1 PIC NNNN.
10 data-name-2 PIC N(10).
REDEFINES Clause
The REDEFINES clause allows a computer storage area to be described in more than
one way. This capability is valuable for such tasks as input data validation when tests
require different descriptions of the data. This capability is convenient when some
portions of a record are constant, while other portions vary.
REDEFINES data-name-2
data-name-2
is the data item being redefined.
The REDEFINES entry must immediately follow the entry for the data item being
redefined or must immediately follow the last item subordinate to that data item. The
level number of the REDEFINES entry must be the same as the item being redefined by
the clause.
The following rules apply to the REDEFINES clause:
• Level 66 and level 88 data items cannot be redefined.
• The redefined data item cannot have an OCCURS clause or a REDEFINES clause.
• The data name of the redefined item cannot be subscripted or qualified.
• Neither the original definition nor the redefinition can include an item whose size is
variable due to an OCCURS clause of a subordinate entry.
• A VALUE clause cannot be included.
• When the level number is not 01, the redefinition should be the same as the number
of character positions (bytes) in the data item you are redefining..
• The redefined item can be subordinate to an item with an OCCURS clause or a
REDEFINES clause.
• The REDEFINES entry can be followed by subordinate data entries. Redefinition
continues until the appearance of a level number less than or equal to that of the data
name being redefined or until the ending of the current section of the Data Division.
• You can use a REDEFINES clause to redefine a PIC N field, which allows only
double-byte data, as an alphanumeric PIC X field. Doing so makes it possible to
move double-byte data items to alphanumeric data items. For example:
WORKING-STORAGE SECTION.
:
01 WS-KANJI-ONLY-FIELD PIC N(10)
01 WS-KANJI-TO-PIC-X-REDEF REDEFINES WS-KANJI-ONLY
FIELD PIC X(20)
The REDEFINES clause redefines a storage area, not the data items occupying the area.
Multiple redefinition of the same area is permitted, but all definitions must begin with a
REDEFINES clause containing the data name of the entry that originally defined the
area.
The following example illustrates the REDEFINES clause:
WORKING-STORAGE SECTION.
01 record-in.
05 record-code PIC 9.
05 record-detail PIC X(30).
05 record-subtotal PIC 9(3)V99.
01 record-total REDEFINES record-in.
05 total-1 PIC 9(5)V99.
05 total-2 PIC 9(5)V99.
05 total-3 PIC 9(5)V99.
05 total-4 PIC 9(5)V99.
05 total-5 PIC 9(6)V99.
05 total-5-sub REDEFINES total-5 PIC X(8).
RENAMES Clause
The RENAMES clause assigns a new data name to one or more contiguous elementary
items within a data description. RENAMES does not cause any allocation of storage.
The clause can only be used with a level 66 entry.
new-name
is the new name for a group item or elementary item.
old-name
is a group item, an elementary item, or the first of several items to be given a new
name.
end-name
is the last group item or elementary item to be included in the new name.
The RENAMES clause merely renames a group of existing data items and does not
redescribe any of their characteristics; therefore, no other clauses can be used. One or
more RENAMES entries can be written for a structure; these entries can occur in any
order, but must immediately follow the last data description entry of the structure.
When the THROUGH option is not specified, new-name merely renames old-name.
new-name is a group item only if old-name is a group item.
When the THROUGH option is specified, the following rules apply:
• old-name and end-name must be data areas within the same structure.
• old-name and end-name cannot have the same names, but the names can be
qualified.
• old-name and end-name cannot be the names of data entries with level number
01, 77, 66, or 88.
• old-name and end-name cannot be described by an OCCURS clause in their
definitions, and they cannot be subordinate to an item described by an OCCURS
clause.
• end-name cannot name an item that occupies character positions preceding the
beginning of the area described by old-name.
• end-name cannot name an item that is subordinate to old-name.
• Items within the renamed area cannot be described by an OCCURS clause.
When the THROUGH option is specified, new-name is a group item that includes all
elementary items within the bounds established by old-name and end-name. The
following defines the beginning and end of the group:
• If old-name is an elementary item, the new group item begins with old-name.
• If old-name is a group item, the new group item begins with the first elementary
item of old-name.
• If end-name is an elementary item, the new group item ends with end-name.
• If end-name is a group item, the new group item ends with the last elementary
item of end-name.
The following example illustrates the RENAMES clause:
05 card-codes.
10 store-code PIC 9.
10 state-code PIC 9(4).
05 account-number PIC 9(6).
05 check-digit PIC 9.
66 card-number RENAMES card-codes THRU check-digit.
SIGN Clause
The SIGN clause specifies the position and mode of an operational sign for a numeric
data item. The clause can only be used for items that are described as DISPLAY in a
USAGE clause and have an S symbol in the PICTURE string.
LEADING
indicates the sign is at the beginning of the item.
TRAILING
indicates the sign is at the end of the item.
SEPARATE [ CHARACTER ]
specifies the sign becomes a separate character and is counted in the size of the item.
A + for positive and a – for negative is placed at the beginning or end of the item
value.
If this phrase is omitted, the sign is not counted in the size of the item. Depending
on whether you specify LEADING or TRAILING, the sign is at the beginning or
end of the item.
The following example illustrates the SIGN clause:
05 WS-subtotal-value PIC S9(02) SIGN IS TRAILING SEPARATE.
SYNCHRONIZED Clause
The SYNCHRONIZED clause forces alignment of an elementary item on the most
natural computer storage boundary.
{ SYNC } [ RIGHT ]
{ SYNCHRONIZED } [ LEFT ]
• DISPLAY items are composed of one or more character positions and are stored as
an equal number of 8-bit bytes. The byte boundary is their natural storage
boundary; therefore, the SYNCHRONIZED clause has no effect on DISPLAY item
alignment.
• COMPUTATIONAL items are stored as an even multiple of bytes. Their most
natural storage unit is some multiple of the 16-bit computer word; each of these
words contains two bytes. The SCREEN COBOL compiler automatically aligns
COMPUTATIONAL items to word boundaries. This is also the natural boundary
for small COMPUTATIONAL items (those items with PICTURE strings containing
up to four 9s).
• Larger COMPUTATIONAL items (those items with pictures containing five or
more 9s) are naturally stored as one or two 32-bit doublewords. The
SYNCHRONIZED clause affects these items; it forces alignment on a doubleword
boundary.
• All items of levels 01 and 77 in the Working-Storage Section and Linkage Section
are automatically allocated by the SCREEN COBOL compiler to begin on a word
boundary. The compiler treats these items as simultaneously beginning on a byte,
word, and doubleword boundary. Thus, each of these items is aligned to its most
natural storage boundary.
• Words begin on two-byte boundaries; doublewords begin on four-byte boundaries.
Alignment, either automatic or as requested by use of the SYNCHRONIZED clause,
generates implicit FILLER data in some cases.
° If an odd number of character positions precedes a word-aligned item within a
record, the compiler inserts one character position (byte) of FILLER data before
the item to complete allocation of the preceding word.
° If the number of character positions preceding a doubleword aligned item within
a record is not a multiple of four, the compiler inserts FILLER data (1, 2, or 3
bytes) to complete allocation of the preceding doubleword. These extra bytes
are not part of the data item.
° If a group item contains two items separated by implicit FILLER bytes, these
bytes are a part of that group item. A group item always begins with the first
character position of its first elementary item, however, ignoring any implicit
FILLER bytes that were generated to align that item properly. Thus, the initial
character positions of a group item are never implicit FILLER bytes.
• Special considerations apply when aligning an elementary data item that is
described with an OCCURS clause, is subordinate to a group item described with an
OCCURS clause, or both. In these cases, all occurrences of the data item must be
aligned uniformly.
° The first occurrence of the item is aligned to the required storage boundary (if
the elementary item also begins a containing table's first occurrence, that table's
first occurrence is defined to begin at the first character position of the item).
When the aligned item is itself a table, the first occurrence ends on the
appropriate storage boundary (byte, word, doubleword) and the remaining
occurrences follow without additional FILLER bytes.
° When the aligned item (or table of aligned items) belongs to a higher-level table,
further adjustment might be necessary. If the elementary item is word-aligned
and the containing group occurrence consists of an odd number of character
positions, the compiler inserts one byte of FILLER data after each group
occurrence. If the item is doubleword aligned and the size of the containing
group occurrence is not a multiple of four, the compiler inserts the appropriate
amount of FILLER data (1, 2, or 3 bytes) after each group occurrence. In all
cases, inserted bytes are not part of the containing occurrences themselves, but
are included in group items that contain the complete table. The preceding
sequence is repeated for each higher-level table.
The following example illustrates alignment as it applies to multiple OCCURS clauses:
01 master.
02 table-1 OCCURS 5 TIMES.
03 table-2 OCCURS 5 TIMES.
04 table-3 OCCURS 5 TIMES.
05 item-a PIC 999 COMPUTATIONAL.
05 item-b PIC X.
04 item-3 PIC X.
03 item-2 PIC X.
Although master appears to occupy this many bytes:
(((2+1) * 5+1 ) * 5+1) * 5 = 405 bytes
it actually occupies:
((2+1+1) * 5+1+1) * 5+1+1) * 5 = 560 bytes
due to the alignment requirement for the COMPUTATIONAL item.
Implicit FILLER bytes must be accounted for in several situations. These bytes are
counted when determining the size of group items that contain them. Thus, when a data
item contains implicit FILLER bytes, the character positions of the bytes are included in
the allocation requirements of the item. Also, implicit FILLER bytes must be included
among the character positions redefined if a containing group item appears as the object
of a REDEFINES clause.
Automatic alignment or requested alignment of data items described by redefinition of
character positions (through use of the REDEFINES clause) follows the rules described
in the preceding paragraphs. However, when the first data item allocated by a
redefinition requires word alignment or doubleword alignment, the data item being
redefined must begin on the appropriate boundary. In other words, SCREEN COBOL
does not permit redefinitions that require insertion of implicit FILLER bytes before the
first data item of the redefinition. Any bytes inserted at other places within the
redefinition are counted when determining the redefinition size.
USAGE Clause
The USAGE clause defines how a data item is stored within the Compaq NonStop™
Himalaya system and, normally, affects the number of character positions used. The
USAGE clause does not restrict how the item is used; however, some statements in the
Procedure Division require certain usages for their operands.
[ USAGE [ IS ] ] { COMP }
{ COMPUTATIONAL }
{ DISPLAY }
COMP or COMPUTATIONAL
indicates a numeric data item that is suitable for computations.
DISPLAY
indicates a data item value that is stored in the standard data format as a sequence of
ASCII characters. If this clause is omitted, the default is DISPLAY.
A USAGE clause can be written at any level. A USAGE clause written at the group
level applies to each elementary item in the group. The usage of an elementary item
cannot contradict the USAGE clause of a group to which the item belongs. Note,
however, that a group item is always considered to be alphanumeric by SCREEN
COBOL; thus, the USAGE clause of a group item might not always apply to the
manipulation of the item.
A COMPUTATIONAL item has a value suitable for computations and, therefore, must
be numeric. The PICTURE string of the item can have only the symbols 9, S, V, and P.
Two to eight bytes are selected for a COMPUTATIONAL item, depending on the
number of 9 symbols in the PICTURE string, as Table 5-2 indicates.
VALUE Clause
A VALUE clause specifies the initial value of a Working-Storage item or the value of a
level 88 condition name.
Format 1 (Data Initialization) is:
VALUE [ IS ] literal
literal
is the initial value to be assigned to a data item. The value can be a figurative
constant.
Format 2 (Condition Name Entries) is:
88 condition-name , { VALUE [ IS ] }
{ VALUES [ ARE ] }
condition-name
is the name of the condition value.
value-1
is either a single literal value or the first of a range of literal values tested by the
condition.
value-2
is the final literal value in a range of literal values tested by the condition. The value
must be greater than value-1.
• The VALUE clause is not permitted in a data description entry that meets the
following criteria:
° The entry contains an OCCURS or REDEFINES clause.
° The entry is subordinate to an entry containing an OCCURS or REDEFINES
clause.
° The entry has a variable size due to an OCCURS clause in a subordinate entry.
• If the VALUE clause is used for initialization at the group level, the literal must be a
figurative constant or a nonnumeric literal. The group area is initialized without
consideration for the individual elementary or other group items within this group.
Thus, the group should not have items with descriptions that include JUSTIFIED or
USAGE IS COMPUTATIONAL clauses. A VALUE clause cannot appear at the
subordinate levels within this group.
The following example illustrates the VALUE clause used for data initialization:
WORKING-STORAGE SECTION.
01 main-heading.
05 FILLER PIC XX VALUE SPACES.
05 FILLER PIC X(8) VALUE "DIVISION".
05 FILLER PIC XX VALUE SPACES.
05 FILLER PIC X(6) VALUE "REGION".
:
01 counters.
05 no-of-reads PIC 9(5) VALUE ZEROS.
05 no-of-writes PIC 9(5) VALUE ZEROS.
SCREEN SECTION.
[ input-control-character clauses ]
Level 01 introduces a screen description entry. This level defines the name of the screen
(a name by which the screen is known throughout the program), defines the size of the
screen, and indicates whether the screen is a base or overlay screen. The intermediate
levels define groups of items. The highest numbered levels define the characteristics of
the screen fields.
The screen description can have the following parts: screen name, screen overlay area,
screen group, and screen field. Each of these parts defines a specific attribute of the
screen. The following example illustrates a screen description entry:
SCREEN SECTION.
01 ENTER-AMT BASE SIZE 12, 80.
05 FILLER AT 1, 12 VALUE "ORDER DETAIL ENTRY".
05 FILLER AT 2, 1 VALUE "CUSTOMER".
05 FILLER AT 4, 1 VALUE "ITEM".
05 FILLER AT 4, 10 VALUE "QUANTITY".
05 LINE1-HEADER AT 5, 1 VALUE "MENU LIST".
05 OVER1 AREA AT 6, 1 SIZE 10,80.
01 OVER1-SCREEN OVERLAY SIZE 10,80.
05 LINE1-OVERLAY AT 2, 10 VALUE
"1 DISPLAY PREVIOUS ORDER".
The input-control character clauses are available for terminals in conversational mode to
define the specific input-control characters to be used during execution of an ACCEPT
statement. These clauses are described later in this section.
The field-characteristic clauses are available to define the characteristics of screen
fields. These clauses are also described later in this section.
Base Screen
A base screen is a screen that is initially displayed on the terminal and is used to
establish the current screen for each program unit. In contrast to an overlay screen that
is displayed in the overlay area of a base screen, the base screen can be displayed
independently.
[ field-characteristic-clause ] ...
screen-name
is the name given to the base screen.
field-characteristic-clause
is one or more clauses that define default characteristics for all fields subordinate to
the screen unless these characteristics are explicitly overridden for a particular group
or field. The clauses that can appear here are:
FILL WHEN ABSENT
mnemonic-name WHEN BLANK
UPSHIFT WHEN FULL
USER CONVERSION
level-num
is a numeric literal that indicates the hierarchy. The value must be within the range
of 2 through 49. Subordinate entries are not allowed.
area-name
is the name given to the screen overlay area.
Overlay Screen
An overlay screen is a screen that is displayed in an overlay area of a base screen.
[ field-characteristic-clause ] ...
screen-name
is the name given to the overlay screen.
field-characteristic-clause
is a clause that defines default characteristics for all fields subordinate to the screen
unless explicitly overridden for a particular group or field. The clauses that can
appear here are:
FILL
mnemonic-name
UPSHIFT
USER CONVERSION
WHEN ABSENT
WHEN BLANK
WHEN FULL
Screen Group
A screen group is a combination of fields that are grouped together to provide collective
references to the subordinate fields and to define the common characteristics of the
fields. A screen group can contain subordinate groups.
{ screen-field } ...
{ screen-group }
level-num
is a numeric literal that indicates the hierarchy. The value must be within the range
of 2 through 48.
group-name
is the name given to the group.
FILLER
is a keyword that takes the place of group-name.
AT line, column
specifies the home position of the group relative to the boundaries of the screen.
The line number and column number must be within the size specified for the
screen. The positions of subordinate fields can be given relative to the home
position; this allows you to move groups easily.
If this clause is omitted, group relative addressing is not allowed in the group.
field-characteristic clause
is one or more clauses that define default characteristics for all fields subordinate to
the group unless these characteristics are explicitly overridden for a particular field.
The clauses that can appear here are:
FILL
mnemonic-name
UPSHIFT
USER CONVERSION
WHEN ABSENT
WHEN BLANK
WHEN FULL
Screen Field
A screen field is a single elementary item.
level-num { field-name }
{ FILLER }
[ field-characteristic-clause ] ... .
level-num
is a numeric literal within the range of 2 through 49 that indicates the hierarchy.
field-name
is the name given to the field.
FILLER
is a keyword that takes the place of field-name. FILLER must be used for a
literal field.
field-characteristic-clause
is one or more clauses that define a characteristic of the field. The clauses that can
appear here depend on the field type.
Table 5-3 lists the four types of screen fields that are determined by the data association
clauses TO, FROM, and USING. It also lists the clauses that can be used with the four
types of screen fields.
Note. T16-6520, T16-6530, and T16-6540 considerations: If two successive literals have the
same attributes, no separation is necessary; otherwise, at least one space must separate
them.
[ ABORT-INPUT [ IS ] { "nonnumeric-literal" } ]
[ { numeric-literal } ]
[ { [, numeric-literal ] } ]
[ { OFF } ]
[ END-OF-INPUT [ IS ] { "nonnumeric-literal" } ]
[ { numeric-literal } ]
[ { [, numeric-literal ] } ]
[ { OFF } ]
[ FIELD-SEPARATOR [ IS ] { "nonnumeric-literal" } ]
[ { numeric-literal } ]
[ { OFF } ]
[ GROUP-SEPARATOR [ IS ] { "nonnumeric-literal" } ]
[ { numeric-literal } ]
[ { OFF } ]
[ RESTART-INPUT [ IS ] { "nonnumeric-literal" } ]
[ { numeric-literal } ]
[ { [, numeric-literal ] } ]
[ { OFF } ]
Note. Programs using double-byte data must use only single-byte (ASCII) characters to define
input-control clauses.
ABORT-INPUT Clause
The ABORT-INPUT clause defines the characters used to terminate the processing of
the current ACCEPT statement with an abort termination status. The ABORT-INPUT
clause is recognized only by terminals operating in conversational mode.
ABORT-INPUT [ IS ] { "nonnumeric-literal" }
{ numeric-literal [,numeric-literal ] }
{ OFF }
"nonnumeric-literal"
is one or two alphanumeric characters enclosed in quotation marks.
numeric-literal
is one or two integers. Each integer must be within the range of 0 through 255.
numeric-literal is the decimal value of an 8-bit binary number.
If a process is responding in place of a terminal, SCREEN COBOL interprets the
8-bit pattern (two numeric literals convert to a 16-bit pattern) as a nonkeyboard
character.
OFF
specifies that ABORT-INPUT is not available for the current screen.
If this clause is omitted, the abort-input characters are @@.
If used, the ABORT-INPUT clause must be specified at the 01 screen level. A character
defined for ABORT-INPUT cannot be specified for another input-control character.
If the abort-input character is entered during an ACCEPT statement, no values in the
Working-Storage Section are changed by that ACCEPT statement.
END-OF-INPUT Clause
The END-OF-INPUT clause defines the characters used to indicate the end of the last
input field for the current ACCEPT statement. The END-OF-INPUT clause is
recognized only by terminals operating in conversational mode.
END-OF-INPUT [ IS ] { "nonnumeric-literal" }
{ numeric-literal [, numeric-literal ] }
{ OFF }
"nonnumeric-literal"
is one or two alphanumeric characters enclosed in quotation marks.
numeric-literal
is one or two integers. Each integer must be within the range of 0 through 255.
numeric-literal is the decimal value of an 8-bit binary number.
If a process is responding in place of a terminal, SCREEN COBOL interprets the
8-bit pattern (two numeric literals convert to a 16-bit pattern) as a nonkeyboard
character.
OFF
specifies END-OF-INPUT is not available for the current screen.
If this clause is omitted, the end-of-input characters are //.
If used, the END-OF-INPUT clause must be specified at the 01 screen level. A
character defined for END-OF-INPUT cannot be specified for another input-control
character.
FIELD-SEPARATOR Clause
The FIELD-SEPARATOR clause defines the character used to separate one screen field
from another during an ACCEPT statement. If a screen field description includes an
OCCURS clause, each occurrence is treated as one field. The FIELD-SEPARATOR
clause is recognized only by terminals operating in conversational mode.
FIELD-SEPARATOR [ IS ] { "nonnumeric-literal" }
{ numeric-literal }
{ OFF }
"nonnumeric-literal"
is one alphanumeric character enclosed in quotation marks.
numeric-literal
is one integer that must be within the range of 0 through 255. numeric-
literal is the decimal value of an 8-bit binary number.
OFF
specifies that FIELD-SEPARATOR is not available for the current screen.
If this clause is omitted, the field-separator character is a comma (,).
If used, the FIELD-SEPARATOR clause must be specified at the 01 screen level. The
character defined for FIELD-SEPARATOR cannot be specified for another input-
control character. In the following example, the FIELD-SEPARATOR clause defines S
as the keyboard character to be used.
SCREEN SECTION.
01 EMP-RECORD-SCREEN BASE SIZE 24, 80
FIELD-SEPARATOR IS "S" .
GROUP-SEPARATOR Clause
The GROUP-SEPARATOR clause defines the character used during the processing of
an ACCEPT statement to indicate one of the following:
• Last item in an OCCURS clause
• End of a field, if the field preceding the group separator has no multiple occurrences
The GROUP-SEPARATOR clause is recognized only by terminals operating in
conversational mode.
GROUP-SEPARATOR [ IS ] { "nonnumeric-literal" }
{ numeric-literal }
{ OFF }
"nonnumeric-literal"
is one alphanumeric character enclosed in quotation marks.
numeric-literal
is one integer that must be within the range of of 0 through 255.
numeric-literal is the decimal value of an 8-bit binary number.
If a process is responding in place of a terminal, SCREEN COBOL interprets the
8-bit pattern as a nonkeyboard character.
OFF
specifies that GROUP-SEPARATOR is not available for the current screen.
If this clause is omitted, the group-separator character is a semicolon (;).
If used, the GROUP-SEPARATOR clause must be specified at the 01 screen level. The
character defined for GROUP-SEPARATOR cannot be specified for another input-
control character.
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
5- 32
Data Division Field-Characteristic Clauses
RESTART-INPUT Clause
The RESTART-INPUT clause defines the characters used to restart input processing
during the current ACCEPT statement. The RESTART-INPUT clause is recognized
only by terminals operating in conversational mode.
RESTART-INPUT [ IS ] { "nonnumeric-literal" }
{ numeric-literal [,numeric-literal] }
{ OFF }
"nonnumeric-literal"
is one or two alphanumeric characters enclosed in quotation marks.
numeric-literal
is one or two integers. Each integer must be within the range of 0 through 255.
numeric-literal is the decimal value of an 8-bit binary number.
If a process is responding in place of a terminal, SCREEN COBOL interprets the
8-bit pattern (two numeric literals convert to a 16-bit pattern) as a nonkeyboard
character.
OFF
specifies that RESTART-INPUT is not available for the current screen.
If this clause is omitted, the restart-input characters are two exclamation points (!!).
If used, the RESTART-INPUT clause must be specified at the 01 screen level. A
character defined for RESTART-INPUT cannot be specified for another input-control
character. If the current ACCEPT statement is restarted, the data entered before the
restart-input characters does not change the values of the associated data items in
Working-Storage. If data is entered on the same line following the restart-input
characters, the data is ignored.
Field-Characteristic Clauses
Field-characteristic clauses specify various characteristics of screen fields. These field-
characteristic clauses have the following syntax and are described in alphabetic order in
the following paragraphs.
[ ADVISORY ]
[ CONTROLLED [ BY ] data-name-1 ]
[ CONVERT BLANKS ]
[ FILL nonnumeric-literal ]
[ LENGTH [ MUST BE ] ]
[ ]
[ { literal-1 [ { THROUGH } literal-2 ] } ... ]
[ { [ { THRU } ] } ]
[ mnemonic-name ] ...
[ { PIC } [ IS ] character-string ]
[ { PICTURE } ]
[ PROMPT screen-field ]
[ SHADOWED [ BY ] data-name-1 ]
[ { TO } data-name-1 ]
[ { FROM } ]
[ { USING } ]
[ UPSHIFT [ INPUT ] ]
[ [ OUTPUT ] ]
[ [ I-O ] ]
[ [ INPUT-OUTPUT ] ]
[ VALUE nonnumeric-literal ]
(continued)
ADVISORY Clause
The ADVISORY clause identifies a single output or input-output field as the field to be
used for informational and error messages generated by the TCP.
ADVISORY
Every base screen should have an advisory field. The field should be alphanumeric with
a size of at least 35 characters. Error messages that appear in this field are described in
Appendix A.
An overlay screen must not have an advisory field.
The ADVISORY clause cannot be associated with a field that allows only double-byte
data.
For terminals in conversational mode, an advisory field must be defined for the screen,
or the standard advisory messages are not displayed on the terminal.
AT Clause
The AT clause specifies the location of the field.
AT line-spec, column-spec
line-spec
specifies the line in which the field begins.
column-spec
specifies the column in which the field begins.
Both line-spec and column-spec can appear in the following forms:
numeric-literal
This form represents the line or column relative to the beginning of the screen.
* [ { + | - } numeric-literal ]
This form represents a location relative to the current position. The current position
begins at line 1, column 1 and is advanced to the first available position following a
field after that field is declared.
@ [ { + | - } numeric-literal ]
This form represents a location relative to the home position of the group containing
the field declaration. The home position is the first data character of the field and is
specified for the group with the AT clause.
Either the AT clause or the REDEFINES clause must be included in every screen field
declaration. If both clauses appear in the screen field declaration, they must refer to
exactly the same position.
CONTROLLED Clause
The CONTROLLED clause specifies a Working-Storage Section or Linkage Section
data item representing a structure capable of supporting run-time control of a screen
field’s display attributes.
When you use an appropriate combination of the CONTROLLED clause, the
DYNAMIC modifier, and the shadowed clause, you can combine the operations
DISPLAY BASE and DISPLAY OVERLAY, or TURN and DISPLAY, into one
operation.
CONTROLLED [ BY ] data-name-1
data-name-1
is the name of a group data item structure that can support all of the currently
defined Pathway screen field attributes.
Note. SOSI creation is not allowed to PIC A or PIC 9 fields when the CHARACTER-SET is
KANJI-KATAKANA.
Note. For 65XX terminals, a field which is defined as BRIGHT and BLINK will only blink, and
the field which is defined as REVERSE and BRIGHT will only be reversed. Further, a field
which is defined as HIDDEN and BRIGHT will be hidden, and the field defined as HIDDEN
and BLINK will also be hidden.
CONVERT BLANKS
Note. When a user presses the Tab key to bypass a field, the MDT (modified data tag) does
not get set (in other words, it is off). In such situations, use the CONVERT BLANKS clause in
conjunction with the WHEN ABSENT CLEAR clause to force blanks in a field. This allows the
USER CONVERSION clause to be invoked.
In the following example, the conversion procedure for FIELD1 is invoked when the
terminal operator enters data other than blanks or fill characters. The conversion
procedure for FIELD2 is invoked when the operator enters data, blanks, or fill
characters. The conversion procedure for FIELD3 is invoked when the terminal
operator enters data, blanks, or fill characters, or when the field is skipped.
SCREEN SECTION
01 MENU1
05 FIELD1 PIC X(20)
AT 4, 45
TO WS-1
USER CONVERSION 1.
FILL Clause
The FILL clause declares a padding character for the field. When output to the field
does not fill the full width specified, the padding character fills in to the right of the
field.
FILL nonnumeric-literal
nonnumeric-literal
is one character long. If a FILL clause is used with a field that allows only double-
byte data (PIC N), the fill character must be a double-byte character. If a FILL
clause is used with a PIC X or a PIC A field, the fill character must be a valid
single-byte (ASCII) character.
If this clause is omitted, the default fill character is a space, except on 3270
terminals, where the default fill character is a null. Also on 3270 terminals, if the
data is shorter than the length of the field, the remainder of the field is filled with
nulls.
On input, the trailing FILL characters are removed from the input string before the input
is analyzed for errors and converted. If a TO clause contains a numeric field, the
leading and trailing FILL characters are removed before the input is processed. FILL
characters embedded within a field are not removed.
If FILL and OCCURS clauses are both used with a field, on output the FILL clause
applies to all occurrences of the field, regardless of the setting of data-name-1 in a
DEPENDING ON clause.
LENGTH Clause
The LENGTH clause specifies the acceptable number of characters that can be entered
into a screen input field. The number of characters input is determined before
conversion but after the fill characters are removed.
would have to enter ten alphabetic characters for the first ten bytes—and half of a
double-byte character for the eleventh byte.
The following example specifies that FLD1 is optional (length can be 0), but must be
five characters long if it is entered; FLD2 is required, but 1 through 5 characters can be
entered.
04 FLD1 AT 1, 1 TO X PIC A9999 LENGTH 0, 5.
04 FLD2 AT 2, 1 TO Y PIC ZZZZ9 LENGTH 1 THRU 5.
When a field is optional and no characters are input, the value of the associated data
item is changed by the ACCEPT statement according to the WHEN ABSENT/BLANK
field-characteristic clause.
Mnemonic-Name Clause
The mnemonic-name clause allows you to specify display attributes for a screen field.
The mnemonic-name is associated with a display attribute in the SPECIAL-NAMES
paragraph of the Environment Division.
mnemonic-name
The display attributes combined with the default values for unspecified attributes
determine the display attributes for the field when the field is displayed initially.
Display attributes can be restored by a RESET statement, as described in Section 6,
Procedure Division.
The default value for the protection attribute depends on the screen field type. If the
field is an input or input-output field, the default is UNPROTECTED. If the field is an
output field, the default is PROTECTED.
A mnemonic-name can be associated with the display attribute system names listed in
Table 4-1 and Table 4-2.
MUST BE Clause
The MUST BE clause specifies the acceptable values for an input screen field.
9 is less than 10 if the screen PICTURE clause is numeric. An input string "9" is greater
than "10" if the screen PICTURE clause is nonnumeric.
When the MUST BE clause is processed, a numeric literal is scaled to match the
PICTURE clause defined for the associated data item. For example, if you have a
PICTURE clause of PIC 999.99 in the Screen Section data item and a MUST BE clause
of MUST BE 100, the MUST BE clause is scaled to MUST BE 100.00. You do not
have to include the decimal places in the MUST BE clause unless you want to specify
the value to two decimal places.
The MUST BE clause by itself does not make a screen field required. For a field to be
required, three clauses are necessary:
• LENGTH clause—specifies that a length greater than zero is required (This clause
must be specified for the TCP to verify the MUST BE clause.)
• MUST BE clause—specifies acceptable values if the field is present
• MDTON (Modified Data Tag On) attribute—specifies data validation even if the
field is unchanged
You can use the THROUGH/THRU clause with level 88 data items associated with
double-byte character-set literals. Byte-by-byte comparisons of all items in the
THROUGH/THRU clause are performed. Double-byte character set data used in the
THROUGH/THRU clause is treated as a byte string.
OCCURS Clause
The OCCURS clause specifies multiple occurrences of screen fields. This clause can
define a column, a row, or a rectangular array of fields. Each occurrence of the field is
identical except for location, and each is associated with a particular occurrence of a
Working-Storage data item having an OCCURS clause.
columns-phrase is:
lines-phrase is:
IN...COLUMNS, ON...LINES
determines the number of field occurrences, the location of each field occurrence,
and the ordering of the field occurrences.
literal-1
is a numeric literal that specifies the number of field occurrences on a line.
literal-k
is a numeric literal that specifies the horizontal spacing of the field columns.
When OFFSET is specified, literal-k is the number of spaces between the first
column of a field occurrence (literal-1) and the first column of the next field
occurrence (literal-1 +1) on the same line.
When SKIPPING is specified, literal-k is the number of spaces between the
last column of a field occurrence (column k) and the first column of the next field
occurrence (column k+1) on the same line. There can be at most (literal-1) -1
separations. If there are fewer separations, the last literal-k is used repeatedly.
No separation is required after the last literal.
literal-2
is a numeric literal that specifies how many lines contain occurrences.
literal-3
is a numeric literal that specifies how many lines are skipped between lines
containing occurrences of the field.
DEPENDING
indicates that the number of occurrences is variable.
data-name-1
is the unsubscripted name of an elementary numeric item where the current number
of occurrences is defined. This item must be defined in the Working-Storage
Section or Linkage Section. On input (execution of an ACCEPT statement), this
item is set. On output (execution of a DISPLAY statement), this item is used to
define the number of values output. If FILL and OCCURS clauses are both used
with a field, on output the FILL clause applies to all occurrences of the field,
regardless of the setting of data-name-1 in a DEPENDING ON clause.
The following conventions apply to the OCCURS clause:
• When the IN...COLUMNS phrase is omitted, a single occurrence on each line is
indicated.
• The order of the phrases determines the order in which the occurrence numbers are
assigned to the occurrences.
° If the ON...LINES phrase is specified first, the occurrences are numbered
sequentially from line to line down a column.
° If the IN...COLUMNS phrase is specified first, the occurrences across a line are
numbered sequentially.
• A screen field described with an OCCURS clause and associated with a data item by
a TO, FROM, or USING clause, must define the same maximum number of
occurrences in the OCCURS clause as is specified in the associated data item
OCCURS clause. The following example is a Working-Storage data item associated
with the screen field.
WORKING-STORAGE SECTION.
01 GAME-SCHE-REC.
:
05 TABLE-A PIC X(8) OCCURS 4 TIMES.
:
SCREEN SECTION.
:
05 FIELD-A AT 6, 10 PIC X(8) USING TABLE-A
OCCURS IN 4 COLUMNS
SKIPPING 1.
• If the data item named in the TO, FROM, or USING clause has subordinate items
and contains multiple OCCURS clauses, the maximum number of occurrences for
each OCCURS clauses must match the maximum number of occurrences specified
in the corresponding screen field descriptions.
• A single screen description can have any number of variable length tables. The
restriction of one for each structure that applies to the Working-Storage Section and
Linkage Section does not apply to screens.
• The OCCURS clause cannot define a screen group; however, the clause can define
screen fields in a screen group. The following example shows how the OCCURS
clause defines each screen field in a screen group:
SCREEN SECTION.
:
03 DATA-OUT.
05 JOB-ENTRY.
07 JOB-NR AT 6,16 PIC Z(4)
FROM JOB-NR OF SCREEN-TEMP
OCCURS ON 10 LINES
SKIPPING 1.
07 JOB-STATE AT 6,22 PIC X(5)
FROM JOB-STATE OF SCREEN-TEMP
OCCURS ON 10 LINES
SKIPPING 1.
• A reference to a screen field that is described with an OCCURS clause should
appear without a subscript when the field is used as one of the screen identifiers in
an ACCEPT statement. In other statements where screen identifiers can be used, a
reference to a screen field described with an OCCURS clause can appear with or
without a subscript. A reference without a subscript refers to all occurrences of the
table. A reference that includes a subscript refers only to the occurrence selected by
the value of the subscript.
• When a screen field described with a DEPENDING phrase is referred to in an
ACCEPT statement, part of the ACCEPT statement processing performed by the
TCP is the determination of the size of the table—the value to be stored into data-
name-1. All occurrences of the field are examined and the TCP sets
data-name-1 to the occurrence number of the last occurrence that was entered.
If the field is also a required field, all preceding occurrences of the field must also
be entered. Failure to do this causes a PREVIOUS FIELD MISSING error message
to be displayed for the terminal operator.
• Several tables on the same screen might have the same data-name-1 in their
DEPENDING phrase. If the tables are referred to in the same ACCEPT statement,
the value of data-name-1 is set to the maximum of the values that would be
computed when considering each table separately. If this causes the value of
data-name-1 to be set greater than the highest supplied occurrence of a table
whose fields are required, the input is in error and a REQUIRED FIELD MISSING
or EARLIER FIELD MISSING (depending on the order of the fields) message is
displayed for the terminal operator.
• When a reference to a screen field described with a DEPENDING phrase appears
without a subscript in any statement other than an ACCEPT statement, the reference
is to all occurrences within the current size of the table, as specified by the value in
data-name-1.
• When the value of data-name-1 of the DEPENDING phrase decreases and a
DISPLAY statement displays the table of screen field values, the fields previously
displayed beyond the current limit remain on the screen. To avoid having old screen
field values remain on the screen, you can handle the display in one of the following
ways:
° Specify a DISPLAY BASE or DISPLAY RECOVERY statement before the
DISPLAY statement for the current table of values.
° Do not use the DEPENDING phrase; define the table for the maximum length
and always display the full table with field values set appropriately.
• The DEPENDING phrase specifies the maximum size of a screen table that your
program can refer to during execution. The maximum size of a screen table is the
lower of the following values:
° The literal specified in the OCCURS clause of the associated Working-Storage
table
° The literal specified in the IN ... COLUMNS or ON ... LINES phrase in the
OCCURS clause of the screen table definition
Generally, you should make certain that these values are the same. If the TCP
references a screen table item with a subscript value that exceeds the maximum size
allowed for the screen table, the TCP suspends the terminal and displays an error
message.
• By including the DEPENDING clause in the screen table definition you can allow
the screen table to have a varying size based on the value in data-name-1.
The current size of the screen table specified in data-name-1 determines the
maximum subscript value allowed for that screen table and the maximum number of
screen table items that are operated on when no subscript value is specified.
° If the TCP references a screen table item with a subscript value that exceeds the
current size, the TCP suspends the terminal and displays an error message.
° If the current size exceeds the maximum size and the screen table is referenced
with a subscript, the TCP suspends the terminal and displays an error message.
° If the current size exceeds the maximum size and the screen table is referenced
without a subscript, the TCP executes the statement as if the current size is zero.
The TCP does not, however, flag this as an error and the operation is performed
on zero items in the screen table.
The following example illustrates the OCCURS clause:
05 FLD-A AT 6, 10 PIC X(8) FROM TBL-A
OCCURS IN 4 COLUMNS OFFSET 10.
An equivalent OCCURS clause would be:
OCCURS IN 4 COLUMNS SKIPPING 2.
PICTURE Clause
The PICTURE clause defines the format in which the data appears on the terminal
screen.
{ PIC } [ IS ] character-string
{ PICTURE }
character-string
can take the same form as that described in the data description entry with the
following exceptions:
• The symbol S cannot appear in the picture.
• Numeric edited forms and alphanumeric edited forms are allowed.
The maximum size allowed by the compiler is 255 bytes.
Generally, screen field input is edited in a manner that is inverse to normal editing
functions implied by the PICTURE clause. The input editing always correctly
reconverts a value, using the same PICTURE clause for input and output.
The input editing process is different for the two classes of the input item:
• Alphanumeric input—Only the left-hand portion of the picture corresponding to
the actual number of input characters must be matched. The remaining portion
of the picture is ignored.
• Numeric input—Leading and trailing spaces and fill characters are first removed
from the input data string. If there are only spaces in the input string (this can
occur when a terminal operator simply tabs from one field to the next), the string
is considered to indicate the value 0. Otherwise an attempt is made to match
each character in the picture with a character in the input data, proceeding from
right to left. If no match is made, the data is considered to be in error.
Some picture symbols are special in that the positions they represent might be
omitted from the input data string. Symbols that can be included in this category are
Z, comma, multiple plus and minus signs, CR, DB, and multiple currency signs. If a
mismatch occurs with an input character of this type, and if a space would be
acceptable at that point in the input string, the data is not considered in error; the
picture symbol is replaced by a space, and the TCP attempts to match the input
character with the next picture symbol. Table 5-5 gives the description of these
character-string symbols.
Item Size
The size of a data item is determined by the symbols of its PICTURE string. The
character-string symbols DB and CR each count as two character positions. Symbols V
and P do not count as character positions. All others count as one character position.
PROMPT Clause
The PROMPT clause associates a named screen item for output with a screen field for
input. During the processing of an ACCEPT statement, the contents of a named screen
item can be displayed (to assist the terminal operator) before the screen input is read.
The PROMPT clause is valid only for terminals operating in conversational mode.
PROMPT screen-field
screen-field
is the name of a previously defined screen field. The contents of screen-field
can be described in the Screen Section with a VALUE clause or in a Working-
Storage data item and output with a FROM clause. The contents of
screen-field are used as a prompt for the screen field described with the
PROMPT clause.
For terminals operating in conversational mode, screen-field is used as a signal
for input. In the Screen Section, a screen field description must precede the associated
PROMPT clause in the same screen description.
During execution of the ACCEPT statement, the value specified in the prompt screen
field is displayed before the terminal is able to receive input. The prompt value is
always displayed in the first column of a screen line.
The following example illustrates a PROMPT clause with screen-field described
in the Screen Section. When the associated ACCEPT statement executes, LAST NAME
appears on the screen followed by a set of parentheses (delimiting the field size) and the
cursor.
SCREEN SECTION .
01 ADDCUST-SCREEN BASE SIZE 24, 80 .
05 NAME1-PROMPT AT 3,2 VALUE "LAST NAME: " .
05 LAST-NAME-FIELD AT 3,13 PIC X(10) USING CUST-LAST-NAME
LENGTH MUST BE 1 THRU 10
PROMPT NAME1-PROMPT .
The next example illustrates a PROMPT clause with screen-field described in the
Working-Storage Section and output with a FROM clause.
WORKING-STORAGE SECTION.
O1 NEWCUST-REC.
05 NEW-LAST-NAME PIC X(10) VALUE SPACES.
:
01 WS-PROMPT-VALUE PIC X(11) VALUE "LAST NAME: ".
:
SCREEN SECTION.
01 NEWCUST-SCREEN.
05 LAST-NAME-PROMPT AT 3,2 PIC X(11) FROM WS-PROMPT-VALUE.
05 LAST-NAME-FIELD AT 3,13 PIC X(10) USING NEW-LAST-NAME
LENGTH MUST BE 1 THRU 10
PROMPT LAST-NAME-PROMPT.
The PROMPT clause displays a screen field with or without parentheses depending on
the screen-field definition.
• If the screen field is defined with a FROM or USING phrase, the PROMPT clause
displays the value currently stored in the associated Working-Storage data item in
parentheses following the prompt. For example, if LAST NAME (Brown) appears,
Brown was the value entered during the last ACCEPT statement for this field.
• If the screen field is defined with a TO phrase, the PROMPT clause does not display
parentheses.
RECEIVE Clause
The RECEIVE clause specifies whether screen-field data can be accepted from a
terminal, another kind of device, or both. This option is supported only for applications
running on 6530 terminals with version C00 (or later) microcode and 6AI (revision A00)
firmware. If this clause is omitted, data can be accepted only from the terminal
keyboard.
ALTERNATE
causes data to be accepted from a device other than the terminal. The other devices
that Pathway supports are:
• Optical character recognition reader
• Optical bar code reader
• Magnetic string reader for badges or cards
ALTERNATE OR TERMINAL
causes data to be accepted from one of the alternate devices listed above and from
the terminal keyboard.
TERMINAL
causes data to be accepted only from the terminal keyboard.
TERMINAL OR ALTERNATE
causes data to be accepted from one of the alternate devices listed above and from
the terminal keyboard.
The RECEIVE clause restricts input from the terminal keyboard for screen fields
defined with the ALTERNATE option. These fields can accept data only from an
alternate device that is connected to a 6530 terminal.
You can use the SCREEN COBOL TURN statement to change this attribute to a
previously defined option.
An example of the RECEIVE clause is:
SCREEN SECTION.
01 INVENTORY-REC-SCREEN BASE SIZE 24, 80.
:
05 PROD-FIELD AT 5, 28 PIC X(10) RECEIVE FROM ALTERNATE
USING WS-PROD-ID.
05 COUNT-FIELD AT 7, 28 PIC X(10) RECEIVE FROM
ALTERNATE OR TERMINAL
TO WS-PROD-COUNT.
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
5- 51
Data Division Field-Characteristic Clauses
REDEFINES Clause
The REDEFINES clause specifies that the screen field being defined is an alternate
interpretation of a previously defined field.
REDEFINES field-name-2
field-name-2
is the previously defined field.
The two fields must be identical in size and display attributes.
The REDEFINES clause allows an ACCEPT statement to be issued for a given physical
field for two cases using different rules. An example would be postal codes in the U.S.
and in the U.K.
05 ZIP-US AT 10, 10 PIC 999999
LENGTH 0, 5
TO ZIP-US-WS.
05 ZIP-UK REDEFINES ZIP-US PIC XXXXXX
LENGTH 0, 6
TO ZIP-UK-WS.
Either the REDEFINES or the AT clause must be included in every screen-field
declaration. If both clauses appear in the screen-field declaration, they must refer to the
same position.
SHADOWED Clause
The SHADOWED clause associates a nonliteral screen field with a Working-Storage
data item (shadow item). The shadow item can be used to determine whether input was
supplied for the screen field or to control selection of the screen field for output
statements.
A shadow item is used in association with a SHADOWED modifier that can be included
in the following statements: DISPLAY, RESET, SET NEW-CURSOR, and TURN.
When one of these statements executes and includes a SHADOWED modifier, the
shadow items that are referred to in the statement are automatically examined.
Resulting action depends on the value of the shadow items.
SHADOWED [ BY ] data-name-1
data-name-1
is the data item to be associated with a nonliteral screen field. Define
data-name-1 in the Working-Storage Section with a size of one byte (PIC X,
PIC 9, or PIC 9 COMP).
A shadowed screen field is associated with at least two Working-Storage items, the
primary item and the secondary (shadow) item. For example, below a USING clause
(which could be either TO or USING) associates a primary Working-Storage item with
the screen field. The SHADOWED clause associates the shadow Working-Storage item
with the screen field.
Screen Section Working-Storage Section
05 SCREEN-ITEMA ... :
PIC X(10) :
USING WS-ITEMA 01 WS-ITEMA PIC X(10).
SHADOWED BY WS-A-SHADOW 01 WS-A-SHADOW PIC 9 COMP.
If the screen field defined with a SHADOWED clause has an OCCURS clause,
data-name-1 given in the SHADOWED clause should be a data item having an
OCCURS clause with the same maximum number of occurrences as the occurrences in
the OCCURS clause of this corresponding field in the Screen Section.
The shadow item contains three subfields (bits). The diagram below shows the bits that
constitute a shadow item.
bit 0 bit 5 bit 6 bit 7
not used
CDT 010.CDD
The rightmost bit is the SELECT bit for the screen field. This bit is examined by the
DISPLAY, TURN, RESET, and SET NEW-CURSOR statements that include the
SHADOWED modifier. When the SHADOWED modifier is used in the statement, a
field listed in the statement is not affected unless the SELECT bit in its shadow item is
set to 1. This bit is set programmatically by the user by moving a value to the shadow
item.
The bits to the left of the SELECT bit are the RETURN and ENTER bits. When a
shadowed screen field is specified in an ACCEPT statement, a 1 or a 0 is stored into
each of these bits. The values stored depend on the information received from the
terminal. The values and the associated conditions are listed in Table 5-6. If the
modified data tag (MDT) is set on (MDTON), the RETURN bit is always set on an
ACCEPT statement.
For example, if a numeric shadow item equals 4, the screen field associated with the
shadow item held fill characters or blanks on the execution of the ACCEPT statement.
In this situation, program logic could provide for displaying the screen field again by
setting the SELECT bit. To set the SELECT bit, the program could move 5 to the
shadow item and maintain the existing bit pattern for the RETURN and ENTER bits.
An example of the SHADOWED clause is:
SCREEN SECTION.
01 LOCATION-REC-SCREEN BASE SIZE 24, 80.
05 STATE-FIELD AT 5, 28 PIC X(2)
USING WS-STATE SHADOWED BY
WS-STATE-SHAD. (1)
WORKING-STORAGE SECTION.
05 WS-STATE-SHAD PIC 9 COMP. (2)
PROCEDURE DIVISION.
MOVE 0 TO WS-STATE-SHAD. (3)
ACCEPT LOCATION-REC-SCREEN (4)
IF WS-STATE-SHAD EQUAL 4 (5)
MOVE 5 TO WS-STATE-SHAD (6)
DISPLAY LOCATION-REC-SCREEN SHADOWED. (7)
{ TO } data-name-1
{ FROM }
{ USING }
TO
specifies that data is to be moved from the screen field into the data-name-1
area; this is an input association.
FROM
specifies that data is to be moved from the data-name-1 area into the screen
field; this is an output association.
USING
is equivalent to specifying both TO and FROM with the same data name.
data-name-1
is a Working-Storage data item associated with an elementary screen field; the field
cannot be a subscripted item.
UPSHIFT Clause
The UPSHIFT clause specifies that lowercase alphabetic characters are to be translated
to uppercase characters for input and output.
UPSHIFT [ INPUT ]
[ OUTPUT ]
[ INPUT-OUTPUT ]
[ I-O ]
The USER CONVERSION clause is used only if the application makes use of a user
conversion procedure.
When an input screen field contains only blanks or fill characters, use the CONVERT
BLANKS to allow the USER CONVERSION clause to be invoked.
When a user presses the Tab key twice to bypass a field, the MDT (modified data tag)
does not get set. In such situations, use the WHEN ABSENT CLEAR clause to force
blanks in a field. The WHEN ABSENT CLEAR clause, in conjunction with the
CONVERT BLANKS clause, allows the USER CONVERSION clause to be invoked.
Refer to the Compaq NonStop™ Pathway/iTS TCP and Terminal Programming Guide
for details regarding user conversion procedures.
VALUE Clause
The VALUE clause specifies the initial value of a screen field. The initial value is
displayed during a DISPLAY BASE or OVERLAY statement, during a RESET DATA
statement, and during screen recovery. The VALUE clause is required for literal screen
fields.
VALUE nonnumeric-literal
nonnumeric-literal
is the character form of the specified value. The nonnumeric-literal must
not be longer than the size specified for the field in the PICTURE clause; if it is
shorter, the nonnumeric-literal is left-justified and padded with the fill
character.
The value does not have to be valid according to conversion and checking restraints for
input fields. However, if the value is not valid and the value is entered at the terminal
during ACCEPT statement processing, the field is in error.
The VALUE clause cannot be used for a field using the OCCURS clause.
When the VALUE clause is used with a field that allows only double-byte data, the
literal string provided must follow the same rules defined for a VALUE clause
associated with a Working-Storage PIC N field.
The following example illustrates the VALUE clause:
SCREEN SECTION.
01 ORD-DETAIL-SCRN SIZE 12, 40.
05 FILLER AT 1, 12 VALUE "ORDER DETAIL ENTRY".
05 FILLER AT 2, 1 VALUE "CUSTOMER".
05 ENTRY-GROUP AT 5, 4.
10 FILLER AT @, @ VALUE "ITEM".
10 FILLER AT @, @ + 9 VALUE "QUANT".
If this clause is omitted, the default clauses are WHEN ABSENT SKIP (absent fields are
skipped) and WHEN BLANK CLEAR (blank fields are cleared).
ABSENT
indicates that the clause acts on a screen field that the terminal operator skips over
without entering any data.
BLANK
indicates that the clause acts on a screen field in which a terminal operator enters
either blank or fill characters, or skips over a BLANK field for which the screen
field attribute, MDT (modified data tag), is set.
CLEAR
sets the Working-Storage to zero for numeric items and to spaces for alphabetic or
alphanumeric items.
SKIP
leaves the Working-Storage unaltered.
When a user presses the Tab key twice to bypass a field, the MDT does not get set. In
such situations, use the WHEN ABSENT CLEAR clause to force blanks in a field. The
WHEN ABSENT CLEAR clause, in conjunction with the CONVERT BLANKS clause,
allows the USER CONVERSION clause to be invoked.
TAB
causes the cursor to advance to the next input field.
LOCK
causes the terminal to lock the keyboard.
If this clause is omitted, the default is LOCK.
The WHEN FULL clause is only effective for terminals that support more than one
alternative action. Currently those terminals are the T16-6520, T16-6530, T16-6540,
and the IBM3270.
MESSAGE SECTION.
01 message-name [ 01-clause... ].
message-name
is a user-defined name as described in Section 2, SCREEN COBOL Source
Program.
01-clause
defines the characteristics of the message. Allowable clauses are:
FIELD-DELIMITER
MESSAGE-DELIMITER
MESSAGE FORMAT
PICTURE
RESULTING COUNT
TO/FROM/USING
USER CONVERSION
group-clause
defines the characteristics of the group item. Allowable clauses are:
OCCURS
OCCURS DEPENDING ON
PRESENT IF
USER CONVERSION
field-clause
defines the characteristics of the field item. Allowable clauses are:
FIELD STATUS
OCCURS
OCCURS DEPENDING ON
PICTURE
PRESENT IF
RESULTING COUNT
TO/FROM/USING
USER CONVERSION
FILLER Restrictions
The use of FILLER is permitted at any level. However, you must observe the following
restrictions:
• When FILLER appears at the 01 level, that message cannot be the object of
Procedure Division statements capable of Message Section access.
• When FILLER appears at any level, the FILLER item cannot have a
FROM/TO/USING clause associated with it. A field defined as FILLER
acts only as a place holder. This field cannot cause a reference to Working-Storage
for reading or storing data.
FILLER Usage
To match the incoming data stream or create the desired output data stream, you can
define the necessary FILLER fields in the Message Section.
1. On input, fields declared as FILLER are not processed. The TCP ignores a FILLER
field and processes the next field.
2. On output, fields declared as FILLER are replaced with fill. Nonnumeric fields are
filled with blanks.
3. Numeric fields are filled with zeros (binary if COMP, otherwise ASCII).
PIC 1 fields are filled with zero bits.
The FILLER fields in the Message Section define the format of the data. FILLER fields
in the paired Working-Storage Section data structure are optional.
A FILLER item in the Message Section acts only as a place holder. A FILLER item in
the Working-Storage Section sets aside an area of real storage.
You might want to include FILLER items in Working-Storage to set aside storage for
future use, or for documentation purposes.
FILLER items in Working-Storage cannot be referenced individually. However, the
group item that includes the FILLER items can be referenced.
In the following example either of the paired Message Section and Working-Storage
Section data structures is acceptable.
WORKING-STORAGE SECTION.
01 WS-MSG
05 WS-A PIC X
05 WS-B PIC X
05 WS-C PIC X
05 WS-D PIC X
MESSAGE SECTION.
01 MS-MSG
05 MS-A PIC X FROM WS-A
05 MS-B PIC X FROM WS-B
05 FILLER PIC X
05 MS-C PIC X FROM WS-C
05 MS-D PIC X FROM WS-D
WORKING-STORAGE SECTION.
01 WS-MSG
05 WS-A PIC X
05 WS-B PIC X
05 FILLER PIC X
05 WS-C PIC X
05 WS-D PIC X
MESSAGE SECTION.
01 MS-MSG
05 MS-A PIC X FROM WS-A
05 MS-B PIC X FROM WS-B
05 FILLER PIC X
05 MS-C PIC X FROM WS-C
05 MS-D PIC X FROM WS-D
MESSAGE SECTION.
01 MSG PIC X(10) USING WS-MSG.
When there are multiple fields within a message, the following rules apply:
• The 01 level item cannot have a PICTURE clause or a TO, FROM, or USING
clause.
• The group level item cannot have a PICTURE clause or a TO, FROM, or USING
clause.
• Each field level item, with the exception of the FILLER item, must have a
PICTURE clause and a TO, FROM, or USING clause.
The following example shows the use of the PICTURE clause and the FROM clause in
a multiple-field message.
WORKING-STORAGE SECTION.
01 WS-MSG.
05 WS-GROUP.
10 WS-FLD1 PIC X(10).
10 WS-FLD2 PIC X(10).
MESSAGE SECTION.
01 MS-MSG.
05 MS-GROUP.
10 MS-FLD1 PIC X(10) FROM WS-FLD1.
10 MS-FLD2 PIC X(10) FROM WS-FLD2.
WORKING-STORAGE SECTION.
01 WS-MSG
05 WS-MSG-FLD1 PIC X(10) VALUE IS 10.
05 WS-MSG-FLD2 PIC X(10) VALUE IS 20.
05 WS-MSG-FLD3 PIC X(5) VALUE IS 30.
05 WS-MSG-FLD4 PIC 9(5) COMP VALUE IS 12345.
MESSAGE SECTION.
01 MSG MESSAGE FORMAT IS FIXED.
05 MSG-FLD1 PIC X(10) FROM WS-MSG-FLD2.
05 MSG-FLD2 PIC X(5) FROM WS-MSG-FLD3.
05 MSG-FLD3 PIC X(10) FROM WS-MSG-FLD1.
05 MSG-FLD4 PIC 99,999 FROM WS-MSG-FLD4.
For detailed information on how to define the message description entry to reorder,
format, and convert the data, refer to the Compaq NonStop™ Pathway/iTS TCP and
Terminal Programming Guide.
FIELD-DELIMITER [ IS ] { "character" }
{ decimal-value }
{ ON }
{ OFF }
"character"
is any single ASCII character enclosed in quotation marks. The default field
delimiter is a comma (,).
decimal-value
is a number from 0 through 255. This number is the decimal representation of the
desired ASCII or EBCDIC character. For example, 80 represents the letter P in
ASCII or the ampersand (&) in EBCDIC.
ON
enables processing of delimiters at the field level.
OFF
disables processing of delimiters at the field level.
The following rules apply:
• To use field delimiters, you must specify FIXED-DELIMITED or DELIMITED in
the MESSAGE FORMAT clause.
• If you omit the FIELD-DELIMITER clause and the message format is FIXED-
DELIMITED or DELIMITED, field delimiter processing is enabled and the default
field delimiter is a comma (,).
• When processing a message on a field-by-field basis, you can use the FIELD-
DELIMITER clause with the RESULTING COUNT clause. Refer to the
RESULTING COUNT Clause for details.
data-item-1
is a Working-Storage group or elementary data item. The size of data-item-1
must be at least 4 bytes or compiler error 369 is generated. The following rules
apply:
• The first 2 bytes of data-item-1 contain the shadow portion of the field
status information. The shadow portion is used with the PRESENT IF clause to
determine if a conditionally present field is present.
• The second 2 bytes of data-item-1 contain the field error portion of the
field status information. The field error portion is used to obtain information on
editing errors on fields where editing is specified.
• The following format is recommended for data-item-1; this format is
recommended so you can have accessible variable names for the shadow portion
and the field error portion:
02 FIELD-STATUS-AREA.
03 SHADOW-INFO PIC 9(4) COMP.
03 FIELD-ERROR PIC 9(4) COMP.
• You must define data-item-1 as COMP data because the shadow values and
error numbers that the TCP moves into these locations are binary values.
• data-item-1 is always updated when data is mapped through the associated
Message Section field. If you use FIELD STATUS to determine the presence of
a conditionally present field, you can also use the field status information to
detect editing errors on the field.
The TCP generates pad data if a field has not been entered, but needs to be physically
stored (shadow field = 4 or 5). The TCP generates pad data so that the application does
not reference previously stored data.
The pad data generated for the target Working-Storage data item is blank spaces for a
nonnumeric item and zeros (binary if COMP, otherwise ASCII) for a numeric item.
The TCP considers a field to be not entered and generates pad data when:
• The message specifies that a field is conditionally present and the condition is not
met so that the TCP finds the field to be absent
• The message specifies that field delimiters are enabled and optionally that message
delimiters are enabled. The TCP finds:
° Two consecutive delimiters—two field delimiters or a field delimiter followed
by a message delimiter
° A field delimiter as the last character of the message and the associated field is
the last field of the message
The selected state only has effect during output processing on a field. The selected state
provides you with the capability to override PRESENT IF processing on a field.
Overriding PRESENT IF processing will be the exception rather than the common
course of action. However, there might be instances where you need to output a given
field even if the PRESENT IF processing shows the field to be absent.
The selected state can assume the value of 1 or 0.
• Selected state = 1—The TCP unconditionally outputs the field. The field is output
regardless of the result of any conditionally present processing on the field caused
by the PRESENT IF clause.
• Selected state = 0—The result of the PRESENT IF processing on the field is a factor
in the decision to output that field.
Table 5-10 shows the logical relationship between the FIELD STATUS shadow data
item and PRESENT IF processing.
The field error data item allows the TCP to report specific edit errors that relate to the
specified Message Section field. The following discussion on error processing tells you
how to process the field error data item.
Use the ON ERROR clause to detect any error that occurs on input or output of the
message from Working-Storage. Use the FIELD STATUS clause to detect specific edit
errors.
If an error is detected on either an input or output operation, the ON ERROR path is
taken. The processing of the ON ERROR clause for RECEIVE UNSOLICITED
MESSAGE, REPLY TO UNSOLICITED MESSAGE, SEND MESSAGE, and
TRANSFORM is the same as that for the CALL and SEND statements.
As part of the ON ERROR processing you need to check for a TERMINATION-
STATUS of 5 or 15 to determine if any edit errors have occurred (5 indicates input phase
and 15 indicates output phase). If TERMINATION-STATUS is 5 or 15, you can then
process the FIELD STATUS field error data item to determine which field or fields had
edit errors.
The process of deciding which message template the FIELD STATUS data item belongs
to differs for the input message and the output message.
For input messages, you need to know which of the message templates of the YIELDS
list you were processing when the error(s) occurred.
The relative position of the YIELDS list is returned in TERMINATION-SUBSTATUS.
The position is returned in TERMINATION-SUBSTATUS instead of TERMINATION-
STATUS because this is the ON ERROR case. At this point TERMINATION-STATUS
holds the error number. If this were the normal case, not ON ERROR, TERMINATION
STATUS would be used to define the relative position in the YIELDS list.
The following SEND MESSAGE shows the YIELDS associated with the input
messages when the ON ERROR clause is executed due to an edit error.
SEND MESSAGE MSG-3-OUT-M-1
REPLY CODE FIELD IS WS-MSG-4-IN-FROM-MSG-4-IN-CODE
CODE 1 YIELDS MSG-3-IN,
CODE 2 YIELDS MSG-4-IN,
CODE 3 YIELDS MSG-3-IN,
CODE 4 YIELDS MSG-4-IN,
ON ERROR PERFORM IDS-SERVER-SEND-ERROR.
The following PERFORM statement shows how to use TERMINATION- SUBSTATUS
to decide which input message template to process.
IDS-SERVER-SEND-ERROR.
PERFORM ONE OF
PROC-MSG-3-IN-EDIT-STATUS,
PROC-MSG-4-IN-EDIT-STATUS,
PROC-MSG-3-IN-EDIT-STATUS,
PROC-MSG-4-IN-EDIT-STATUS,
DEPENDING ON TERMINATION-SUBSTATUS.
The following table shows which input message correlates with which
TERMINATION-SUBSTATUS.
Message Template TERMINATION-SUBSTATUS
YIELDS MSG-3-IN 1
YIELDS MSG-4-IN 2
YIELDS MSG-3-IN 3
YIELDS MSG-4-IN 4
For output messages, you know which set of FIELD STATUS data items to interrogate
because only one message template can be specified on output.
Table 5-11 lists the error numbers that can be found in the field error data item.
MESSAGE-DELIMITER Clause
The MESSAGE-DELIMITER clause defines the character(s) used to delimit the
message’s end. You can use this clause to define a message delimiter that matches the
message delimiter that your program expects. The default message delimiter is two
slashes (//).
The MESSAGE-DELIMITER clause can also disable processing of the message
delimiter. You can disable processing of the message delimiter if message delimiters
are not expected in the message format.
char-code
is any single ASCII character in quotation marks or is a number from 0 through 255.
This number is the decimal representation of the desired ASCII or EBCDIC
character. For example, 80 represents the character P in ASCII or the character
& in EBCDIC.
OFF
disables processing of delimiters at message level. The following rules apply:
• To use message delimiters, you must specify FIXED-DELIMITED or
DELIMITED in the MESSAGE FORMAT clause.
• If you omit the MESSAGE-DELIMITER clause, message delimiter processing
is enabled and the default message delimiter is two slashes (//).
• When dealing with the data stream on a message level, you can use the
MESSAGE-DELIMITER clause with the RESULTING COUNT clause. Refer
to the RESULTING COUNT clause for details.
FIXED
indicates that the message is fixed length. This is the default format.
DELIMITED
indicates that the message is made up of varying-length fields and that each field is
terminated by a specified delimiter.
FIXED-DELIMITED
indicates that the message is made up of fixed-length fields and that each of these
fields is terminated by a specified delimiter.
VARYING1
indicates that the message is variable length with a one-byte count to specify the
actual number of characters (bytes) it contains. If the count is zero, the message is
empty. The maximum size for a message of VARYING1 format is 255 bytes.
VARYING2
indicates that the message is variable length with a two-byte count that specifies the
actual number of characters (bytes) it contains. If the count is zero, the message is
empty.
The following rules apply:
• If you omit the MESSAGE FORMAT clause, the message format is FIXED.
• The format you choose depends on the intelligent device. For instance, some
personal computers expect only fixed-length messages; other devices can handle
variable-length messages.
• You must specify the maximum length of a variable-length message in the
PICTURE clause for the message.
° For a single-field message there is only an 01 level data item. The PICTURE
clause in this 01 item specifies the maximum length of the message.
° For a multiple-field message there is a PICTURE clause in each field. The
maximum length of the message is the sum of the individual field lengths.
Example 1
Message MSG1 has a fixed length of two characters.
01 MSG1 PIC X(2) MESSAGE FORMAT IS FIXED ...
This message could also have been described as:
01 MSG1 PIC X(2) ...
When the MESSAGE FORMAT clause is omitted, the message length is fixed by
default.
Example 2
Message MSG2 can contain up to five characters of data. The actual number of data
characters it contains is kept in a one-byte count; this count is not included in the size of
the message specified in its PICTURE clause.
01 MSG2 PIC X(5) MESSAGE FORMAT IS VARYING1 ...
Example 3
Message MSG3 can contain up to eight characters of data. The actual number of
characters is kept in a two-byte count that is not included in the message size specified
in the PICTURE clause.
01 MSG3 PIC X(8) MESSAGE FORMAT IS VARYING2 ...
Example 4
The following example has a DELIMITED message format and uses the field delimiters
to process the message.
WORKING-STORAGE SECTION.
01 WS-MSG4-RECORD-1.
02 WS-LENGTH-1 PIC 9(4) COMP.
02 WS-RECORD-1-GROUP.
03 WS-RECORD-1 PIC X(1)
OCCURS 1 TO 16 TIMES
DEPENDING ON WS-LENGTH-1.
01 WS-MSG4-RECORD-2.
02 WS-LENGTH-2 PIC 9(4) COMP.
02 WS-RECORD-2-GROUP.
03 WS-RECORD-2 PIC X(1)
OCCURS 1 TO 16 TIMES
DEPENDING ON WS-LENGTH-2.
MESSAGE SECTION.
01 MSG4 MESSAGE FORMAT IS DELIMITED
MESSAGE-DELIMITER IS OFF
FIELD-DELIMITER IS ":".
05 MS-RECORD-1 PIC X(16) USING WS-RECORD-1
RESULTING COUNT IS WS-LENGTH-1.
05 MS-RECORD-2 PIC X(16) USING WS-RECORD-2
RESULTING COUNT IS WS-LENGTH-2.
Message MSG4 consists of two fields and can contain up to 32 characters of data. The
actual length of each field, in bytes, is placed into a separate Working-Storage location,
WS-LENGTH-1 and WS-LENGTH-2 respectively. The field delimiter is not stored in
the target Working-Storage location, WS-RECORD-1 or WS-RECORD-2. The field
delimiter is not reflected in the RESULTING COUNT value.
Example 5
The following example has a DELIMITED message format but inputs the entire
message without regard to delimiter processing.
WORKING-STORAGE SECTION.
01 WS-MSG5.
05 WS-RECORD-LENGTH PIC 9(4) COMP.
05 WS-DATA-GROUP.
10 WS-DATA PIC X(1)
OCCURS 1 TO 1000 TIMES
DEPENDING ON WS-RECORD-LENGTH.
MESSAGE SECTION.
num-lit-1
indicates the number of elements in a field. num-lit-1 is a positive numeric
literal that is greater than or equal to one.
num-lit-2
indicates the minimum number of elements in a field. num-lit-2 is a positive
numeric literal that is greater than or equal to zero.
num-lit-3
indicates the maximum number of elements in a field. num-lit-3 is a positive
numeric literal where num-lit-3 is greater than num-lit-2.
num-name-1
provides a count of the number of occurrences of the data item that makes up the
group or field. num-name-1 is a Working-Storage or Linkage Section elementary
numeric data item.
The following rules apply:
• The compiler does not do minimum bounds checking when processing message
fields.
• When processing a message that contains a variable number of occurrences of a
field, the number of occurrences of the field must be previously specified in the
program. Therefore, the OCCURS DEPENDING ON clause can be used in the
Message Section only under the following conditions:
° You can only use the OCCURS DEPENDING ON clause in the Message
Section to output a message. You cannot use OCCURS DEPENDING ON in
the Message Section to input a message.
° You should define the message with MESSAGE FORMAT IS DELIMITED in
the Message Section.
° You must declare the number of occurrences of the field you want to output in a
Working-Storage Section elementary data item, num-name-1. For example:
WORKING-STORAGE SECTION.
01 WS-Message-Out
05 WS-Message-Length PIC 9(4) COMP.
05 WS-Message-Data PIC X OCCURS 1 TO 1024 TIMES
DEPENDING ON WS-Message-Length.
MESSAGE SECTION.
01 Message-Out PIC X
FROM WS-Message-Data
Note. Another way of sending variable length messages uses the RESULTING COUNT
clause and results in faster processing. The following example accomplishes the same thing
as the previous one, but runs three times faster.
WORKING-STORAGE SECTION.
01 WS-Message-Out
05 WS-Message-Data PIC X OCCURS 1 TO 1024 TIMES
DEPENDING ON WS-Message-Length.
MESSAGE SECTION.
MESSAGE SECTION.
01 Msg4-Out.
05 MS-Record-1 PIC X
FROM WS-Record-1
OCCURS 1 TO 10 TIMES
DEPENDING ON WS-Length-1.
05 MS-Record-2 PIC X
FROM WS-Record-2
OCCURS 1 TO 10 TIMES
DEPENDING ON WS-Length-2.
PICTURE Clause
The PICTURE clause specifies the length, data type, and editing format of a message
field.
{ PIC } [ IS ] character-string
{ PICTURE }
character-string
is a symbol that determines the category of a field, places restrictions on values
assignable to the field, and defines editing operations.
The character-string can take the same form as that described in the data
description entry with the following exceptions:
• Numeric edited and alphanumeric edited forms are allowed.
• Bit fields are allowed.
The maximum message size is 32,000 bytes.
Note. Each message field description must include a PICTURE clause.
The PIC 1 format allows you to process fields of 1 bit in length or to process data in
encoding schemes that require character lengths other than 1 byte. For example, packed
decimal or binary coded decimal (BCD) require character lengths of 4 or 6 bits
respectively. Here are some examples of the PIC 1 format:
PIC 1. single binary digit (1-bit field)
PIC 1(6). 6 bits together (BCD character)
PIC 1(8). 8 bits together (1-byte field)
PIC 1(64). 64 bits (8 bytes) to form a single field
This format gives you the capability to decompose a message data stream on a bit-by-bit
basis. This capability is useful when processing bit maps within a message.
The PIC 1 field specification raises the issue of data alignment to byte boundaries
because it is now possible to define fields that are not exact multiples of full bytes.
When using the PIC 1 format, it is recommended that the Message Section maintain a
byte-oriented structure. For example:
MESSAGE SECTION.
01 MS-ATM-Record
05 MS-Bit-Map.
10 MS-Bit-1-Savings PIC 1(1)
USING WS-Bit-1.
10 MS-Bit-2-Checking PIC 1(1)
USING WS-Bit-2.
10 MS-Bit-3-Credit-Card PIC 1(1)
USING WS-Bit-3.
10 FILLER PIC 1(5).
05 MS-Savings.
10 Savings-Data PIC X(15)
TO WS-Savings-Data
PRESENT IF MS-Bit-1-Savings
FIELD STATUS IS WS-Field-Status-Savings.
Also, it is possible to have a field other than a byte-sized one preceding a byte-sized
field. For example:
MESSAGE SECTION.
01 MS-Message.
05 Field-1 PIC 1.
05 Field-2 PIC X.
The logical length of the above message is 9 bits rather than 16 because there is no
padding between the single bit field and the following byte field. However, notice that
data communication protocols round up the physical length of the message to a full byte
boundary. The TCP receives two physical bytes, but only processes the first 9 bits.
Therefore, you need to declare the message as follows:
MESSAGE SECTION.
01 MS-Message.
05 Field-1 PIC 1.
05 Field-2 PIC X.
05 FILLER PIC 1(7).
The 7 bits needed to round up the physical length to 16 bits can be declared as FILLER
because these bits have to be declared but not processed.
Item Size
The size of a message field is determined by the symbols of its PICTURE string. The
character-string symbols DB and CR each count as two character positions. Symbols V
and P do not count as character positions. The character-string symbol 1 represents one
bit. All other symbols count as one character position.
Input Operations
• The source is a Message Section item. The destination is a Working-Storage
Section item.
• For a Working-Storage PIC 9 COMP field, the data bits from the Message Section
item are placed into the least significant bit positions of the Working-Storage item.
There is high order zero fill or truncation if needed.
• For a Working-Storage PIC 9 field, the binary numeric value is translated into the
ASCII characters that represent the decimal value of the field. If the Working-
Storage item cannot support the number, the error "value overflow" is reported and
the requester program is suspended, or an ON ERROR clause is activated.
• For a Working-Storage PIC X field, the data bits from the Message Section item are
placed into the most significant bit positions of the Working-Storage item. There is
low order zero fill or truncation if needed.
• For a Working-Storage PIC A field, the compiler detects and flags an error. A PIC
A field is composed of ASCII characters that must represent: A through Z, a
through z, or space.
• Truncation rules for input operations
° Truncation occurs when the destination is shorter than the source.
° If the destination Working-Storage field is PIC X, trailing bits are truncated. No
indication of truncation is given to the application program.
° If the destination Working-Storage field is PIC 9 COMP and that item cannot
support the size of the Message Section item, the following happens: the TCP
indicates that an overflow occurred by either suspending the requester program,
or by activating ON ERROR processing.
• Filling rules for input operations
° Filling occurs when destination is longer than source.
° Destination Working-Storage PIC X fields are padded in the least significant
(trailing) portion of the field with nulls (binary zeros).
° Destination Working-Storage PIC 9 fields are filled in the most significant
(leading) portion of the field with nulls (binary zeros).
Output Operations
• The source is a Working-Storage Section item. The destination is a Message
Section item.
• Data is retrieved from the least significant or most significant portion of the source
field, depending on whether the source field is numeric or nonnumeric.
• For a Working-Storage PIC 9 field, data bits from the least significant portion of the
field are used to supply the data for the Message Section field item. There is right to
left processing of both source and destination fields, least significant to least
significant.
• For a Working-Storage PIC A or X field, data bits from the most significant portion
of the field are used to supply the data for the Message Section field item. There is
left to right processing of both source and destination fields, most significant to most
significant.
• Truncation rules for output operations
° Truncation occurs when the destination is shorter than the source.
° For Working-Storage PIC X and A fields (nonnumeric data), trailing bits are
truncated. The length of the destination Message Section item determines how
many bits are allowed. No indication of truncation is given to the application
program.
° For Working-Storage PIC 9 and 9 COMP fields (numeric data), no loss of data
is allowed. The TCP indicates that an overflow occurred by either suspending
the requester program, or by activating ON ERROR processing.
• Filling rules for output operations:
° Filling occurs when destination is longer than source.
° For Working-Storage PIC X fields, the TCP pads the least significant (trailing)
portion of the Message Section field with nulls (binary zeros).
° For Working-Storage PIC 9 fields, the TCP fills the most significant (leading)
portion of the Message Section field with nulls (binary zeros).
Example
On input, if a PIC 1(9) Message Section item is placed into a PIC X(2) or PIC 9(2)
Working-Storage item, the resulting values are:
PIC X(2) bit positions: 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7
resulting X(2) data: x x x x x x x x x 0 0 0 0 0 0 0
On output, in the above example, the data is fetched from where the x variables appear.
This example illustrates the rule of left to right processing from PIC X(n) fields and
right to left processing from PIC 9(n) fields.
PRESENT IF Clause
The PRESENT IF clause defines a field within a message to be optionally present based
on the value of a control field.
• The control field and the optionally present field must be in the same 01 message
structure.
• The control field must precede the optionally present field. The value of the control
field determines the presence or absence of the optionally present field.
You can use the PRESENT IF clause only with a message format that allows for fields
within a message to be optionally present based upon the value of a previously
processed message field.
The PRESENT IF clause allows you to send or receive only the data that is actually
present, thus reducing the amount of data that must be transmitted.
control-field
is a field in the Message Section that describes the presence or absence of the
associated optionally present field.
A TRUE condition is produced if control-field is a numeric data item that
contains a value other than zero or if control-field is a nonnumeric data item
that contains a character other than blank. When control-field is TRUE, the
optionally present field is considered to be present.
A FALSE condition is produced if control-field is a numeric data item that
contains a zero or if control-field is a nonnumeric data item that contains a
blank. When control-field is FALSE, the optionally present field does not
exist.
NOT
causes the initial Boolean value for control-field to be complemented.
The following rules apply:
• The PRESENT IF clause can be used only with DELIMITED messages.
Specification of PRESENT IF with other message formats will result in a syntax
error. The DELIMITED message format allows you to process variable-length
fields for the data, thus, conserving on data transmission.
• The PRESENT IF clause can be specified at the Message Section group level or at
the field level. When the PRESENT IF clause is specified at the group level, it
causes the condition to be propagated to the fields that belong to this group. These
fields can still specify their own PRESENT IF condition. The group level
PRESENT IF condition is overridden by the field level PRESENT IF condition.
• PRESENT IF clause processing is the same for input and output operations.
• PRESENT IF clauses can be logically nested to any depth. When PRESENT IF
clauses are nested, an optionally present field is present only if a second optionally
present field is present; the second optionally present field is present only if a third
optionally present field is present, and so forth.
• The first level has to be present before you can use the second level, the second level
has to be present before you can use the third level, and so forth.
• To conveniently determine if a conditionally present field is present, specify a
FIELD STATUS clause on the field. You can test the shadow data item in the
FIELD STATUS structure to determine the presence of the field. Refer to the
FIELD STATUS clause for details.
• An alternative, although less desirable, method of testing for the presence of a field
is to make explicit reference to the Boolean values of the Working-Storage data item
associated with the control-field parameter in the PRESENT IF clause.
• You must use caution when setting up the data structures to use the PRESENT IF
clause with the DELIMITED message format. It is possible for one data field to be
substituted for another in an input message without any possibility of detection of
the unintended substitution by the TCP.
The following example shows where such a substitution could take place.
WORKING-STORAGE SECTION.
01 WS-MSG.
02 WS-PIF-1 PIC 9(1) COMP.
02 WS-PIF-2 PIC 9(1) COMP.
02 WS-F1 PIC X(8).
02 WS-F2 PIC X(8).
MESSAGE SECTION.
01 MSG MESSAGE FORMAT IS DELIMITED
FIELD-DELIMITER IS OFF.
02 PIF-1 PIC 1(1) TO WS-PIF-1.
02 PIF-2 PIC 1(1) TO WS-PIF-2.
02 F1 PIC X(8)
PRESENT IF PIF-1
TO WS-F1.
02 F2 PIC X(8)
PRESENT IF PIF-2
TO WS-F2.
The following input record would result in the value F2 being stored in field WS-F2:
0 1 F2
CDT 011.CDD
• 0 is stored in WS-PIF-1
• 1 is stored in WS-PIF-2
• F2 is stored in WS-F2
However, suppose that the 0 and 1 were unintentionally reversed in the input record.
1 0 F2
CDT 012.CDD
• 1 is stored in WS-PIF-1
• 0 is stored in WS-PIF-2
• F2 is stored in WS-F1
In this case, F2 would be stored in field WS-F1, and no indication of the switched data
would be given by the TCP. Furthermore, there is no way that such an indication could
be given because no TCP rules are broken in either case.
01 WS-Input-Output-Record.
05 WS-Record-Length PIC 9(4) COMP.
05 WS-Record PIC X(1)
OCCURS 1 TO 100 TIMES
DEPENDING ON
WS-Record-Length.
01 WS-ATM-Record.
05 WS-Bit-Map.
10 WS-Bit-1 PIC 9(1) COMP.
10 WS-Bit-2 PIC 9(1) COMP.
10 WS-Bit-3 PIC 9(1) COMP.
01 WS-Savings-Acct.
05 WS-Savings-Length PIC 9(2) COMP.
05 WS-Savings-Data PIC X(1)
OCCURS 1 TO 15 TIMES
DEPENDING ON
WS-Savings-Length.
01 WS-Checking-Acct.
05 WS-Checking-Length PIC 9(2) COMP.
05 WS-Checking-Data PIC X(1)
OCCURS 1 TO 15 TIMES
DEPENDING ON
WS-Checking-Length.
01 WS-Credit-Card.
05 WS-Creditc-Length PIC 9(2) COMP.
05 WS-Creditc-Data PIC X(1)
OCCURS 1 TO 15 TIMES
DEPENDING ON
WS-Creditc-Length.
01 WS-Field-Status-Items.
05 WS-Field-Status-Savings.
10 FS-Shadow-Savings PIC 9(4) COMP.
10 FS-Error-Savings PIC 9(4) COMP.
05 WS-Field-Status-Checking.
10 FS-Shadow-Checking PIC 9(4) COMP.
10 FS-Error-Checking PIC 9(4) COMP.
05 WS-Field-Status-Credit-Card.
10 FS-Shadow-Credit-Card PIC 9(4) COMP.
10 FS-Error-Credit-Card PIC 9(4) COMP.
MESSAGE SECTION.
01 MS-Input-Output-Record.
MESSAGE FORMAT IS DELIMITED
FIELD-DELIMITER IS OFF.
05 MS-Record-Length PIC X(100)
USING WS-Record
RESULTING COUNT IS
WS-Record-Length.
01 MS-ATM-Record
MESSAGE FORMAT IS DELIMITED
FIELD-DELIMITER IS OFF.
05 MS-Bit-Map.
10 MS-Bit1-Savings PIC 1(1)
USING WS-Bit-1.
10 MS-Bit2-Checking PIC 1(1)
USING WS-Bit-2.
numeric-data-1
is a numeric elementary data item in either the Working-Storage Section or the
Linkage Section.
On output, the RESULTING COUNT clause combined with the field delimiter permits
the length of each field to be equal to or less than the declared field length. A field of
RESULTING COUNT length terminated by a field delimiter is created, unless field
delimiting has been disabled. When formatting a message of DELIMITED format for
output to the device, you can control the length of the overall message by using the
RESULTING COUNT clause on a field-by-field basis.
You do not reserve a position for the field delimiter in the Message Section description
for the delimited field.
On output of a delimited field, the TCP assembles the field by taking the number of
bytes specified by the RESULTING COUNT length from the Working-Storage
FROM/USING field and placing those bytes into the message. The TCP will then
append the field delimiter, if any, to the field. If the RESULTING COUNT length is 0,
only the field delimiter will be output in the message. If the RESULTING COUNT
length exceeds the maximum number of bytes defined for the field, an ON ERROR
clause will be executed.
Minimum occurrence detection is not enforced. That is, if x > 0 and the delimiter is
found before enough data items are processed to satisfy x, an error will not be generated.
MESSAGE SECTION.
01 MSG-Name-Record
FORMAT IS DELIMITED
FIELD-DELIMITER IS ";".
05 MS-Name PIC X(100)
USING WS-Name
RESULTING COUNT IS WS-Name-Length.
If the incoming name field contains:
SMITH John X.;
Start of Field⁄
The resulting location in Working-StorageWorking-Storage, WS-Name, would contain:
SMITH John X.
Start of Field⁄
The value in WS-Name-Length would be equal to 13.
TO/FROM/USING Clauses
The TO, FROM, and USING clauses associate a Working-Storage Section or Linkage
Section data item with a Message Section item. This association allows the data to be
mapped through the Message Section as it is moved into or out of Working-Storage by
statements such as: SEND MESSAGE, TRANSFORM, RECEIVE UNSOLICITED
MESSAGE, or REPLY TO UNSOLICITED MESSAGE.
{ TO } data-name-1
{ FROM }
{ USING }
data-name-1
identifies the Working-Storage or Linkage Section data area from which message
data is received or to which message data is moved. The data-name-1 item must
be described as either alphanumeric (PIC X) or as binary (PIC 9 COMP or PIC S9
COMP); it must not be described as numeric (PIC 9).
TO
specifies that data is to be moved from the message field to the area indicated by
data-name-1.
FROM
specifies that data is to be moved from the area indicated by data-name-1 to the
message field.
USING
specifies that data is to be moved either from the message field to the
data-name-1 data area or from the data-name-1 data area to the message
field, or both.
A field can be described with both a TO and a FROM clause. If you specify both
clauses, each can have a different data name. The particular clause determines the
general type of the field (input, output, or input-output) as indicated in Table 5-13.
MESSAGE SECTION.
01 MSG1 PIC X(2) TO W-FLD1.
01 MSG2 PIC X(5) FROM W-FLD2 MESSAGE FORMAT IS VARYING1.
01 MSG3 PIC X(8) USING W-FLD3 MESSAGE FORMAT IS VARYING2.
01 MSG4 PIC X(4) FROM W-FLD1 TO W-FLD4
MESSAGE FORMAT IS VARYING1.
Notice that W-FLD3 contains eight characters, the amount required by a COMP field
whose size is between 9(10) and 9(18).
1. The fixed format field MSG1 receives a message containing the two characters AB.
These characters are then passed to W-FLD1:
MSG1 W-FLD1
A B , A B
CDT 013.CDD
A B , 2 A B
count value
CDT 014.CDD
3. The VARYING2 field MSG3 receives a message and passes it to W-FLD3. The first
two bytes of MSG3 specify that the message has two characters of data:
MSG3 W-FLD3
0 2 3 249 , 0 0 0 0 0 0 3 249
count value
CDT 015.CDD
Since W-FLD3 is an eight-byte binary item, the message is right justified in the field
and filled with zeros.
4. The VARYING1 field MSG4 sends a message containing two characters of data
from W-FLD1:
W-FLD1 MSG4
A B , 2 A B
CDT 016.CDD
3 C D E C D E
CDT 017.CDD
Since W-FLD4 is an alphanumeric item, the reply is left justified in the field and
filled with blanks.
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
5- 92
Data Division Special Registers
numeric-literal
specifies the user conversion routine number.
This clause is used only if the application makes use of a user conversion procedure.
Refer to the Compaq NonStop™ Pathway/iTS TCP and Terminal Programming Guide
for details regarding user conversion procedures.
User conversion procedures are provided for input and for output. An input procedure
converts incoming data; an output procedure converts outgoing data. The TCP does no
standard conversion of data passed between an intelligent device and a message field in
the Message Section.
Special Registers
Special registers are data items defined automatically by the SCREEN COBOL
compiler, not by the program. Each special register has a particular purpose and should
be used only in the manner outlined in its description.
For additional information regarding the use of diagnostic screens, refer to Section 6,
Procedure Division and Appendix A, Advisory Messages.
01 NEW-CURSOR.
02 NEW-CURSOR-ROW PIC 9999 COMP.
02 NEW-CURSOR-COL PIC 9999 COMP.
01 OLD-CURSOR.
02 OLD-CURSOR-ROW PIC 9999 COMP.
02 OLD-CURSOR-COL PIC 9999 COMP.
• The message specifies that field delimiters are enabled and optionally that message
delimiters are enabled. The TCP finds:
° Two consecutive delimiters: two field delimiters or a field delimiter followed
by a message delimiter
° A field delimiter as the last character of the message and the associated field as
the last field of the message
• The message specifies that a field is conditionally present and the condition is not
met so that the TCP finds the field to be absent.
This register is relevant with any statement that uses the Message Section on inbound
data, such as: RECEIVE UNSOLICITED MESSAGE, SEND MESSAGE,
TRANSFORM. The register contains a YES if one or more fields are absent; otherwise,
the register contains a NO. The register is initialized to NO at program startup time.
Inbound messages containing absent fields can cause the register's value to change. You
can test the register at any place in the program. Testing is usually most meaningful just
after an operation that could cause the register to change.
This is a read-only register. Programs attempting to modify this special register will be
flagged at compilation with the message:
** ERROR 454 ** READ-ONLY SPECIAL REGISTER;
MAY NOT BE ALTERED
The register has the following implicit declaration:
The value of this register is either YES or NO. The default value for the register is YES.
If the PW-QUEUE-FKEY-UMP special register equals YES and an unsolicited message
arrives during an ACCEPT...ESCAPE ON UNSOLICITED MESSAGE statement, the
keyboard remains unlocked during execution of the unsolicited message logic. If the
operator presses a function key during this time, the function key value is internally
queued in the 6530 terminal. The function key value is read upon execution of the next
ACCEPT statement.
If the PW-QUEUE-FKEY-UMP special register equals NO and an unsolicited message
arrives during an ACCEPT...ESCAPE ON UNSOLICITED MESSAGE statement, the
TCP issues a command to the terminal to lock the keyboard before executing the
unsolicited message logic. The keyboard is unlocked at the next ACCEPT statement.
This action prevents 6530 terminals from internally queuing a function key that the
operator presses between the start of execution of the unsolicited message logic and the
next ACCEPT statement.
The value of this register is either YES or NO. The default value for the register is YES.
If the PW-QUEUE-FKEY-TIMEOUT special register equals YES and a timeout occurs
on an ACCEPT...ESCAPE ON TIMEOUT statement, the keyboard remains unlocked
during execution of the timeout logic. If the operator presses a function key during this
time, the function key value is internally queued in the 6530 terminal. The key value is
read upon execution of the next ACCEPT statement.
If the PW-QUEUE-FKEY-TIMEOUT special register equals NO and a timeout occurs
on an ACCEPT...ESCAPE ON TIMEOUT statement, the TCP issues a command to the
terminal to lock the keyboard before executing the timeout logic. The keyboard is
unlocked at the next ACCEPT statement. This action prevents 6530 terminals from
internally queuing a function key that the operator presses between the start of execution
of the timeout logic and the next ACCEPT statement.
Programs attempting to modify this special register will be flagged at compilation with
the message:
** ERROR 454 ** READ-ONLY SPECIAL REGISTER;
MAY NOT BE ALTERED
The following is an example of how to use this register:
IF PW-UNSOLICITED-MESSAGE-QUEUED EQUALS "YES"
PERFORM process-message
UNTIL PW-UNSOLICITED-MESSAGE-QUEUED EQUALS "NO".
• The screen field items referred to in the DISPLAY statement must be defined in the
base screen and not in an overlay area.
When the REDISPLAY register is set to NO (the default setting), a DISPLAY statement
results in the TCP moving the contents of the screen fields to terminal memory. The
following events occur:
• The TCP obtains screen field values from associated Working-Storage items and
moves the values to terminal memory.
• TCP resets the modified data tags for all screen fields.
When the REDISPLAY register is set to YES and redisplay is enabled for the screen, a
DISPLAY statement usually results in redisplaying the screen field data held in terminal
memory. The following events occur:
• Data already in terminal memory is used for the display. (The TCP moves no values
from Working-Storage items.)
• TCP resets the modified data tags for all screen fields.
If the REDISPLAY register is set to YES and the DISPLAY statement is the first
DISPLAY after a DISPLAY BASE statement during which the screen was not in
terminal memory, the TCP moves all screen field data to terminal memory. The
following events occur in this situation:
• The TCP obtains screen field values from associated Working-Storage items and
moves the values to terminal memory.
• All modified data tags for screen fields are reset.
The register has the following implicit declaration:
Note. Because the TERMINAL-FILENAME special register is in internal form, it should not be
displayed on a terminal screen without first being converted to external form (which should be
done in a server). Displaying TERMINAL-FILENAME directly on a terminal screen might
cause unpredictable results and cause the terminal to return an I/O error.
[ DECLARATIVES.
{ [ section-name SECTION . ]
END DECLARATIVES. ]
{ [ section-name SECTION . ]
Division Structure
The division begins with a division header. The format of the header is:
Declarative Procedures
A special portion of the Procedure Division is reserved for declarative procedures.
These procedures are screen recovery routines specified by USE statements. When
used, this portion must be coded immediately after the Procedure Division header. The
portion begins with keyword DECLARATIVES and ends with keywords
END DECLARATIVES. The following example illustrates a declarative procedure:
PROCEDURE DIVISION.
DECLARATIVES.
RECOV-SECT-1 SECTION.
USE FOR RECOVERY ...
:
END DECLARATIVES.
MAIN SECTION.
begin-my-program.
:
Sections
A section, which is optional, is used to group related paragraphs for processing steps.
Reference to a section name in a PERFORM statement, for example, includes all
paragraphs in that section in the range of the PERFORM.
section-name SECTION.
A section ends at the next section header, at keywords END DECLARATIVES, or at the
physical end of the Procedure Division.
Paragraphs
A paragraph is used to group related sentences and statements. A paragraph usually has
at least one sentence, but sentences are not required.
For example:
get-all-input.
get-the-first-record.
ACCEPT my-screen...
Reference to a paragraph name permits branching from one area of code to another.
A paragraph begins with a paragraph name in Area A. A paragraph ends immediately
before the next paragraph name or section name, or at the physical end of the Procedure
Division.
ADD 25 TO x2,
GO TO next-image.
A conditional sentence tests a conditional item or some relationship between values to
determine an action to take.
The following example illustrates a conditional sentence:
IF last-tax IS LESS THAN current-tax
PERFORM higher-tax
ELSE PERFORM lower-tax.
Procedures
A procedure consists of a paragraph, a group of successive paragraphs, a section, or a
group of successive sections. A procedure name is a paragraph or section name; the
name can be qualified.
ABORT-TRANSACTION Statement
The ABORT-TRANSACTION statement aborts the transaction of a terminal operating
in transaction mode. Transaction mode is an operating mode in which Pathway servers
that are configured to run under the Compaq Transaction Management Facility (TMF)
can lock and update audited files. When this statement executes, all database updates
that were made to audited files during the transaction are backed out and no attempt is
made to restart the transaction.
ABORT-TRANSACTION
Execution of this statement causes the terminal to leave transaction mode, and the
special register TRANSACTION-ID to be set to SPACES.
If the terminal is not in transaction mode when this statement is executed, the terminal is
suspended for pending abort.
If a fatal error occurs while the transaction is being aborted, and the current
BEGIN-TRANSACTION statement does not have an ON ERROR phrase, the terminal
is suspended for pending abort; the current transaction is backed out. If the current
BEGIN-TRANSACTION statement includes an ON ERROR phrase, the ON ERROR
branch is executed, and the terminal is not suspended.
For additional information about programming for TMF, see the Compaq NonStop™
Pathway/iTS TCP and Terminal Programming Guide.
ACCEPT Statement
The ACCEPT statement operates differently for terminals in block mode from terminals
in conversational mode. It cannot be used to communicate with intelligent devices.
If the terminal associated with the SCREEN COBOL program is operating in block
mode, ACCEPT performs the following:
• Waits for response from the terminal
• Receives data from the terminal
• Returns only valid data to the program, determining the validity of the data from the
definitions in the Screen Section of the Data Division
• If invalid data is entered and an ADVISORY field is defined for the base screen,
displays an error message and enhances the field in error so the data can be
corrected or reentered.
If the terminal associated with the SCREEN COBOL program is operating in
conversational mode, ACCEPT performs the following:
• Displays the prompt value defined for the first screen field described with a
PROMPT clause. The prompt value is always displayed in the first column of the
screen line.
• Waits for response from the terminal. If the TIMEOUT phrase is used, ACCEPT
waits the time limit specified in this phrase.
• Receives input from the terminal and stores the data into the associated Working-
Storage items of the program data area. Input can be accepted from the terminal one
screen field at a time, one field per line. However, the capability referred to as
typeahead enables data entry for more than one field on the same line.
• Returns only valid data to the program, determining the validity of the data from the
definitions in the Screen Section of the Data Division.
• If invalid data is entered and an ADVISORY field is defined for the base screen,
displays an error message and redisplays the prompt for the field in error so the data
can be reentered. If no ADVISORY field is defined, it redisplays the prompt but
does not display an error message.
screen-identifier
specifies the screen fields from which data is accepted; ACCEPT statement can have
a maximum of 127 screen fields . Each screen-identifier can name an entire
screen, a screen group, or an elementary input item of any base or overlay screen
that is currently displayed. If screen-identifier is a group, all subordinate
elementary items that have a TO or USING clause in their definition are included in
the reference. Screen-identifier cannot be a subscripted item.
If data is to be accepted from fields defined for both a base screen and an overlay
screen, the screen-identifier list must include the overlay screen identifier
or the identifiers of items included in the overlay declaration. It is not sufficient to
specify the base screen without the overlay screen specification.
The order in which fields appear in the screen-identifier list is the order in
which they are checked and converted.
If this parameter is omitted, the completion condition in either the UNTIL or
ESCAPE clause determines when the statement is to terminate. No data is accepted
from the screen, and no Working-Storage item is altered.
In block mode, if a screen contains only filler items and a DISPLAY statement is
followed by an ACCEPT statement without a screen identifier, the screen remains
until a function key signals the termination of the ACCEPT statement. A typical
instance for omitting the identifier would be during the display of a help screen.
terminal operator can use. At least one of these two clauses must be present with a
completion condition. If both clauses are present, any one completion condition can
appear in only one of the two clauses.
comp-condition-1
specifies the completion conditions under which the statement is to terminate with
input of data.
comp-condition-2
specifies the completion conditions under which the statement is to terminate
without input of data.
Language elements that can appear as completion conditions (comp-condition-
1 or comp-condition-2) are:
ABORT
indicates that the abort input-control characters were entered to terminate the
ACCEPT statement. This phrase is effective only for terminals in
conversational mode. Refer to the ABORT-INPUT clause described in
Section 5.
ABORT is allowed only in the ESCAPE clause. If this phrase is executed, the
data items in Working-Storage are not changed.
If the Break key is enabled by Pathway system configuration commands (either
the PATHCOM SET PROGRAM TYPE or SET TERM command) for the
program unit or for the terminals at which the program unit runs, the ABORT
clause must be specified for the Break key to work.
If the terminal is in block mode, ABORT is treated as a comment.
INPUT
indicates that the ACCEPT statement terminates with valid screen input. This
phrase is effective only for terminals in conversational mode.
If the terminal is in block mode, INPUT is treated as a comment.
TIMEOUT timeout-value
specifies a time limit in seconds that the terminal operator has to complete the
data entry. The timeout-value can be a numeric literal or a numeric data
item; valid values are 0 through 32,767 seconds. If the operator does not
respond in the specified number of seconds, TERMINATION-SUBSTATUS is
set to 40, and the ACCEPT operation is cancelled. TIMEOUT can appear only
in the ESCAPE clause. The maximum timeout value is the largest value that will
fit in a 32-bit field.
If this phrase is not specified, there is no time limit.
UNSOLICITED [ MESSAGE ]
indicates that the ACCEPT statement is to be aborted on the arrival of an
unsolicited message. You detect the receipt of an unsolicited message by
checking for the appropriate condition code value in TERMINATION-STATUS
following completion of the ACCEPT statement. UNSOLICITED MESSAGE
can appear only in the ESCAPE clause.
Use of the PW-QUEUE-FKEY-UMP special register allows locking the
keyboard before processing the unsolicited message logic. For further
information see Special Registers on page 5-93.
Note. In conversational mode, all comp-condition phrases except ABORT, INPUT, TIMEOUT,
and UNSOLICITED MESSAGE are ignored.
mnemonic-name
indicates the ACCEPT operation completes when the terminal operator presses the
associated function key. This assumes mnemonic-name has been associated with
a terminal function key; the association is specified by an IS phrase in the
SPECIAL-NAMES paragraph of the Environment Division. Because of terminal
characteristics, certain keys can be used only in the ESCAPE clause. Table 4-1 lists
the system names of function keys that can be used only in the ESCAPE clause.
If a prompt is used and the field named in the PROMPT clause is an output field, the
ACCEPT statement causes the current value for the output field to be displayed before
reading the data input from the terminal. An output field named in the PROMPT clause
must be defined as FILLER or defined with a FROM or USING clause.
The data entered from the terminal is checked against the requirements given for the
field by its definition in the Screen Section of the Data Division. The TCP checks only
those fields referred to by the screen-identifier list in the ACCEPT statement.
If errors are discovered and the terminal is in block mode during the data checking, the
following occurs:
• If a field with the ADVISORY clause is defined for the current screen, a DISPLAY
TEMPORARY of the advisory field automatically occurs using the standard error
message for the first error detected.
• If the terminal is equipped with an audible alarm, the alarm sounds provided it was
not suppressed in the SCREEN-CONTROL paragraph of the Environment Division.
• The first field in error has a temporary modification of its display attribute with the
standard error enhancement as declared in the SCREEN-CONTROL paragraph. The
program can specify that all fields in error are enhanced (refer to the Input-Output
Section in Section 4).
• The statement is restarted following these display operations.
If no data errors are found during the checking, the following occurs:
• The validated data from all screen fields referred to and present, including all
required fields, is converted and moved into the TO or USING data items in
Working-Storage associated with the screen fields.
• Absent screen input fields do not change the associated Working-Storage data items
unless specifically requested with the WHEN ABSENT field-characteristic clause.
• All SHADOWED fields associated with the input fields of the ACCEPT statement
have their ENTER and RETURN bits set appropriately.
If the completion is through an ESCAPE clause, none of the TO or USING data items is
affected. Data variables retain their values, and SHADOWED ENTER and RETURN
bits are undefined.
At the end of any accept operation, the NEW-CURSOR special register is set to zero
(row 0, column 0). This controls the placement of the cursor for the next accept
operation and causes the default position to be the first field of the current ACCEPT
statement.
The ACCEPT statement indicates the condition that caused completion by storing the
condition code value into the TERMINATION-STATUS special register. Each
completion condition is assigned a code value according to its position in the UNTIL or
ESCAPE clauses. The codes are assigned by considering the conditions of the UNTIL
and ESCAPE clauses to be a single list, and assigning each condition the code value that
corresponds to its position in the list. When several conditions are grouped together
with parentheses, they are all considered to occupy the same position; that is, all the
conditions within the parentheses receive the same code value, and the next condition
following the group receives the code value that is one greater than that assigned to the
conditions in the group.
In the following example, the value of TERMINATION-STATUS is 1 if the Enter key
is pressed, 2 for the CLEAR key, 2 for the PA1 key, and 3 for the PF1 key.
ACCEPT CUSTOMER-SCREEN UNTIL ENTER
ESCAPE ON (CLEAR, PA1), PF1
In the next example, the value of TERMINATION-STATUS is 1 if F1 is pressed, 2 if
Shift-F16 is entered, 3 if there is a timeout, and 4 if an unsolicited message is received.
GET-OPER-INPUT.
ACCEPT my-screen
UNTIL f1-key
sf16-key
ESCAPE ON
TIMEOUT 300
UNSOLICITED MESSAGE.
2. Within the same row, the screen field with a lower column number is processed
before a screen field with a higher column number.
The input data is checked against the requirements given for a field by the
field definition in the Screen Section. Only those fields referred to by the
screen-identifier list are checked. During ACCEPT statement processing, the input data
is scanned for input-control characters that identify the input fields and indicate an abort,
end-of-input, or restart operation. Mnemonic names (except BELL and HIDDEN) are
not recognized in conversational mode; therefore, function keys have no effect.
A field error affects only the data in the field that contains the error; fields containing
data entered before the error was detected remain valid. Fields containing data entered
after the error was detected are ignored.
If an error is discovered during the data checking, the following occurs:
• Only the first field having an error is detected and enhanced. The BELL attribute is
the only recognized error enhancement in conversational mode.
• If a field with the ADVISORY clause is defined for the current screen, the advisory
field is displayed on the next line following the line with the error.
• ACCEPT processing restarts after the error display operation. The prompt for the
field containing the error is redisplayed, and the cursor is positioned to accept the
correct input.
Not all errors are detected immediately. If an error is detected after subsequent screen
fields have been entered and processed, an error message is displayed and the ACCEPT
statement is restarted at the beginning. This is the same action that occurs when a
restart-input character is processed.
If no data errors are found during the checking, the following occurs:
• The validated data from each screen field referred to is converted and moved as the
field is received from the terminal. The converted data is placed in either the TO or
USING data item in Working-Storage associated with the screen field. The
characteristics defined for a screen field such as PICTURE, UPSHIFT, and so forth,
apply to the converted value.
• Absent screen input fields do not change the associated Working-Storage data items
unless specifically requested with the WHEN ABSENT field-characteristic clause.
• All SHADOWED fields associated with the input fields of the ACCEPT statement
have their ENTER and RETURN bits set appropriately. If these bits are checked by
a comparison statement, the ENTER and RETURN bits should be checked together.
ACCEPT statement processing stores a condition code into the TERMINATION-
STATUS special register. A code value is assigned to each completion condition in the
same way as described previously for block mode.
The Break key for conversational terminals can be enabled to terminate an ACCEPT
operation. The Break key is enabled through the PATHCOM commands SET TERM or
SET PROGRAM TYPE in the Pathway system configuration. Also, for the Break key
to work on an ACCEPT, the SCREEN COBOL program must include an ESCAPE ON
ABORT clause in the ACCEPT statement. If the Break key is enabled and pressed
during an ACCEPT operation, the key has the same effect as entering the abort input-
control characters.
The following example illustrates an ACCEPT statement for conversational mode. The
value of TERMINATION-STATUS is 1 if valid input is entered, 2 for ABORT, and 2
for TIMEOUT.
ACCEPT EMPLOYEE-SCREEN UNTIL INPUT
ESCAPE ON (ABORT, TIMEOUT 180).
PERFORM ONE OF
300-CHECK-NULL-NAME
200-EXIT-ROUTINE
DEPENDING ON TERMINATION-STATUS.
The CLEAR INPUT statement resets the MDT bits and displays null values in all
unprotected fields of the screens currently displayed. RESET ATTR or TURN
MDTOFF can be used instead if blanking out the input fields is not desired.
You must consider another MDT convention: the TCP turns a field’s MDT bit on in the
following operations:
• When a TURN TEMP statement selects an input field for changing display
attributes, the MDT bit is always set.
• When a RESET TEMP statement selects an input field for resetting display
attributes, the MDT bit is set, regardless of the initial MDT attribute of the field.
These two exceptions apply only to the TURN and RESET statements that have the
TEMP modifier.
This MDT convention allows fields to be handled correctly when they contain errors.
When an error is detected in a field, a TURN TEMP statement of a display attribute is
normally performed on that field, whether explicitly by the program or implicitly by the
action of the ACCEPT statement. As indicated by the preceding rules, the MDT is set
also, thus guaranteeing that the data from the field will again be sent from the terminal
on the next read operation. After that next read operation, a RESET TEMP operation is
performed, which removes the flagging display attribute while again turning the MDT
bit on. The latter setting of the MDT is necessary because a subsequent read of the same
data might be performed if another field is found to be in error, and the data in the field
that was RESET must be sent once again to be properly accepted.
accept-name
is the identifier of the data item where DATE, DAY, or TIME is stored. DATE,
DAY, and TIME are typically defined as:
PIC 9(8) for DATE YYYYMMDD
PIC 9(6) for DATE
PIC 9(7) for DAY YYYYDDD
PIC 9(5) for DAY
PIC 9(8) for TIME
DATE YYYYMMDD
is the current date expressed as an 8-digit number yyyymmdd where yyyy is the
year, mm is the month, and dd is the day. For example, November 25, 2002, would
be returned as 20021125.
DATE
is the current date expressed as a 6-digit number yymmdd where yy is the year,
mm is the month, and dd is the day. For example, November 25, 1997, would be
returned as 971125.
DAY YYYYDDD
is the current Julian date expressed as a 7-digit number yyyyddd where yyyy is
the year and ddd is the day of the year. For example, February 25, 2001, would be
returned as 2001056.
DAY
is the current Julian date expressed as a 5-digit number yyddd where yy is the year
and ddd is the day of the year. For example, March 3, 1998, would be returned as
98062.
TIME
is the current time based on a 24-hour clock, expressed as an 8-digit number
hhmmsscc where hh is the hour, mm the minutes, ss the seconds, and cc the
hundredths of seconds. For example, the time 2:41 P.M. would be returned as
14410000. The range of values allowed is 00000000 through 23595999.
The following sentence stores the current date (yymmdd) in todays-date, the
Julian date (yyddd) in julian-date, and the current time (hhmmsscc) intime-
right-now:
WORKING-STORAGE SECTION.
01 date-and-time-fields.
05 todays-date-full PIC 9(8) VALUE ZERO.
05 todays-date PIC 9(6) VALUE ZERO.
05 julian-date-full PIC 9(7) VALUE ZERO.
05 julian-date PIC 9(5) VALUE ZERO.
05 time-right-now PIC 9(8) VALUE ZERO.
:
PROCEDURE DIVISION.
:
ACCEPT todays-date-full FROM DATE YYYYMMDD
ACCEPT todays-date FROM DATE
ACCEPT julian-date-full FROM DAY YYYYDDD
ACCEPT julian-date FROM DAY
ACCEPT time-right-now FROM TIME
ADD Statements
The ADD statements sum numeric values and store the results in one or more data
items. When defining a field to hold a total, the size of the field should be considered.
The receiving field must be large enough to hold the result and thus avoid truncation of
nonzero digits. The forms of the ADD statements are:
ADD TO
ADD GIVING
ADD CORRESPONDING
Each form is described in the following paragraphs.
ADD TO Statement
The ADD TO statement adds together all values specified and then adds that sum to the
current value in each data item specified.
value
is either a numeric literal or the identifier of an elementary numeric data item.
result
is the identifier of a numeric data item to which value, or the sum of the values, is
added.
value
is either a numeric literal or the identifier of an elementary numeric data item.
result
is the identifier of a numeric data item into which the sum of the values is stored.
qualifiers up to but not including the group item name specified in the ADD
CORRESPONDING statement.
01 stockroom-supplies.
05 writing-tools.
10 pencils PIC 99.
10 erasers PIC 99.
10 pens PIC 99.
05 paper-clips PIC 99.
05 paper PIC 99.
:
PROCEDURE DIVISION.
:
ADD CORRESPONDING cabinet-supplies TO stockroom-supplies.
In the following example, only one item (6-12-years) corresponds between the groups:
01 test-group-1. 01 test-group-2.
05 children. 05 children.
10 1-5-years 10 1-3-years
10 6-12-years 10 4-5-years
05 teen-agers. 10 6-12-years
10 13-15-years 05 teen-agers
10 16-19-years
05 adults
10 women
10 men
Assuming all items are numeric, the following statement sums 6-12-years of children of
test-group-1 with 6-12-years of children of test-group-2:
ADD CORRESPONDING test-group-1 TO test-group-2
BEGIN-TRANSACTION Statement
The BEGIN-TRANSACTION statement marks the beginning of a sequence of
operations that are to be treated as a single transaction. When this statement executes,
the terminal enters transaction mode. Transaction mode is an operating mode in which
Pathway servers that are configured to run under the Transaction Management Facility
(TMF) can lock and update audited files.
TMF starts a new transaction and assigns a transaction-ID number to the terminal. This
number is placed in the special register TRANSACTION-ID. Two other special
registers are set: RESTART-COUNTER is set to 0 to indicate that the transaction is
being started for the first time, and TERMINATION-STATUS is set to 1 to indicate that
the transaction has started.
ON ERROR
provides a point of control if an error is encountered. No test is made against the
transaction restart limit; the transaction is restarted and the ON ERROR branch is
taken.
imperative-statement
is the statement to be executed if an error occurs or the transaction is being restarted.
If the ON ERROR phrase is omitted and the number of restarts equals the
transaction restart limit, the terminal is suspended, but can be restarted.
If the transaction fails for any reason while the terminal is in transaction mode, TMF
backs out any updates performed on the data base for the current transaction. If the
transaction was not terminated deliberately by execution of the ABORT-
TRANSACTION statement, terminal execution is restarted at the BEGIN-
TRANSACTION statement under these conditions:
• ON ERROR phrase is specified
• ON ERROR phrase is not specified, but the number of restarts has not exceeded the
transaction restart limit. The maximum number of times a logical transaction can be
automatically restarted is specified with the MAXTMFRESTARTS parameter of the
PATHCOM SET PATHWAY command.
On a transaction restart, TMF assigns a new transaction-ID number to the terminal; the
TCP marks the screen for screen recovery and increments by 1 the special register
RESTART-COUNTER. The special register TERMINATION-STATUS remains at 1
(which indicates that a transaction is started or restarted). Working-storage items are
restored to the values at execution of BEGIN-TRANSACTION. If the ON ERROR
phrase is specified, the imperative statement is executed.
If the terminal is in transaction mode when the BEGIN-TRANSACTION statement is
executed, the current transaction is backed out and the terminal is suspended for a
pending abort. Terminal execution cannot be resumed.
The special register TERMINATION-STATUS is set by the BEGIN-TRANSACTION
statement to indicate the result of execution. Table 6-2 lists the possible values of
TERMINATION-STATUS.
CALL Statement
The CALL statement transfers control from one SCREEN COBOL program to another
SCREEN COBOL program.
[ ON ERROR imperative-statement ]
data-name
is a nonnumeric data item in the Working-Storage Section or Linkage Section; the
value of the data item gives the PROGRAM-ID of another SCREEN COBOL
program, as specified in the Identification Division of that program. The
data-name specification allows the PROGRAM-ID of the called program to be
specified dynamically.
program-unit-name
is a nonnumeric literal or an identifier of a nonnumeric literal that gives the
PROGRAM-ID of another SCREEN COBOL program, as specified in the
Identification Division of that program. A nonnumeric literal is defined in the
SCREEN COBOL language as being enclosed in quotation marks. However, a
search on the name of the program unit will find the program-unit name even if it is
not enclosed in quotation marks. The program can be compiled for any terminal
type; for more information, see Compatibility for a Called Program on page 6-27.
If a literal specifying the called program unit is also the name of a section in the
calling program, an error results at compile time. This situation may be avoided by
specifying the called program unit with a Working-Storage identifier of a
nonnumeric literal rather than a literal.
USING
passes data to the program called. A USING phrase must be specified in the
Procedure Division header of the called program. The number of identifiers for this
phrase in the CALL statement must be at least as great as that specified for the
USING phrase in the called program.
identifier
is the name of an argument passed to the called program. This identifier cannot
exceed 12,288 bytes; it must be an 01 or 77 level data item in the Working-Storage
Section or Linkage Section of the program that is calling the other program. The
identifiers in the USING phrase must correspond exactly in number and structure to
the number and structure of the identifiers specified in the USING phrase of the
Procedure Division header of the called program. Correspondence is by position in
the USING lists. See the description of the Linkage Section on page 5-3 for more
information about correspondence between the Linkage Section and the CALL
statement.
ON ERROR
provides a point of control if an error is encountered in a descendant program unit.
If a suspend class error is encountered, control is returned to the next higher level
program unit having a CALL statement containing an ON ERROR clause. (A
suspend class error condition is one that, without the use of the CALL...ON ERROR
feature, causes the terminal to become suspended.) If a program unit containing an
ON ERROR clause does not exist, the terminal is suspended at the statement where
the error occurred. If the terminal is in transaction mode when a suspend class error
occurs, and the point-of-control CALL...ON ERROR is beyond the scope of the
current transaction, the current transaction is aborted.
If you include an ON ERROR clause in a CALL statement and it is executed, no
error message is written to the Pathway log file.
imperative-statement
is the statement to be executed if an error occurs.
The data area of a program is initialized each time the program is called; therefore,
variables do not retain their values between calls.
If the ON ERROR branch is taken, the special register TERMINATION-STATUS
contains an error code describing the error, and the special register TERMINATION-
SUBSTATUS contains a value or an error code further describing the error. Table 6-3
lists TERMINATION-STATUS and corresponding TERMINATION-SUBSTATUS error
codes. The error code in TERMINATION-SUBSTATUS is dependent upon the error.
CHECKPOINT Statement
The CHECKPOINT statement causes the current context for the terminal, such as
Working-Storage items, to be checkpointed.
CHECKPOINT
CLEAR Statement
The CLEAR statement prepares the terminal for a new set of input. This statement
cannot be used by programs communicating with intelligent devices.
CLEAR INPUT
This statement stores null values into all unprotected fields of the screens currently
displayed and resets the modified data tag (MDT) bits of all unprotected fields on
terminals that use MDT. Except for the MDT, the attributes of the fields are not
affected.
The CLEAR statement differs from the RESET statement as follows:
• CLEAR affects all unprotected fields on the display screen; RESET affects only
those fields specified in the statement, whether the fields are protected or not.
• CLEAR causes all unprotected fields to become blank; RESET returns all fields to
the initially declared values.
• CLEAR does not affect field attributes, although the MDT bits are cleared; RESET
returns all fields to their initial values.
• CLEAR requires only a short data sequence; RESET requires a data sequence from
the TCP for each field referred to in the statement.
COMPUTE Statement
The COMPUTE statement evaluates an arithmetic expression and then stores the result
in one or more data items.
result
is the identifier of a numeric elementary item.
expression
is an arithmetic expression calculated according to precedence rules described in
Section 2, SCREEN COBOL Source Program.
As with other arithmetic operations, consider truncation situations and how they should
be handled.
The following example illustrates the COMPUTE statement:
WORKING-STORAGE SECTION.
(compute-result = 10)
COPY Statement
The COPY statement inserts sections of code into a program for use at compile time.
This allows code that is common to several programs to be written once and be
maintained easily.
copy-text
is a unique section name in a SCREEN COBOL copy library file.
library-name
is the file containing the text to be copied. The name is expanded to a full file name
using the default subvolume in effect for the compilation. If you specify the library
name with a subvolume and a file name, you must enclose the entry in quotation
marks. For example:
"subvol.afile".
If library-name is omitted and copy-text exists, the default library name
COPYLIB is used for the compilation.
Even though the COPY statement is described as a Procedure Division statement, the
statement can be included in a SCREEN COBOL program wherever a character string
or separator can appear; the only exception is within another COPY statement. The
keyword COPY cannot be split over two lines, but text that follows the keyword can be
continued.
Library text is copied into the source program. The SCREEN COBOL copy library
must be in the correct format, and each copy-text must be written in correct
SCREEN COBOL syntax.
A copy library must be an EDIT disk file in the following form:
Each SECTION line identifies the beginning of a copy-text; the question mark must
be in column 1. The content of the text is arbitrary and can be any length. No text line
can begin with ?SECTION.
The compiler assumes the source format (ANSI standard reference format or Tandem
standard reference format) of the library text is the same as that of the line containing
the COPY statement. When the format option is specified, the format overrides the
compiler's assumption, permitting a library text to be copied irrespective of the format of
the source program. Also, the library text itself can have compiler commands, which are
executed when the text is copied. Note that after copying is complete, the compiler
always reverts to the format in effect when it encountered the COPY statement. See
Section 7, Compilation for information on restrictions on the use of the Compaq Inspect
debugging tool when the ANSI compiler command is set.
During program compilation, copy-text is found by locating the SECTION
command whose copy-text name matches copy-text in the COPY statement.
Text is copied starting at the line after the SECTION line and continues until either
another SECTION line is recognized or end-of-file is reached. In the following
example, text-0 has no SECTION command and could never be copied:
text-0
?SECTION copy-text-1
text-1
When a library file begins like this, this text could be comments about the library
contents.
In the following example, notice that employee-detail of the COPY statement is not
qualified because the copy library, named COPYLIB, resides on the default volume and
subvolume for the compilation.
The contents of the copy library COPYLIB are as follows:
?SECTION employee-detail
01 emp-data-in.
05 emp-no PIC X(05).
05 emp-name PIC X(20).
05 dept PIC X(03).
05 job-class PIC X(05).
05 hourly-rate PIC 9(3)V99.
05 deductions PIC 9(3)V99.
05 salary PIC 9(7)V99.
The SCREEN COBOL source code is as follows:
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY employee-detail.
In the compile listing in the example below, all lines from a copy library are marked
with a <.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY employee-detail.
< 01 emp-data-in.
< 05 emp-no PIC X(05).
< 05 emp-name PIC X(20).
< 05 dept PIC X(03).
< 05 job-class PIC X(05).
< 05 hourly-rate PIC 9(3)V99.
< 05 deductions PIC 9(3)V99.
< 05 salary PIC 9(7)V99.
DELAY Statement
The DELAY statement delays program execution for a specified period of time.
DELAY { numeric-literal }
{ identifier }
numeric-literal
is a numeric value representing one-second units; the maximum value is 21474836.
The value must be a positive integer.
identifier
is the identifier of an integer data item representing one-second units; the maximum
value is 2,147,483,647 seconds (31 bits). This value must be a positive integer.
Note. The maximum values are enforced only at run-time; the compiler will not generate an
error for a value greater than 2,147,483,647.
This statement is intended for use in situations where an error has occurred (such as a
terminal I/O error because power to the terminal is off) and the operation encountering
the error is to be retried periodically.
An alternate use of the DELAY statement (DELAY 0) causes immediate execution. For
example, this statement can be specified after a DISPLAY statement (for block mode) to
cause an immediate output of the contents of the terminal buffer to the screen.
The following example illustrates the DELAY statement:
* highest level program-unit.
loop.
CALL menu ON ERROR PERFORM analyze-error.
IF retry = 1
* delay five minutes, then retry.
DELAY 300
GO TO loop
ELSE
GO TO giveup.
analyze-error.
IF TERMINATION-STATUS = 18 AND
( TERMINATION-SUBSTATUS = 171 OR
TERMINATION-SUBSTATUS = 173 )
MOVE 1 TO retry
ELSE
MOVE 0 TO retry.
* suspend.
giveup.
EXIT PROGRAM WITH ERROR.
DEVICEINFO Statement
The DEVICEINFO statement obtains information about the intelligent device to which
the SCREEN COBOL program is currently sending messages. This statement performs
the same function as the DEVICEINFO procedure.
deviceinfo-rec
is an 01 group defined as follows:
01 deviceinfo-rec.
02 file-name PIC X(16).
02 device-type PIC 9(4) comp.
02 device-subtype PIC 9(4) comp.
02 physical-record-length PIC 9(4) comp.
The SCREEN COBOL compiler does not check the data types in the
deviceinfo-rec group item. It assumes that you have defined it correctly.
DEVICEINFO returns the file name in internal network format. Refer to the Guardian
Programmer's Guide for a description of this format.
This statement could be used as follows:
MOVE TERMINAL-FILENAME TO file-name OF deviceinfo-rec.
DEVICEINFO USING deviceinfo-rec.
second DISPLAY BASE can execute at any time to establish a new screen, or to
reestablish the same screen.
DYNAMIC
specifies that nonliteral screen fields can acquire their initial contents from their
FROM or USING Working-Storage data item. A subsequent DISPLAY statement is
not needed to display the initial Working-Storage values.
In addition, the DYNAMIC modifier provides the capability of changing the screen
field attribute settings at run-time by using the contents of individual attribute
elements in an associated control structure.
base-screen-name
is the name of the base screen.
When a shadowed screen field has an associated Working-Storage item with its
SELECT bit set to 1, the screen field acquires its initial screen contents from its FROM
or USING Working-Storage data item. Otherwise, the initial screen contents are
acquired from the compile-time literal value or the default initial value.
DISPLAY BASE (without the DYNAMIC modifier) does not physically display the
screen. The screen data is displayed when one of the following events occurs:
• Terminal buffer (TERMBUF) fills up
• One of the following statements is executed: ACCEPT; BEGIN-TRANSACTION,
END-TRANSACTION, RESTART-TRANSACTION, or ABORT-TRANSACTION;
CALL; CHECKPOINT; DELAY; EXIT PROGRAM; PRINT SCREEN; or
SEND
• The DISPLAY statement is executed for a conversational terminal
During execution of the first DISPLAY BASE statement for a SCREEN COBOL
program, the I/O startup messages prepare the terminal for Pathway/iTS operation. The
program can then act on any terminal I/O errors through the CALL ON ERROR clause.
For the DISPLAY BASE statement in block mode, the input and output fields of the
screen are filled with the values specified in the VALUE clauses for the fields (unless
the DYNAMIC modifier is used and the field’s SELECT bits are set to 1, in which case
the values are taken from the associated Working-Storage data items). A field that has
no VALUE clause is filled with the fill character. For variable-length tables (defined
with OCCURS DEPENDING ON), the table is filled to the maximum length possible as
specified in the definition, regardless of the current value of the table's controlling
variable.
For terminals in both block and conversational mode, DISPLAY OVERLAY establishes
the current overlay screen and must execute before other screen operations using the
overlay screen.
DYNAMIC
specifies that nonliteral screen fields can acquire their initial contents from their
FROM or USING Working-Storage data item. A subsequent DISPLAY statement is
not needed to display the initial Working-Storage values.
In addition, the DYNAMIC modifier provides the capability of changing the screen
field attribute settings at run-time using the contents of individual attribute elements
in an associated control structure.
overlay-screen-name
is the name of the overlay screen to be displayed.
AT overlay-area
is the name of the overlay area of the currently displayed base screen into which the
overlay screen is to be placed.
SPACES
causes the overlay area to become blank and restores the area to the state it was in
immediately after the base screen was displayed. Any association of an overlay
screen with the overlay area is broken.
When a shadowed screen field has an associated Working-Storage item with its
SELECT bit set to 1, the screen field acquires its initial screen contents from its FROM
or USING Working-Storage data item. Otherwise, the initial screen contents are
acquired from the compile-time literal value or the default initial value.
The DISPLAY BASE statement must appear before the DISPLAY OVERLAY
statement, or else an error is generated.
The overlay area must be at least as large as the overlay screen. An overlay screen
cannot be displayed in more than one overlay area at the same time.
DISPLAY RECOVERY
DISPLAY Statement
The DISPLAY statement formats data for selected output fields for transmission to the
screen.
The DISPLAY BASE statement operates differently for terminals in block mode than it
does for terminals in conversational mode. It cannot be used for communication with
intelligent devices.
{ screen-identifier } ,...
[ DEPENDING [ ON ] identifier ]
[ SHADOWED ]
TEMP or TEMPORARY
marks the fields so that they will be reset to their default values when the next
RESET TEMP or ACCEPT statement has completed executing.
If the terminal is operating in conversational mode, this phrase is ignored and
DISPLAY performs normally. To change, temporarily, the value of a screen item,
the current value of the associated Working-Storage item must be saved, the value
changed, the new value displayed, and the previous current value restored.
nonnumeric-literal
is a value that is sent to the terminal for each selected field. The value is not
converted; it is truncated or extended with the fill character if necessary. The value
must be in quotation marks.
If this clause is omitted, the data for a selected screen field is obtained from the
Working-Storage data item specified in the FROM or USING clause of the screen
field description. The data is converted and edited according to the screen field
declaration, and those characters are placed in the field on the terminal display.
screen-identifier
is a screen, screen group, or elementary output item of any active screen; the
maximum is 127 items per DISPLAY statement. When screen-identifier is
not an elementary item, it refers to all subordinate elementary items that have a
VALUE, FROM, or USING clause in their definitions.
DEPENDING ON identifier
selects either zero or one screen-identifier from the list of screen fields.
The statement whose position in the screen-identifier list is the same as the
value in identifier is selected. If the value in identifier is less than 1 or
greater than the number of screen identifiers, no screen-identifier is
selected.
SHADOWED
selects from the screen-identifier list only those fields that have
SHADOWED items in which the SELECT bit is set. Fields in the
screen-identifier list that do not have SHADOWED items are not selected.
Note. If neither the DEPENDING ON modifier nor the SHADOWED modifier is specified, all
fields in the list are selected.
SCREEN SECTION.
:
01 MENU1 SIZE 24, 80.
05 screen-fld1 at 4, 20
PIC X(10)
from fld1.
05 screen-fld2 at 5, 40
PIC X(10)
from fld2.
05 screen-fld3 at 6, 60
PIC X(10)
from fld3.
PROCEDURE DIVISION.
:
BODY-PARAGRAPH.
:
DISPLAY BASE MENU1.
DISPLAY SCREEN-FLD1,
SCREEN-FLD2,
SCREEN-FLD3,
DEPENDING ON WS-SCREEN-STATUS.
If WS-SCREEN-STATUS equals 1, SCREEN-FLD1 is displayed. If WS-SCREEN-
STATUS equals 2, SCREEN-FLD2 is displayed, and so on. It is not considered
erroneous if WS-SCREEN-STATUS < 1 or WS-SCREEN-STATUS > 3. Control just
falls through (execution continues with the next statement) and no screen field is
displayed.
The execution of DISPLAY in block mode does not cause a physical write to the screen
but causes data to be written to the terminal buffer. A physical write to the screen
occurs when one of the following events occurs:
• Terminal buffer (TERMBUF) fills up
• Execution of one of the following statements: ACCEPT; BEGIN-TRANSACTION,
END-TRANSACTION, RESTART-TRANSACTION, or ABORT-TRANSACTION;
CALL; CHECKPOINT; DELAY; EXIT PROGRAM; PRINT SCREEN; or
SEND
• Execution of DISPLAY for a conversational terminal
For terminals operating in conversational mode, the DISPLAY statement presents output
in order by rows. A screen field value appears on the screen at the column number
position specified in the screen field description. Blank lines are not generated (for
formatting purposes), so screen lines generally do not correspond with the line numbers
specified in the Screen Section.
To display fully line-formatted screens, define at least one item for every line (row) of
the screen. If a row of spacing is required, define the screen item for that row with a
VALUE clause specifying blanks; for example, VALUE " ". Then, prepare the entire
screen buffer by specifying the screen name as the screen identifier in the DISPLAY
statement.
For terminals operating in conversational mode, the DISPLAY statement performs as
follows:
• The DISPLAY statement places screen items on the output line in the column
location specified in the Screen Section. If another screen item has the same line
number description, but is not named in the DISPLAY statement, that screen item
appears in the screen display.
• If you specify a screen group name to display multiple screen fields, each screen
field appears in the column described for that field. However, the screen fields are
on consecutively numbered lines regardless of the screen field descriptions.
• Any nonfiller screen item must be defined with a TO, FROM, or USING clause in
the Screen Section. If a screen item is defined with both a VALUE clause and a TO,
FROM, or USING clause, the literal in the VALUE clause is never displayed. The
DISPLAY statement output is always from the associated Working-Storage data
items.
• If nonnumeric-literal is listed in a DISPLAY statement and the screen-
identifier list contains more than one field, the literal appears in each of the screen
fields named in the list.
The Break key for conversational terminals can be enabled to terminate a DISPLAY
operation. The Break key is enabled through the PATHCOM commands SET TERM or
SET PROGRAM TYPE in the Pathway system configuration. If the Break key is
enabled and is pressed during a DISPLAY operation, the DISPLAY terminates and no
terminal error condition results.
The value of the TERMINATION-SUBSTATUS special register on the DISPLAY
operation is:
• 1 if the BREAK key is pressed
• 0 if the BREAK key is not pressed
DIVIDE Statements
The DIVIDE statements divide one data item into another and store the results in one or
more data items. The forms of the DIVIDE statements are:
DIVIDE INTO
DIVIDE GIVING
DIVIDE BY GIVING
Each form is described in the following paragraphs.
divisor
is either a numeric literal or the identifier of an elementary numeric data item.
dividend
is the identifier of an elementary numeric data item that is the dividend and
receiving field for the quotient.
divisor
is either a numeric literal or the identifier of an elementary numeric data item.
dividend
is either a numeric literal or the identifier of an elementary numeric data item.
quotient
is the identifier of an elementary numeric data item where the quotient is stored.
dividend
is either a numeric literal or the identifier of an elementary numeric data item.
divisor
is either a numeric literal or the identifier of an elementary numeric data item.
quotient
is the identifier of an elementary numeric item where the quotient is stored.
The following example illustrates the DIVIDE BY GIVING statement:
WORKING-STORAGE SECTION.
77 leap-year PIC 9 VALUE ZERO.
77 divide-result PIC 99 VALUE ZERO.
01 invoice-date.
05 inv-month PIC 99.
05 inv-day PIC 99.
05 inv-year PIC 99.
:
PROCEDURE DIVISION.
:
DIVIDE inv-year BY 4 GIVING divide-result.
:
END-TRANSACTION Statement
The END-TRANSACTION statement marks the completion of a sequence of operations
that are treated as a single transaction. When this statement executes, the terminal
leaves transaction mode. Transaction mode is an operating mode in which Pathway
servers that are configured to run under the Transaction Management Facility (TMF)
can lock and update audited files.
END-TRANSACTION
If TMF accepts this statement, any database updates made during the transaction
become committed, the terminal leaves transaction mode, and the special register
TRANSACTION-ID is set to SPACES. If TMF rejects this statement, transaction
restart occurs.
EXIT Statements
The EXIT statements mark the end of a procedure or the exiting point of a subprogram.
The forms of the EXIT statements are:
EXIT
EXIT PROGRAM
Each form is described in the following paragraphs.
EXIT Statement
The EXIT statement marks the end of a procedure. The statement performs no
operation. However, if an EXIT statement is referenced by a previous PERFORM
statement, the EXIT statement (like any other statement in a SCREEN COBOL
program) provides the instructions for the return linkage to the statement after the
PERFORM statement.
EXIT .
WITH ERROR
is an option that provides a way to reassert the error condition described by special
registers TERMINATION-STATUS and TERMINATION-SUBSTATUS. The error
condition states that if a suspend class error is encountered, control is returned to the
next higher level program unit having a CALL statement with an ON ERROR
clause; if a program unit with the CALL...ON ERROR feature does not exist, the
terminal is suspended without possibility of restart.
Note that the program can change the contents of TERMINATION-STATUS and
TERMINATION-SUBSTATUS before executing the EXIT PROGRAM WITH
ERROR statement. Values for TERMINATION-STATUS must be in the range of
0 through 255.
The EXIT PROGRAM statement must appear in a sentence by itself and must be the
only sentence in the paragraph.
GO TO Statements
The GO TO statements pass control from one part of the Procedure Division to another.
The forms of the GO TO statements are:
GO TO
GO TO DEPENDING
Each form is described in the following paragraphs.
GO TO Statement
The GO TO statement unconditionally passes control from one part of the Procedure
Division to another.
GO [ TO ] procedure-name
procedure-name
is the name of the procedure to which control is transferred.
GO TO DEPENDING Statement
The GO TO DEPENDING statement passes control to one of several procedures
depending on a variable data item.
procedure-name
is a series of procedure names. Only one is chosen, based on the value of depend.
depend
is the identifier of an elementary numeric integer data item. This item acts like an
index because its value selects the procedure name to which the program branches.
If the value of depend is outside the range of procedure-name, no branching
occurs and control passes to the next statement.
The following example illustrates the GO TO DEPENDING statement:
procedure-branch.
GO TO proc-1,
proc-2,
proc-3, DEPENDING ON branch-flag.
MOVE 0 to branch-flag.
• If branch-flag is 1, control passes to proc-1.
• If branch-flag is 2, control passes to proc-2.
• If branch-flag is 3, control passes to proc-3.
IF Statement
The IF statement evaluates a condition and then transfers control depending on whether
the value of the condition is true or false.
condition
is any conditional expression.
statement-1, statement-2
are imperative or conditional statements. Each statement can contain an IF
statement, in which case the statement is referred to as a nested IF statement.
NEXT SENTENCE
is a substitution for statement-1 or statement-2. The phrase performs no
operation, but is used to preserve the syntactical structure or to emphasize that one
value of condition elicits no action.
IF statements within IF statements are considered as paired IF and ELSE statements,
proceeding from left to right. An ELSE is assumed to apply to the immediately
preceding IF that has not already been paired with an ELSE.
The following conventions apply to the IF statement:
• If condition is true, statement-1 is executed; if NEXT SENTENCE has
been substituted for statement-1, no operation is performed.
• If condition is false, statement-2 is executed; if NEXT SENTENCE has
been substituted for statement-2 or if the ELSE clause has been omitted, no
operation is performed.
• If a GO TO statement that causes a transfer of control is executed as part of
statement-1 or statement-2, control is unconditionally transferred to the
target of the GO TO statement.
• If control is not unconditionally transferred by execution of a GO TO statement as
part of statement-1 or statement-2, control passes to the next executable
statement following the IF statement after all statements executed as part of the IF
statement have completed.
• Comparisons (using GREATER THAN, LESS THAN, EQUAL, and so on) of a
PIC N data item or literal with a numeric data item (PIC 9) are not allowed. All
other comparisons are allowed and are done on a byte-by-byte basis.
Aligned double spaces are seen as %H2020 and are valid double-byte characters. A
single space or a nonaligned space is not a double-byte character.
[ AT screen-area ]
data-item
specifies the OLD-CURSOR or NEW-CURSOR special register or specifies a
Working-Storage data item defined as follows:
01 WS-USER-SAVE-CURSOR.
02 WS-USER-SAVE-ROW PIC 9(4) COMP.
02 WS-USER-SAVE-COL PIC 9(4) COMP.
screen-item
specifies an elementary screen item defined in the Screen Section, or specifies an
elementary screen item within a defined screen overlay item. The screen-item
cannot include an OCCURS clause.
screen-area
specifies the name of a screen overlay item in a base screen definition. You include
screen-area so the compiler can calculate the offset position of the overlay
elementary screen item relative to the base screen.
NOT
specifies negation.
• Using either one of the NOT options causes the compiler to issue the same code
and the statements following the IF ... WITHIN statement are executed only if
the row and column values in data-item are not the same as the defined row
and volume values in screen-item in the Screen Section.
• Using both of the NOT options cancels their effect and is equivalent to using
neither one.
Note. For screen fields that wrap, only the first row is tested. If you test a screen field that
wraps using the IF ... WITHIN statement, a warning is issued.
MOVE Statements
The MOVE statements transfer data from one data item to one or more other data items
in accordance with editing rules. The forms of the MOVE statements are:
MOVE
MOVE CORRESPONDING
MOVE Statement
The MOVE statement transfers data from a data item to one or more data items.
data-name-1
is the sending item. The item can be an identifier or a literal. Any subscripting or
indexing for data-name-1 is evaluated only once, immediately before data is
moved to the first receiving item.
data-name-2
is the receiving item. The item is an identifier. The following example:
MOVE item-1(b) TO item-2, item-3(b)
is equivalent to:
MOVE item-1(b) TO temp
MOVE temp TO item-2
MOVE temp TO item-3(b).
The following example illustrates a number of MOVE statements:
WORKING-STORAGE SECTION.
01 record-in.
05 item-a PIC X(5).
05 item-b PIC 99V99.
77 temp1 PIC X(4).
77 temp2 PIC X(8).
77 temp3 PIC 9(5)V999.
77 temp4 PIC 9V9.
PROCEDURE DIVISION.
begin-processing.
MOVE item-a TO temp1. (1)
MOVE item-a TO temp2. (2)
MOVE item-b TO temp3. (3)
MOVE item-b TO temp4. (4)
MOVE SPACES TO record-in.
MOVE ZEROS TO item-b.
group-1
is the group name of sending data items.
group-2
is the group name of receiving data items.
group-1 and group-2 must be defined in the Working-Storage Section or the Linkage
Section, not in the Screen Section.
The following conventions apply to data items used with the CORRESPONDING
phrase:
• group-1 and group-2 are the group names specified in the MOVE
CORRESPONDING statement. Either or both of these data items can be described
with the REDEFINES or OCCURS clause or be subordinate to items described with
these clauses.
• Any subordinate data item of group-1 or group-2 which contains the
REDEFINES, RENAMES, OCCURS or USAGE IS INDEX clause will not be
moved.
• No data item can be defined with a level number 66, 77, or 88.
Subordinate data items in two different groups correspond to each other according to the
following rules:
• Both data items must have the same data name.
• All possible qualifiers for the sending data item, not including the group name, must
be identical to all possible qualifiers for the receiving data item, not including the
receiving group name.
• At least one of the corresponding sending/receiving items must be elementary. The
class of any corresponding pair of data items can differ.
• Any data item subordinate to a data item that is not eligible for correspondence is
ignored.
• FILLER data items are ignored.
Example 1
All items in the following two groups correspond:
01 detail-in. 01 report-line.
05 social-security 03 social-security
05 employee-name 03 FILLER
05 address 03 employee-name
10 street 03 FILLER
10 city 03 address
10 state 05 street
10 zip-code 05 FILLER
05 city
05 FILLER
05 state
05 FILLER
05 zip-code
Example 2
Only pencils items in the following groups correspond; even though all other
elementary names are alike, they do not have the same qualifiers:
01 stock-items. 01 shelf-items.
05 erasers 05 pens
10 gum 07 felt-tip-pens
10 pink 07 ball-point-pens
10 ink 07 fountain-pens
05 pencils 05 eradicators
10 mechanical 10 ink
10 non-mechanical 10 pink
05 felt-tip-pens 10 gum
05 ball-point-pens 05 pencils
05 fountain-pens 10 mechanical
10 non-mechanical
The following sentence would move only the data items of the pencils group:
MOVE CORRESPONDING stock-items TO shelf-items
MOVE Restrictions
Move operations between the following types of data items will cause a compilation
error and should therefore not be attempted:
• An alphabetic data item or the figurative constant SPACE to a numeric data item
• A numeric literal, a numeric data item, or the figurative constant ZERO to an
alphabetic data item
• A noninteger numeric literal or a noninteger numeric data item to an alphanumeric
data item
• A numeric data item to a numeric data item that does not have at least the same
number of positions to the left of the decimal position
• Numeric integer(s), numeric noninteger(s), and numeric edited data item to a data
item that allows only double-byte (PIC N) data.
• A data item or literal that allows only double-byte (PIC N) data to a numeric integer,
a numeric noninteger, or a numeric edited data item.
MOVE Conventions
Data is converted and stored according to the data category of the receiving field. The
conventions are as follows:
• Alphanumeric or alphabetic receiving data item
° Data is stored beginning at the leftmost position in the receiving field
° If the data in the sending item is shorter, the data is filled with spaces in the
receiving field according to the standard alignment rules described in Section 2,
SCREEN COBOL Source Program
° If the data in the sending item is longer, the data is truncated on the right to the
length of the receiving field.
° If the sending item is described as signed numeric, the operational sign is not
moved to the receiving field; this applies whether the sign is a part of the data
item or is a separate character.
• Numeric receiving item
° Data is aligned by decimal point and is filled with zeros as necessary.
° If the receiving field is signed and the sending field is signed, the sign is moved
and converted; if the sending field is not signed, the value is signed as positive.
° If the receiving field is not signed, the absolute value of the sending field data is
moved.
° If the sending field is alphanumeric, the value of the sending field is treated as
an unsigned numeric integer.
MULTIPLY Statements
The MULTIPLY statements multiply two or more numeric items and place the result in
a specified data item. A multiply operation can easily produce a value that does not fit
into the receiving field; when defining a receiving field, thought should be given to the
size of that field.
MULTIPLY BY Statement
The MULTIPLY BY statement multiplies one numeric data item by one or more other
numeric data items. The product replaces the value of each multiplier.
value
is the multiplicand, which is a numeric literal or an identifier of an elementary
numeric data item.
multiplier
is the identifier of an elementary numeric data item. The result of the multiply
operation is stored as the new value of multiplier. The sum of the number of
digits in value and multiplier must not exceed 18.
value
is the multiplicand, which is a numeric literal or an elementary numeric data item.
multiplier
is a numeric literal or the identifier of an elementary numeric data item. The sum of
the number of digits of value and multiplier must not exceed 18.
result
is the identifier of an elementary numeric data item into which the product is stored.
PERFORM Statements
The PERFORM statements execute one or more procedures in a program. When a
single paragraph or section name is specified, control passes to the first statement of the
paragraph or section; when execution of the paragraph or section completes, control
passes to the PERFORM statement. If a group of paragraphs or procedures is specified,
control passes to the first statement of the first paragraph or section; when execution of
the last paragraph or section completes, control returns to the PERFORM statement.
The forms of the PERFORM statement are:
PERFORM
PERFORM TIMES
PERFORM UNTIL
PERFORM VARYING
PERFORM ONE
In each of these forms, two parameters, proc-1 and proc-2, appear. Proc-1 and
proc-2 have no special relationship; they represent a consecutive sequence of
operations to be executed beginning at proc-1 and ending with the execution of
proc-2. GO TO and PERFORM statements can occur within the range of proc-1
and proc-2. If two or more logical paths lead to the return point, proc-2 could be a
paragraph consisting of an EXIT statement, to which all of these paths must lead.
If control passes to these procedures by a means other than a PERFORM statement,
control passes through the last statement of the procedure to the next executable
statement as if no PERFORM statement referred to these procedures.
The range of a PERFORM statement is logically all those statements that are executed
as a result of the PERFORM statement, through the transfer of control to the statement
following the PERFORM statement. The range includes all statements executed
as a result of a GO TO, PERFORM, or CALL statement in the range of the original
PERFORM statement, as well as all statements in the Declaratives Section that might be
executed. Statements in the range of a PERFORM are not required to appear
consecutively.
If a sequence of statements referred to by a PERFORM statement includes another
PERFORM statement, the sequence of procedures for the nested PERFORM must be
either totally included in, or totally excluded from, the logical sequence referred to by
the original PERFORM statement. Thus, an active PERFORM statement whose
execution point begins within the range of another active PERFORM statement must not
allow control to pass to the exit of the other active PERFORM statement. Furthermore,
two or more such active PERFORM statements must not have a common exit.
PERFORM Statement
The PERFORM statement executes a procedure, or group of procedures as established
by the THROUGH phrase, one time. When execution completes, control passes to the
statement following the PERFORM statement.
count
is an integer literal or the identifier of an integer data item. The procedure, or group
of procedures, is executed as many times as the value of count.
The following example illustrates the PERFORM TIMES statement:
PERFORM list-transactions 2 TIMES.
condition
is any conditional expression.
The following example illustrates the PERFORM UNTIL statement:
WORKING-STORAGE SECTION.
01 flag PIC 9.
88 bad VALUE 0.
88 good VALUE 1.
88 no-more-adds VALUE 1.
:
PROCEDURE DIVISION.
:
PERFORM add-routine UNTIL no-more-adds.
:
add-routine.
MOVE 0 to flag.
:
: Once the add routine is successful, a 1 is moved
: to flag; otherwise, flag remains 0. As long as
: flag is 0, the procedure is reexecuted.
:
delete-routine.
PROCEDURE DIVISION.
:
PERFORM list-commands VARYING command-index FROM 1 BY 1
UNTIL command-index GREATER THAN no-of-commands.
list-commands.
:
DEPENDING [ ON ] identifier
identifier
is an integer numeric literal or the identifier of an integer data item. The value
determines which procedure, or group of procedures, is to be performed.
Each procedure, or group of procedures, in the list is assigned an index value that
indicates the relative position of the procedure, or group of procedures, within the list.
The index values begin at 1 and increment by 1, up to 255; the list cannot contain more
than 255 procedures or groups of procedures.
If the value of the identifier matches one of these indexes, the procedure, or group of
procedures, with that index is executed. When execution completes, control passes to
the statement following the PERFORM ONE statement. If the value of identifier
does not match any procedure index, no procedures are executed.
The following example illustrates the PERFORM ONE statement:
PERFORM ONE OF
A THRU B
C
D
DEPENDING ON I.
ON ERROR
provides a point of control if an error occurs while attempting the print operation.
The special register TERMINATION-STATUS is set with an error code indicating
the type of error; the imperative-statement is then executed.
If the clause is omitted and an error occurs, default system action is taken.
imperative-statement
is the statement to be executed if an error is detected.
If an attached printer has been specified via the PATHCOM SET TERM command for
the 6520 terminal, the screen image is directed to a printer attached directly to the
terminal (the 6524 terminal includes an attached printer).
If an attached printer has been specified via the PATHCOM SET TERM command for
the IBM3270 terminal, the screen image is directed to the device specified in the special
register TERMINAL-PRINTER; this device must be attached to the same control unit
as the terminal.
If a printer is not attached, printing occurs on the operating system file specified in the
special register TERMINAL-PRINTER. Device types terminal, printer, and process are
supported.
If a printer is not attached, a screen image that is printed with PRINT SCREEN can be
different from the screen image that is displayed, because the print operation does not
read the screen to form the screen image. Instead, the print operation forms the screen
image by using the screen description contained in the SCREEN COBOL object file and
the Working-Storage items associated with the screen.
The following items indicate how screen reconstruction from Working-Storage items
can cause differences in the displayed and printed screens (for printers that are not
attached):
• A screen field defined as HIDDEN in the Screen Section is not printed even though
the field is changed to be displayed during execution. If you want to have a screen
field initially hidden and subsequently printed, do not define the item as hidden.
Turn the HIDDEN attribute on and off by using a TURN statement during
processing.
• An unexpected value might be printed because the value in the Working-Storage
item has never been displayed or contains data that is different from what is
presently displayed on the screen.
Diagnostic Screens
A diagnostic screen, which is described in Appendix A, Advisory Messages, can be
displayed when an error occurs during a PRINT SCREEN sequence. An example of the
default diagnostic screen is:
TERMINAL: TERM-1
{ YIELDS rcv-message }
{ }
{ { CODE rcv-code [,rcv-code ]... YIELDS rcv-message }... }
[ TIMEOUT timeout-value ]
[ ON ERROR imperative-stmt ]
YIELDS rcv-message
identifies an 01 level message name in either the Working-Storage Section or the
Message Section.
CODE rcv-code
identifies a literal or a data item that specifies which unsolicited message is
expected.
The position of the rcv-code in the CODE rcv-code clause corresponds to a
TERMINATION-STATUS value. One or more rcv-code values can be
associated with each unsolicited message.
A nonnumeric literal must be enclosed within quotation marks.
TIMEOUT timeout-value
specifies a time limit in seconds that the RECEIVE UNSOLICITED MESSAGE
operation will wait for an unsolicited message. The timeout-value can be a
numeric literal or a numeric data item; valid items are 0 through 32,767 seconds.
If the unsolicited message is not received in the specified number of seconds,
TERMINATION-SUBSTATUS is set to 40, the operation is cancelled, and any ON
ERROR clause is executed.
If this clause is omitted, there is no time limit.
ON ERROR imperative-stmt
specifies action to be taken if an error occurs in receiving the message. If an error
occurs, imperative-stmt is executed. The TERMINATION-STATUS special
register contains a value indicating the cause.
UNSOLICITED-MESSAGE-HANDLER.
RECEIVE UNSOLICITED MESSAGE
CODE RC-1 YIELDS R-MSG-1
CODE RC-2 YIELDS R-MSG-2
TIMEOUT MAX-TIME
ON ERROR GOTO ERROR-HANDLER.
ERROR-HANDLER.
IF TERMINATION-STATUS = 1 AND
TERMINATION-SUBSTATUS = 40
PERFORM RCV-TIMED-OUT
ELSE
PERFORM ANALYZE-ERROR.
This code executes as follows:
1. The RECEIVE UNSOLICITED MESSAGE statement waits for the arrival of an
unsolicited message. If the unsolicited message queue for this SCREEN COBOL
program contains a message, the operation completes immediately; otherwise, the
RECEIVE UNSOLICITED MESSAGE statement waits for the arrival of an
unsolicited message or a timeout.
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
6- 61
Procedure Division RECONNECT MODEM Statement
RC-1 1
RC-2 2
3. If the RECEIVE UNSOLICITED MESSAGE statement times out or there is an
error, the statement sets the TERMINATION-STATUS and TERMINATION-
SUBSTATUS registers accordingly and performs the procedure ERROR-
HANDLER.
Refer to Table 6-5 for an explanation of the error numbers contained in
TERMINATION-STATUS.
RECONNECT MODEM
VERIFY-RECONNECT.
IF TERMINATION-STATUS IS = 18 AND
TERMINATION-SUBSTATUS IS = 140
* This is a modem error - return to a consistent state
* and wait for the next terminal caller.
DELAY 10
RECONNECT MODEM
GO TO START-PROGRAM.
* Processes other error conditions.
or
[ ON ERROR imperative-stmt ]
reply-message
identifies an 01 level message field in the Message Section or an 01 or 77 level data
item in the Working-Storage Section. The reply-message contains data to be
sent in response to a previously received unsolicited message.
ON ERROR imperative-stmt
specifies action to be taken should an error occur in sending the message. If an error
occurs, imperative-stmt is executed. The TERMINATION-STATUS special
register contains a value indicating the cause.
Consider the following SCREEN COBOL example that uses the REPLY TO
UNSOLICITED MESSAGE statement:
PROCEDURE DIVISION.
MESSAGE-RESPONSE.
REPLY TO UNSOLICITED MESSAGE WITH MY-REPLY
ON ERROR PERFORM ERROR-HANDLER.
ERROR-HANDLER.
IF TERMINATION-STATUS = 1
PERFORM ANALYZE-GUARDIAN-ERROR
ELSE
PERFORM ANALYZE-ERROR.
The REPLY TO UNSOLICITED MESSAGE statement executes as follows:
1. The statement sends the contents of MY-REPLY in response to the last unsolicited
message.
2. If there is an error, ERROR-HANDLER is performed. If there is a file system error,
the TERMINATION-STATUS register contains a 1 and the TERMINATION-
SUBSTATUS register contains the error number; otherwise, TERMINATION-
STATUS contains the error number.
Refer to later in this section for an explanation of the error numbers contained in
TERMINATION-STATUS.
RESET Statement
The RESET statement restores the display attributes and the data of screen fields to the
compile-time definition. The statement restores only the terminal display, not the
internal data.
RESET cannot be used by programs communicating with intelligent devices.
[ DEPENDING [ ON ] identifier ]
[ SHADOWED ]
TEMP or TEMPORARY
specifies that the selected fields are to be reset only if they have received their
current values or attributes from a DISPLAY TEMP or TURN TEMP statement.
Note. During execution of a SCREEN COBOL program, the TCP controls the MDTs (modified
data tag) in the same way it controls display attributes; with two important exceptions:
• When a TURN TEMP statement selects an input field for changing display attributes, the
MDT bit is always set.
• When a RESET TEMP statement selects an input field for resetting of attributes, the MDT
bit is set, regardless of the initial MDT attribute of the field.
These two exceptions apply only to the TURN and RESET statements that have the TEMP
modifier. Note also that the field’s MDT bit is not reset after the completion of the ACCEPT
statement. Once the MDT bit is set, it stays set until the next DISPLAY BASE, TURN, RESET,
or CLEAR INPUT operation.
ATTR
resets the display attributes of the selected fields to the value specified in the screen
definition.
DATA
resets the characters displayed in the selected fields to the value specified in the
VALUE field-characteristic clause of the field. If a value is not specified, the
standard fill character fills the field.
If neither ATTR nor DATA is specified, both the attributes and data of the selected
fields are reset to initial values.
For a terminal operating in conversational mode, RESET DATA has no effect; you
can specify either RESET ATTR or RESET TEMP ATTR to reset the display
attributes of fields on conversational-mode terminals.
screen-identifier
specifies the fields to be reset; the maximum is 127 screen fields per RESET
statement. Each screen-identifier can name an entire screen, a screen group,
or an elementary item of any base or overlay screen that is currently displayed. If
screen-identifier is a group, all subordinate elementary items that have a
TO, FROM, or USING clause in their definitions are reset.
DEPENDING ON identifier
selects zero or one screen-identifier from the list. The statement whose
position in the screen-identifier list is the same as the value in
identifier is selected. If the value in identifier is less than 1 or greater
than the number of screen identifiers, no screen-identifier is selected.
SHADOWED
selects from the screen-identifier list only those fields that have
SHADOWED items in which the SELECT bit is set; fields that do not have
SHADOWED items are not selected.
Note. If neither the DEPENDING ON modifier nor the SHADOWED modifier is specified, all
fields in the screen-identifier list are selected.
When the RESET statement is executed, the attributes and data of the selected fields are
reset to their initial values.
RESET does not cause a physical write to the screen but causes data to be written to the
terminal buffer. A physical write to the screen occurs when one of the following events
occurs:
• TERMBUF fills up
• Execution of one of the following statements:
ACCEPT
BEGIN-TRANSACTION
END-TRANSACTION
RESTART-TRANSACTION
ABORT-TRANSACTION
CALL
CHECKPOINT
DELAY
EXIT PROGRAM
PRINT SCREEN
SEND
• Execution of DISPLAY for a conversational terminal
The DEPENDING ON clause for the RESET statement is analogous to the
DEPENDING ON clause for the PERFORM ONE statement. The following example
illustrates this.
WORKING-STORAGE SECTION.
:
77 ws-screen-status PIC 9(4) COMP VALUE 1.
01 ws-table.
05 ws-table-item PIC X(10)
OCCURS 4 TIMES.
SCREEN SECTION.
:
01 MENU1 SIZE 24, 80.
05 screen-table at 3, 4
PIC X(10)
OCCURS ON 4 LINES SKIPPING 1
VALUE "0000000000"
USING ws-table-item.
PROCEDURE DIVISION.
:
BODY-PARAGRAPH.
:
DISPLAY BASE MENU1.
TURN REVERSE IN MENU1.
DISPLAY MENU1.
:
RESET SCREEN-TABLE(1),
SCREEN-TABLE(2),
SCREEN-TABLE(3),
SCREEN-TABLE(4),
DEPENDING ON WS-SCREEN-STATUS.
If WS-SCREEN-STATUS equals 1, the displayed value and video attribute for
SCREEN-TABLE(1) are reset to the states declared in the screen definition. If
WS-SCREEN-STATUS equals 2, the displayed value and video attribute for SCREEN-
TABLE(2) are reset to the states declared in the screen definition, and so on. It is not
considered erroneous if WS-SCREEN-STATUS < 1 or WS-SCREEN-STATUS > 3.
Control just falls through (execution continues with the next statement) and no screen
field is reset.
RESTART-TRANSACTION Statement
The RESTART-TRANSACTION statement restarts the transaction of a terminal
operating in transaction mode. Transaction mode is an operating mode in which
Pathway servers that are configured to run under the Transaction Management Facility
(TMF) can lock and update audited files.
RESTART-TRANSACTION
Execution of this statement indicates the current attempt to perform the transaction
failed because a transient problem occurred.
The statement requests TMF to back out any updates made on a database during this
transaction; terminal execution resumes at the BEGIN-TRANSACTION statement.
TMF assigns a new transaction-ID to the transaction; the TCP marks the screen for
screen recovery and increments by 1 the special register RESTART-COUNTER. The
special register TERMINATION-STATUS remains at 1 (which indicates that the
transaction is started or restarted). Working-storage items are restored to the values they
had at execution of BEGIN-TRANSACTION. If the BEGIN-TRANSACTION
statement includes the ON ERROR phrase, the ON ERROR branch is executed.
The execution of this statement can cause suspension of a terminal for a pending abort
for two reasons:
• The terminal is not in transaction mode when this statement executes.
• A fatal error occurs while attempting to back out the updates made on the database.
SCROLL Statement
The SCROLL statement moves the contents of an overlay area up or down. This
statement can be used only with the 6510 terminal; it cannot be used for communicating
with other terminals or with intelligent devices.
SCROLL { UP } overlay-area-name
{ DOWN }
UP
moves the data displayed in the overlay area of the screen up one line toward the top
of the screen. A blank line appears at the bottom of the overlay area, and the top
line in the overlay area is lost.
DOWN
moves the data displayed in the overlay area of the screen down one line toward the
bottom of the overlay. A blank line appears at the top of the overlay area, and the
last line in the overlay area is lost.
overlay-area-name
is the name of the screen overlay area. The overlay screen associated with the area
can contain only output or literal fields. Literal fields are displayed only when the
overlay screen is initially displayed in the area.
SEND Statement
The SEND statement declares the data structure associated with each valid reply code
value. The SEND statement sends a transaction request message to a server process and
receives a reply from that server process. The SEND statement includes the message
and a list of reply specifications.
In processing the SEND statement, the TCP retains the reply code values to use when
the server sends the reply. Upon receipt of a reply, the TCP compares the reply code
value to the list of reply code values and determines which reply was received and,
consequently, determines the structure of the data. The TCP then copies the reply into
the SCREEN COBOL program.
[ AT SYSTEM system-name ]
[ ON ERROR imperative-statement ]
identifier-1
is a data item to be sent to the server. The data item represented by this identifier
cannot exceed 32000 bytes. If identifier-1 is a variable-length data item, the
SEND statement sends only the currently defined occurrence (a variable-length data
item is an item defined with an OCCURS DEPENDING ON clause).
If this parameter is omitted, zero bytes are sent to the server. A reply will still be
returned from the server.
server-class-name
identifies the server class for which a message is intended. The server-class-
name can be a nonnumeric literal or a data item. The size of the field containing
server-class-name can be 1 through 15 characters.
This is the logical server class name used in the PATHCOM ADD SERVER
command.
pathmon-name
is the name of the PATHMON process that controls the links to the server class
named in the server-class-name parameter. The pathmon-name can be a
nonnumeric literal or a data item. The field containing pathmon-name can have
up to 15 characters, but the TCP passes only the first 5 characters in network
communications.
A SEND statement directed through an external PATHMON must specify a valid
network process name. The value specified for pathmon-name must begin with a
$ and can be followed by 1 to 4 alphanumeric characters.
If this parameter is omitted, the PATHMON that controls the server class is assumed
to have the same name as the PATHMON process that controls the TCP.
system-name
is the name of the Compaq NonStop™ Himalaya system on which the named
PATHMON process is running. The system-name can be a nonnumeric literal or
a data item. The field containing system-name can have up to 15 characters, but
the TCP passes only the first 8 characters in network communications.
The value specified for system-name must be a valid network system name that
begins with a \ and can be followed by 1 to 7 alphanumeric characters. If this
parameter is omitted, the NonStop™ Himalaya system name of the PATHMON that
controls the server class is assumed to be the same as the system name of the
PATHMON that controls the TCP.
reply-code-value
is an integer literal or integer data item that specifies an expected reply code from
the server. The maximum number of reply code values associated with one
YIELDS clause is 255.
VARYING
can be used to control error logging when variable-length replies are expected.
When the ON ERROR clause is present, the keyword VARYING suppresses the
logging of error 3115 (TRANSACTION REPLY SIZE INVALID) when the reply is
shorter than the YIELDS buffer. Error 3115 is still logged whenever the reply
length exceeds the length of the YIELDS buffer. The keyword VARYING has no
effect unless the ON ERROR clause is present.
identifier-2
is a data name into which a portion of the contents of the reply message is to be
placed.
CODE OTHER
is used to ensure that a match on the reply code will always occur, thus preventing
the logging of error 3112 (REPLY NUMBER NOT KNOWN TO PROGRAM)
when the actual reply code is not found in the list of expected reply codes. Note that
the CODE OTHER clause can appear by itself when no explicit reply codes are
expected.
The CODE OTHER clause must be the last CODE clause in the SEND verb; if it is
followed by a CODE <value> clause, SCREEN COBOL will report error 616
('CODE OTHER' MUST BE LAST STMT IN REPLY CODE LIST OF SEND).
Reply code values must not appear in the same CODE clause as the keyword
OTHER. The sequence CODE 1 2 OTHER will produce error 44 (SYNTAX
ERROR DETECTED AT TOKEN) and error 48 (PARSING RESUMED AT
TOKEN); the sequence CODE OTHER 1 2 will produce the same error.
ON ERROR
provides a point of control if an error occurs in sending the message.
If this clause is omitted and an error is detected, standard system action is
performed. Depending on the error, system action involves either waiting for a
resource to become available or suspending execution of the program.
Errors that occur during execution of a SEND statement can be looked up by
number in the TERMINATION-STATUS special register to determine the meaning
and recommended action. For some errors, additional information is reported in the
TERMINATION- SUBSTATUS special register.
At the end of this section is a list of the error numbers found in the
TERMINATION-STATUS special register.
imperative-statement
is the statement to be executed if an error is detected.
IF err-flag = no-err
PERFORM ONE OF
set-rp-1-len
set-rp-2-len
DEPENDING ON termination-status
PERFORM good-reply-paragraph
ELSE IF err-flag = length-mismatch
MOVE termination-substatus TO rp-len
* if excess length, truncate to buffer length
PERFORM adjust-rp-len
* subtract 2 bytes for reply code
SUBTRACT 2 FROM rp-len
ELSE IF err-flag = genuine-err
PERFORM genuine-reply-err-paragraph.
SEND-PARAGRAPH.
SEND msg-a TO srvr-x
REPLY CODE 15 YIELDS VARYING rp-cd rp-buf-1
CODE 37 YIELDS VARYING rp-cd rp-buf-2
ON ERROR PERFORM err-paragraph.
ERR-PARAGRAPH.
IF TERMINATION-STATUS = 11
MOVE length-mismatch TO err-flag
ELSE
MOVE genuine-err TO err-flag.
ADJUST-RP-LEN.
IF rp-cd = 15 PERFORM set-rp-1-len
ELSE IF rp-cd = 37 PERFORM set-rp-2-len.
SET-RP-1-LEN.
IF rp-len > max-rp-1-len
MOVE max-rp-1-len TO rp-len.
SET-RP-2-LEN.
IF rp-len > max-rp-2-len
MOVE max-rp-2-len TO rp-len.
GOOD-REPLY-PARAGRAPH.
IF rp-cd = 15
PERFORM rp-1-paragraph
ELSE IF rp-cd = 37
PERFORM rp-2-paragraph
ELSE
PERFORM logic-err-paragraph.
The example is executed as follows, assuming that the REPLY CODE is either 15 or 37:
1. If the reply length matches the length of the corresponding YIELDS items, the reply
is stored in the corresponding items, and the ON ERROR branch is not taken.
2. If the reply length is less than the length of the corresponding YIELDS items, the
reply is stored in the corresponding items, the length of the reply is stored in the
special register TERMINATION-SUBSTATUS, and the program performs ERR-
PARAGRAPH with TERMINATION-STATUS = 11. No error 3115 is logged
because VARYING was specified.
3. If the reply is longer than the corresponding YIELDS items, the reply is truncated
and stored in the corresponding items, TERMINATION-STATUS is set to 11,
TERMINATION-SUBSTATUS is set to the actual reply length up to a maximum of
1 + max(len(msg-a),len(rp-cd)+len(rp-buf-1),len(rp-cd)+len(rp-buf-2)), and the
program performs ERR-PARAGRAPH. In this case an error 3115 is logged.
PROCEDURE DIVISION.
:
:
SEND MSGID, EMPLOYEE-REC TO "SERV-1"
UNDER PATHWAY "$PWT"
AT SYSTEM "\TS"
REPLY CODE 1 YIELDS R-CODE, EMPLOYEE-REC
CODE 2 YIELDS R-CODE, HIRE-DATE
ON ERROR PERFORM 899-SEND-ERROR.
:
:
MOVE WS-DEFAULT-SERVER TO WS-SERV-NAME.
MOVE WS-DEFAULT-PATHMON TO WS-SCRN-PATHMON.
MOVE WS-DEFAULT-SYSTEM TO WS-SCRN-SYSTEM.
:
:
SEND MSGID, EMP-TRANSFER TO WS-SERV-NAME
UNDER PATHWAY WS-SCRN-PATHMON
AT SYSTEM WS-SCRN-SYSTEM
REPLY CODE 1 YIELDS R-CODE, EMPLOYEE-LOC
CODE 2 YIELDS R-CODE,
CODE 3 YIELDS R-CODE
ON ERROR PERFORM 899-SEND-ERROR.
:
The following list of messages contains an explanation of the error numbers in the
TERMINATION-STATUS special register.
TERMINATION-STATUS 1
SERVER CLASS FROZEN
TERMINATION-STATUS 2
RESOURCE UNAVAILABLE
Cause. A free server class control block cannot be found. You should increase the
value of the TCP configuration parameter MAXSERVERCLASSES.
Action Without ON ERROR Clause. The system waits until the resource is available,
then continues with the processing of the SEND statement.
TERMINATION-STATUS 3
RESOURCE UNAVAILABLE
Cause. A free server process control block cannot be found. You should increase the
value of the TCP configuration parameter MAXSERVERPROCESSES.
Action Without ON ERROR Clause. The system waits until the resource is available,
then continues with the processing of the SEND statement.
TERMINATION-STATUS 4
LINK DENIED
Cause. The request to PATHMON for a link to the server class has been denied for
indeterminate reasons, and the TCP has no previously established links to the class.
Action Without ON ERROR Clause. The system periodically rerequests a link and,
when successful, continues with the processing of the SEND statement.
TERMINATION-STATUS 5
SERVER CLASS UNDEFINED
Cause. The request to PATHMON for a link to the server class has been denied because
no class of that name has been defined.
TERMINATION-STATUS 6
ILLEGAL SERVER CLASS NAME
Cause. The value given for the name of the server class does not have the format of a
valid server class name.
Action Without ON ERROR Clause. The system suspends the terminal with a fatal
error.
TERMINATION-STATUS 7
MESSAGE TOO LARGE
Cause. The message to the server is larger than allowed by the TCP configuration.
TERMINATION-STATUS 8
MAXIMUM REPLY TOO LARGE
Cause. The size of one or more replies specified in the SEND statement is larger than
allowed by the TCP configuration. The maximum number of bytes permitted for an
outgoing SEND message or a server reply message is specified using the MAXREPLY
parameter of the PATHCOM SET TCP command, which should be set to the larger of:
• The longest outgoing message from any SEND statement from any terminal
controlled by the TCP
• The longest reply possible from any server replying to a SEND statement from any
terminal controlled by the TCP
TERMINATION-STATUS 10
UNDEFINED REPLY
Cause. The reply code found in the reply from the server does not match any codes
specified in the SEND statement.
Action Without ON ERROR Clause. The system suspends the terminal. If terminal
execution is resumed when the operator issues a PATHCOM RESUME command, the
SEND statement is retried. If the terminal is in transaction mode, the transaction is
backed out and the terminal is suspended. If terminal execution is resumed, the
transaction is restarted.
TERMINATION-STATUS 11
REPLY LENGTH INVALID
Cause. The length of the reply received from the server is not equal to the length
specified by the selected YIELDS list.
Note. The TERMINATION-SUBSTATUS special register contains the following additional
information: reply length received (in bytes).
TERMINATION-STATUS 12
I/O ERROR
Cause. A file system error occurred during the WRITEREAD to the server, or a timeout
on the server occurred.
Note. The TERMINATION-SUBSTATUS special register contains the following additional
information: file-system error number.
TERMINATION-STATUS 13
TRANSACTION MODE VIOLATION
Cause. A SEND to a server not using TMF was attempted while the terminal was in
transaction mode.
Action Without ON ERROR Clause. The system suspends the terminal for pending
abort.
TERMINATION-STATUS 14
NO PMCB AVAILABLE
Cause. The request requires the TCP to communicate with an external PATHMON
process, but the maximum number of PATHMON processes the TCP can communicate
with has been reached. The value specified in the SET TCP MAXPATHWAYS
command sets this limit.
Action Without ON ERROR Clause. The system suspends the terminal and an error
message is sent to the PATHMON log file.
TERMINATION-STATUS 15
UNDEFINED SYSTEM
TERMINATION-STATUS 16
ILLEGAL SYSTEM NAME
Cause. The value given for the system name does not have the correct format. (For
example, the first character is not a \.)
TERMINATION-STATUS 17
ILLEGAL PATHMON NAME
Cause. The value given for the name of PATHMON process does not have the correct
format. (For example, the first character is not a $.)
TERMINATION-STATUS 18
PATHMON I/O ERROR
TERMINATION-STATUS 19
PATHMON I/O ERROR DUE TO LICENCING PROBLEMS
Cause. An external Pathmon process rejects the OPEN message due to licensing
problems.
Note. The TERMINATION-SUBSTATUS special register contains the following additional
information: file-system error number.
[ TIMEOUT timeout-value ]
[ ON ERROR imperative-statement ]
reply-spec syntax:
{YIELDS reply-message }
{{CODE reply-code [,reply-code]... YIELDS reply-message}...}
send-message
specifies a message template in the Message Section or an 01 level data item in the
Working-Storage Section. In either case, it specifies data to be sent to an intelligent
device.
If you omit send-message, no data is sent, but a reply message is returned.
The offset of the specified field from the beginning of its record dictates the offset of
the reply-code field from the beginning of the reply-message.
The length of the specified field dictates the length of the reply-code field.
The data type of the specified field dictates the data type of the reply-code field.
The reply-code in all reply-messages must be the same length and have the
same offset; reply codes need not have the same name.
YIELDS reply-message
specifies either a message template in the Message Section or an 01 level data item
in Working-Storage. It describes the data expected from the intelligent device in
reply to the SEND MESSAGE statement. A reply-message can be associated
with one or more reply-code values.
If reply-message and reply-code are both omitted, no reply is expected.If
only one reply-message is specified and code-field is omitted, any reply is
expected to have the format of the reply-message.
CODE reply-code
specifies a literal or a data item that indicates which reply-message is expected.
No reply-code is needed if there is only one reply-message.
The position of the reply-code in the CODE reply-code clause corresponds
to a TERMINATION-STATUS value. One or more reply-code values can be
associated with each reply-message.
A nonnumeric literal must be enclosed within quotation marks.
TIMEOUT timeout-value
specifies a time limit in seconds for output to the intelligent device. The
timeout-value can be a numeric literal or a numeric data item; valid values are
0 through 32,767 seconds.
When a timeout error occurs, it is logged to the Pathway log. If the TCP attribute
SENDMSGTIMEOUT is set to OFF, only the first SENDMSGTIMEOUT timeout
error is logged for the TCP. When the ON ERROR clause is used with a SEND
MESSAGE statement, only the first 3161 timeout encountered by each TCP
configured under a PATHMON process is logged. An additional 3161 timeout is
logged when the primary TCP fails and the backup TCP takes over and encounters
the timeout. The TCPs filter out all other 3161 timeout errors. If the ON ERROR
clause is not used and a 3161 timeout occurs, the corresponding terminal is
suspended after the timeout is logged.
If the output does not complete in the specified number of seconds,
TERMINATION- STATUS is set to 1, TERMINATION-SUBSTATUS is set to 40,
the operation is cancelled, and any ON ERROR clause is executed.
When the SCREEN COBOL program that contains the SEND MESSAGE statement
is communicating with devices using a queued (CONTROL 26) protocol, the
TERMINATION-SUBSTATUS special register has a value following a SEND
MESSAGE that completes for a TIMEOUT.
If this clause is omitted, there is no time limit.
ON ERROR imperative-statement
specifies action to be taken should an error occur in sending the message. If an error
is detected, the imperative-statement is executed.
If ON ERROR is omitted and an error is detected, the system takes standard action.
Depending on the error, the system either waits for a resource to become available
or suspends execution of the program.
If ON ERROR is included in the SEND MESSAGE statement, TERMINATION-
STATUS is set to a specified number.
If there are no errors, TERMINATION-STATUS contains the relative position of the
matching reply. Thus, you should write error processing routines to execute only
when an error occurs.
Appendix D, Errors for Message Section Statements, lists errors that can occur
during execution of the SEND MESSAGE statement.
Note. Error messages can be placed in the log by the PATHMON process even if an ON
ERROR clause is included in a SEND MESSAGE statement.
The following rules apply:
• A send-message or reply-message cannot exceed 32,000 bytes.
• send-message considerations:
° If send-message identifies a message template in the Message Section, the
data is obtained from the data item specified in the FROM or USING clause of
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
6- 83
Procedure Division SEND MESSAGE Statement
the message, is converted and edited according to the message definition, and is
then sent to the intelligent device.
° If send-message identifies an 01 level data item in Working-Storage, the
data is neither validated nor converted but is sent as is to the device, unless the
USER CONVERSION clause is included.
° If send-message identifies a variable-length data item (described with an
OCCURS DEPENDING ON clause), it sends only the number of characters up
to and including the current number of occurrences.
• reply-message considerations:
° If reply-message is the name of a message template, the value of the
message is validated according to the message-field definition, converted to the
format of the Working-Storage data item in the TO or USING clause, and then
moved to that data item.
° If reply-message is the name of a level 01 Working-Storage item, the data
from the intelligent device is neither validated nor converted but is moved as is
to the data item, unless you specify a USER CONVERSION clause.
° All the reply-messages in any one SEND MESSAGE statement must have
the same format: FIXED, VARYING1, VARYING2, DELIMITED, or FIXED-
DELIMITED.
° If there is only one reply-message, you need not specify a reply-code.
° When the TCP receives a reply from the intelligent device, it checks for a
reply-code in the message or data item. The reply-code value indicates
which reply-message was returned.
° The reply-code is located either at the location indicated by code-field
or, if code-field is omitted, in the first two bytes of the message or data
item.
° Each reply-code is associated with a value in the special register
TERMINATION-STATUS. TERMINATION-STATUS is set to a number
corresponding to the position of each reply-code in the list of reply-
code values, starting at position number 1.
° A reply-message can be associated with more than one reply-code.
Each reply-code corresponds to a unique setting for TERMINATION-
STATUS regardless of whether the reply-code yields the same or a different
reply-message.
° If a code-field is specified, a reply-message is selected by comparing
each reply-code with the code-field according to the standard SCREEN
COBOL rules for equality (refer to Section 2, SCREEN COBOL Source
Program). The test is performed exactly as if it were written:
IF code-field EQUALS reply-code
• Execution considerations:
° Pathway/iTS does not buffer multiple messages. Each message is transmitted to
the intelligent device when SEND MESSAGE is executed.
° SCREEN COBOL programs handle synchronization of messages between the
program and the intelligent device. This means that the program must detect
duplicate messages from the intelligent device.
° Pathway/iTS does no checkpointing when SEND MESSAGE is executed.
Consider the following SCREEN COBOL example with multiple reply messages:
DATA DIVISION.
WORKING-STORAGE SECTION.
77 INQUIRY PIC X(12).
01 MESSAGE-REPLY-OK.
03 REPLY-CODE-FIELD PIC X(2).
03 REPLY-OK PIC X(130).
01 MESSAGE-REPLY-NOGOOD.
03 REPLY-CODE-FIELD PIC X(2).
03 REPLY-NG PIC X(14).
MESSAGE SECTION.
01 INTELLIGENT-MESSAGE-INQ PIC X(12) FROM INQUIRY.
PROCEDURE DIVISION.
A1 1
B1 2
C1 3
A2 4
B2 5
C2 6
1 1
21 2
31 3
2 4
42 5
62 6
Consider the following SCREEN COBOL example of processing the ESCAPE
ON UNSOLICITED MESSAGE clause:
CONTINUE-ACTION.
SEND MESSAGE REQUEST-MESSAGE
REPLY CODE "AA" YIELDS reply-aa
CODE "XX" YIELDS reply-xx
ESCAPE ON UNSOLICITED MESSAGE
TIMEOUT FIVE-MINUTES
ON ERROR
PERFORM ERROR-ANALYSIS.
UNSOL-MSG-ARRIVED.
PERFORM SAVE-OUTCOME.
RECEIVE UNSOLICITED
YIELDS UNSOL-STATS-REQST.
. . .
REPLY TO UNSOLICITED latest-stats
SAVE-OUTCOME.
IF TERMINATION-SUBSTATUS = 187
MOVE OP-QUIESCENT TO OP-OUTCOME
ELSE
IF TERMINATION-SUBSTATUS = 188
SET Statement
The SET statement stores the position of the indicated screen field into the special
register NEW-CURSOR. This value, which could be further modified by the program,
is used at the beginning of the next ACCEPT statement to establish the position of the
cursor on the screen. This value also can be examined by the program for some specific
purpose.
The SET statement cannot be used by programs communicating with intelligent devices.
[ DEPENDING [ ON ] identifier ]
[ SHADOWED ]
screen-identifier
specifies the screen fields whose positions are to be stored; maximum of 127 per SET
statement. Each screen-identifier can name an entire screen, a screen group, or
an elementary input item of any base or overlay screen that is currently displayed. If
screen-identifier is a group, all subordinate elementary items that have a TO,
FROM, or USING phrase in their definitions are included in the reference. screen-
identifier cannot be a subscripted item.
The default cursor position is the first screen field defined with a TO or USING clause
for the current ACCEPT statement.
DEPENDING ON identifier
selects zero or one screen-identifier from the list. The statement whose
position in the screen-identifier list is the same as the value in
identifier is selected. If the value in identifier is less than 1 or greater
than the number of screen identifiers, no screen-identifier is
selected.
SHADOWED
selects from the screen-identifier list only those fields that have
SHADOWED items in which the SELECT bit is set; fields that do not have
SHADOWED items are not selected.
Note. If neither the DEPENDING ON modifier nor the SHADOWED modifier is specified, all
fields in the screen-identifier list are selected.
The SET statement selects fields in sequence from top to bottom and left to right as the
fields are positioned on the screen. The field having the lowest row (line) number is
selected before a field with a higher row number. For fields in the same row, the field
having the lowest column number is selected before the field with a higher column
number.
The SET statement places the row and column numbers of the leftmost character of the
first selected field into the special register NEW-CURSOR. The implied structure of
NEW-CURSOR is:
01 NEW-CURSOR.
02 NEW-CURSOR-ROW PIC 9999 COMP.
02 NEW-CURSOR-COL PIC 9999 COMP.
If the value specified in the special register NEW-CURSOR is not a valid screen
position when an accept operation begins, the cursor is positioned to the first
unprotected field of the ACCEPT statement for a 65xx terminal or to the first field of the
ACCEPT statement for an IBM 3270 terminal. (IBM 3270 terminals do not prevent
cursor positioning at a protected field.)
After execution of an ACCEPT statement, the special register is set to zero; this sets the
cursor position for the next ACCEPT statement. For 65xx terminals, the cursor position
is at the first unprotected field of the ACCEPT statement. For IBM 3270 terminals, the
cursor position is at the first field of the ACCEPT statement defined with a TO or
USING clause.
If you do not want the cursor positioned at a protected field on an IBM3270 terminal,
you can use a SET statement to position the cursor at an unprotected field.
The DEPENDING ON clause for the SET statement is analogous to the DEPENDING
ON clause for the PERFORM ONE statement. The following example illustrates this.
WORKING-STORAGE SECTION.
:
77 ws-screen-status PIC 9(4) COMP VALUE 1.
01 ws-fld1 PIC x(10).
01 ws-fld2 PIC x(10).
01 ws-fld3 PIC x(10).
SCREEN SECTION.
:
01 MENU1 SIZE 24, 80.
05 screen-fld1 at 4, 20
PIC X(10)
from fld1.
05 screen-fld2 at 5, 40
PIC X(10)
from fld2.
05 screen-fld3 at 6, 60
PIC X(10)
from fld3.
PROCEDURE DIVISION.
:
BODY-PARAGRAPH.
:
DISPLAY BASE MENU1.
DISPLAY MENU1.
SET NEW-CURSOR AT SCREEN-FLD1,
SCREEN-FLD2,
SCREEN-FLD3,
DEPENDING ON WS-SCREEN-STATUS.
ACCEPT MENU1
:
If WS-SCREEN-STATUS equals 1, the cursor is positioned at SCREEN-FLD1 upon
execution of the ACCEPT statement. If WS-SCREEN-STATUS equals 2, the cursor is
positioned at SCREEN-FLD2 upon execution of the ACCEPT statement, and so on. It
is not considered erroneous if WS-SCREEN-STATUS < 1 or
WS-SCREEN-STATUS > 3. Control just falls through (execution continues with the
next statement) and the cursor is left at its default position.
data-name
specifies the Working-Storage group item template for highlight and outline display
attributes.
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
6- 90
Procedure Division SET MINIMUM-ATTR Statement
The Working-Storage group item template for highlight and outline display attributes
must be defined in Working-Storage as follows:
01 WS-MINIMUM-ATTRIBUTE.
02 FILLER PIC 9(04) COMP.
02 IBM-BASE-ATTR PIC 9(04) COMP.
02 IBM-FIELD-REVERSE PIC 9(04) COMP.
02 IBM-FIELD-BLINK PIC 9(04) COMP.
02 IBM-FIELD-UNDERLINE PIC 9(04) COMP.
02 IBM-FIELD-OUTLINE PIC 9(04) COMP.
• IBM-BASE-ATTR specifies the set of field attributes currently supported by the
C00 and previous releases of Pathway for terminals in the IBM 3270 family. If you
do not specify a SET MINIMUM-ATTR statement, the default value is IBM-BASE-
ATTR.
• IBM-FIELD-REVERSE, IBM-FIELD-BLINK, and IBM-FIELD-UNDERLINE
specify the set of highlight display attributes available on terminals in the IBM 3270
family.
• IBM-FIELD-OUTLINE specifies the set of outline display attributes for terminals in
the IBM 3270 family, specifically TOPLINE, LEFTLINE, RIGHTLINE,
BOTTOMLINE, and BOXFIELD.
A value of 1 is placed in the corresponding elementary item if that attribute is required.
For example, if you want reverse video and outlining, you move the value 1 into the
IBM-FIELD-REVERSE and IBM-FIELD-OUTLINE elementary fields. All other fields
are set to 0.
The mimimum level of support for highlight or outline display attributes does not
change until a subsequent SET MINIMUM-ATTR statement is executed, even if you use
a CALL statement to move between program units.
data-name
specifies the Working-Storage group item template for color display attributes,
which must be defined as follows:
01 WS-MINIMUM-COLOR.
02 FILLER PIC 9(04) COMP.
02 IBM-PARTIAL-COLOR PIC 9(04) COMP.
02 IBM-FULL-COLOR PIC 9(04) COMP.
• IBM-PARTIAL-COLOR specifies terminals in the IBM 3270 family that can
support three colors.
• IBM-FULL-COLOR specifies terminals in the IBM 3270 family that can support
six colors.
A value of 1 is placed in the corresponding elementary item if that attribute is required.
For example, if you want the program unit to work only on terminals with full color
capability, you move the value 1 into IBM-FULL-COLOR. All other Working-Storage
fields are set to 0.
The mimimum level of support for color display attributes does not change until a
subsequent SET MINIMUM-COLOR statement is executed, even if you use a CALL
statement to move between program units.
If you do not specify a SET MINIMUM-COLOR statement, the default setting for color
display attributes is no color. All elementary fields in the Working-Storage group
DEVICE-VIDEO-COLOR are set to 0.
STOP RUN
If the executing program is a called program unit and a STOP RUN statement is
executed, control does not return to the calling program.
SUBTRACT Statements
The SUBTRACT statements subtract elementary numeric data items and set the results
in specific data items. The forms of the SUBTRACT statements are:
SUBTRACT
SUBTRACT GIVING
SUBTRACT CORRESPONDING
Each form is described in the following paragraphs.
SUBTRACT Statement
The SUBTRACT statement totals all data items before keyword FROM and then
subtracts that sum from the current value of each data item after keyword FROM.
sub-1
is either a numeric literal or the identifier of an elementary numeric data item.
sub-2
is the identifier of an elementary numeric data item.
sub-1
is either a numeric literal or the identifier of an elementary numeric data item.
sub-2
is either a numeric literal or the identifier of an elementary numeric data item.
result
is the identifier of an elementary numeric data item.
TERMINALINFO Statement
The TERMINALINFO statement returns information about terminals. From this
information you can determine what action is to be taken if a terminal does not support
the required extended field attributes.
data-name
specifies the Working-Storage group item template for color, highlight, and outline
display attributes supported by a terminal.
The information returned by the TERMINALINFO statement is placed in an elementary
item defined in the Working-storage Section. The Working-Storage group item template
for color, highlight, and outline display attributes must be defined in Working-Storage
as follows:
01 WS-TERMINAL-INFO.
02 DEVICE-VIDEO-STATUS-ATTR PIC S9(04) COMP VALUE 0.
02 DEVICE-VIDEO-STATUS-COLOR PIC S9(04) COMP VALUE 0.
02 DEVICE-VIDEO-COLOR.
03 IBM-PARTIAL-COLOR PIC 9(4) COMP.
03 IBM-FULL-COLOR PIC 9(4) COMP.
03 FILLER PIC 9(4) COMP.
02 DEVICE-VIDEO-ATTRIBUTES.
03 IBM-BASE-ATTR PIC 9(4) COMP.
03 IBM-FIELD-REVERSE PIC 9(4) COMP.
03 IBM-FIELD-BLINK PIC 9(4) COMP.
03 IBM-FIELD-UNDERLINE PIC 9(4) COMP.
03 IBM-FIELD-OUTLINE PIC 9(4) COMP.
• DEVICE-VIDEO-STATUS-ATTR indicates the level of support for the REVERSE,
BLINK, and UNDERLINE highlight display attributes requested in a SET
MINIMUM-ATTR statement.
° 1 indicates the terminal has more capability than requested.
° 0 indicates the terminal has the same capability as requested.
° -1 indicates the terminal has less capability than requested.
If no SET MINIMUM-ATTR statement was issued, the reply indicates the capability
of the terminal to support the default (that is, no highlight, color, or outline display
attributes).
• DEVICE-VIDEO-STATUS-COLOR indicates the level of support for color display
attributes requested in a SET MINIMUM-COLOR statement.
° 1 indicates the terminal has more capability than requested.
° 0 indicates the terminal has the same capability as requested.
° -1 indicates the terminal has less capability than requested.
TRANSFORM Statement
The TRANSFORM statement replaces a set of Working-Storage Section data items with
another set of Working-Storage Section data items.
TRANSFORM trans-rec-out
{YIELDS trans-rec-in }
{ }
{{CODE select-code [,select-code]...YIELDS trans-rec-in}...}
trans-rec-out
specifies the output record that TRANSFORM is to build and is made up of:
out-item-n
is a Working-Storage Section or Message Section 01 level item, group item, or
elementary data item.
out-item-1 through out-item-n must all be of one type, either Working-
Storage Section or Message Section items, not a combination.
YIELDS trans-rec-in
specifies the input record that is to be the result of the TRANSFORM operation and
is made up of:
in-item-1
is a Working-Storage Section or MessageSection 01 level item, group item, or
elementary data item. in-item-1 through in-item-n must all be of one
type, either Working-Storage Section or Message Section items, not a
combination of types.
CODE select-code
identifies a literal or a data item that specifies which input record is expected.
The position of the select-code in the CODE select-code clause
corresponds to a TERMINATION-STATUS value. One or more select-code
values can be associated with each input record.
A nonnumeric literal must be enclosed within quotation marks.
ON ERROR imperative-statement
specifies action to be taken should an error occur on either the input or output phase
of the TRANSFORM operation. If an error is detected, the imperative-
statement is executed.
If ON ERROR is omitted and an error is detected, the TCP takes standard action for
terminals.
On either the output or input phase, if the data is mapped through the Message Section,
the Message Section entry specifies which Working-Storage Section items to process.
In addition, the Message Section entry defines the characteristics of the data, including
order, format, and length.
If the data transformation capabilities of ordering, editing, and conversion are not used,
TRANSFORM acts as a move statement. You could program a series of data moves
from place to place by setting up a Message Section template and then invoking a block
move using TRANSFORM.
The following rules apply:
• For either the output record or the input record, you cannot have different sections
represented within one record. Each record must contain all Working-Storage
Section items or all Message Section items. The compiler produces an error if either
record is made up of items from more than one section.
• You can have different sections represented by the output record and the input
record. For example, the output record can be made up of items from the Working-
Storage Section and the input record made up of items from the Message Section.
• At compile time, only limited edit rule checking is imposed. Compatibility between
output and input templates is not checked at compile time. For example, it is
possible to code the output of a PIC A field to be input into a PIC 9 field. The
compiler will not attempt to find this type of error.
• At run time, checks will be made on the input and output sides to ensure that data
consistent with the specified data type is found. For example, a run-time error will
occur if either too much or too little data is available to satisfy the input
requirements. If an error is found, the ON ERROR clause will be executed and
TERMINATION-STATUS, TERMINATION-SUBSTATUS will be set accordingly.
Further, should a data editing error be detected during a TRANSFORM, the proper
FIELD-STATUS items will be updated to show the fields involved.
• Refer to Appendix D, Errors for Message Section Statements, for an explanation of
the error numbers that can be found in the TERMINATION-STATUS special
register.
Consider the following SCREEN COBOL examples with multiple input records:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-CODE-MSG.
05 WS-SEL-CODE-FIELD PIC 9(4) COMP.
01 WS-DESTINATION-TEMP-1.
05 WS-DEST-1-FLD1 PIC X(50).
05 WS-DEST-1-FLD2 PIC X(50).
01 WS-DESTINATION-TEMP-2.
05 WS-DEST-2-FLD1 PIC X(30).
MESSAGE SECTION.
01 DESTINATION-TEMP-1.
05 FILLER PIC 9(4) COMP.
05 MS-DEST-1-FLD1 PIC X(50) TO WS-DEST-1-FLD1.
05 MS-DEST-1-FLD2 PIC X(50) TO WS-DEST-1-FLD2.
01 DESTINATION-TEMP-2.
05 FILLER PIC 9(4) COMP.
05 MS-DEST-2-FLD1 PIC X(30) TO WS-DEST-2-FLD1.
05 MS-DEST-2-FLD2 PIC X(30) TO WS-DEST-2-FLD2.
05 MS-DEST-2-FLD3 PIC X(40) TO WS-DEST-2-FLD3.
PROCEDURE DIVISON.
TRANSFORM MS-SOURCE
SELECT CODE FIELD IS WS-SEL-CODE-FIELD OF WS-CODE-MSG
CODE 44, 54 YIELDS DESTINATION-TEMP-1
CODE 64, 74 YIELDS DESTINATION-TEMP-2
ON ERROR PERFORM ERROR-HANDLER.
WORKING-STORAGE SECTION.
MESSAGE SECTION.
01 DESTINATION-TEMP-1.
05 MS-DEST-1-FLD1 PIC X(30) TO WS-DEST-1-FLD1.
05 FILLER PIC 9(4) COMP.
01 DESTINATION-TEMP-2.
05 MS-DEST-2-FLD1 PIC X(30) TO WS-DEST-2-FLD1.
05 FILLER PIC 9(4) COMP.
05 MS-DEST-2-FLD2 PIC X(30) TO WS-DEST-2-FLD2.
05 MS-DEST-2-FLD3 PIC X(40) TO WS-DEST-2-FLD3.
PROCEDURE DIVISON.
TRANSFORM MS-SOURCE
SELECT CODE FIELD IS WS-SEL-CODE-FIELD OF WS-CODE-MSG
CODE SC1 YIELDS DESTINATION-TEMP-1
CODE SC2 YIELDS DESTINATION-TEMP-2
ON ERROR PERFORM ERROR-HANDLER.
TURN Statement
The TURN statement changes the display attributes of screen variable fields. The
TURN statement cannot be used by programs communicating with intelligent devices.
IN
TEMP or TEMPORARY
indicates the fields are to be reset to their initial display attributes when the next
RESET TEMP or ACCEPT statement is executed.
Note. During execution of a SCREEN COBOL program, the TCP controls the MDTs (modified
data tag) in the same way it controls display attributes, with two important exceptions:
• When a TURN TEMP statement selects an input field for changing display attributes, the
MDT bit is always set.
• When a RESET TEMP statement selects an input field for resetting of attributes, the MDT
bit is set, regardless of the initial MDT attribute of the field.
These two exceptions apply only to the TURN and RESET statements that have the TEMP
modifier. Note also that the field’s MDT bit is not reset after the completion of the ACCEPT
statement. Once the MDT bit is set, it stays set until the next DISPLAY BASE, TURN, RESET,
or CLEAR INPUT operation.
mnemonic-name
specifies the display attributes to be used. The mnemonic-name must be
associated with one or more display attributes through an IS phrase in the
SPECIAL-NAMES paragraph in the Environment Division of the program.
DYNAMIC
indicates that the specified screen field can have its screen attributes constructed
from a combination of the screen field’s attributes as defined at compile time and the
attribute settings as defined in the control structure.
RECEIVE FROM
specifies the type of device from which data can be accepted for a screen field. This
clause is supported only for applications running on 6530 or 6540 terminals with
6AI (revision A00 or later) firmware.
screen-identifier
specifies the fields whose attributes can be changed. Each identifier can be the
name of an entire screen, a screen group, or an elementary item of any base or
overlay screen that is currently displayed. If screen-identifier is not an
elementary item, screen-identifier refers to all subordinate elementary
items that have a TO, FROM, or USING clause in their definitions. There may be at
most 127 screen identifiers per TURN statement.
DEPENDING ON identifier
selects zero or one screen-identifier from the list. The statement whose
position in the screen-identifier list is the same as the value in
identifier is selected. If the value in identifier is less than 1 or greater
than the number of screen identifiers, no screen-identifier is selected.
SHADOWED
selects from the screen-identifier list only those fields that have
SHADOWED items with the SELECT bit set; fields that do not have SHADOWED
items are not selected.
Note. If neither the DEPENDING ON modifier nor the SHADOWED modifier is specified, all
fields in the screen-identifier list are selected.
The attributes of the selected fields are changed to those specified by mnemonic-
name. The settings for attributes not specified by mnemonic-name are determined by
the initial attributes of the field.
The DYNAMIC modifier provides the capability of changing the screen field attribute
settings at run time using the contents of individual attribute elements in an associated
control structure. It allows you to base the new display attributes specified by the TURN
statement on the run-time attribute settings, not the compile-time settings. To return the
attribute settings back to the compile-time values, use the RESET statement.
Table 6-7 shows the criteria for determining the selection of a screen field in a TURN
operation.
TURN does not cause a physical write to the screen but causes data to be written to the
terminal buffer. A physical write to the screen occurs when one of the following events
occurs:
• TERMBUF fills up
• One of the following statements is executed: ACCEPT; BEGIN-TRANSACTION,
END-TRANSACTION, RESTART-TRANSACTION, or ABORT-TRANSACTION;
CALL; CHECKPOINT; DELAY; EXIT PROGRAM; PRINT SCREEN; or
SEND
• The DISPLAY statement is executed for a conversational terminal
The DEPENDING ON clause for the TURN statement is analogous to the
DEPENDING ON clause for the PERFORM ONE statement. The following example
illustrates this.
WORKING-STORAGE SECTION.
:
77 ws-screen-status PIC 9(4) COMP VALUE 1.
01 ws-fld1 PIC x(10).
01 ws-fld2 PIC x(10).
01 ws-fld3 PIC x(10).
SCREEN SECTION.
:
01 MENU1 SIZE 24, 80.
05 screen-fld1 at 4, 20
PIC X(10)
from fld1.
05 screen-fld2 at 5, 40
PIC X(10)
from fld2.
05 screen-fld3 at 6, 60
PIC X(10)
from fld3.
PROCEDURE DIVISION.
:
BODY-PARAGRAPH.
:
DISPLAY BASE MENU1.
DISPLAY MENU1.
TURN REVERSE IN SCREEN-FLD1,
SCREEN-FLD2,
SCREEN-FLD3,
DEPENDING ON WS-SCREEN-STATUS.
If WS-SCREEN-STATUS equals 1, SCREEN-FLD1 is displayed in REVERSE. If WS-
SCREEN-STATUS equals 2, SCREEN-FLD2 is displayed in REVERSE, and so on. It
is not considered erroneous if WS-SCREEN-STATUS < 1 or WS-SCREEN-STATUS>3.
Control just falls through (execution continues with the next statement) and no screen
field is displayed in REVERSE.
PROTEC- UNDER-
HIDDEN TED BLINK MDTON DIM REVERSE LINE
HIDDEN Hidden Hidden & Hidden & Hidden Area is Area is Under-
Protected Blink and Mdton Dim. Reverse. line and
Text is Text is Hidden
Hidden. Hidden.
PROTEC- Protected Protected Protected Protected Protected Protected Protected
TED & Hidden & Blink & Mdton & Dim & Reverse & Under-
line
BLINK Blink & Blink & Blink Blink & Blink & Blink & Blink &
Hidden Protected Mdton Dim Reverse Under-
line
MDTON Mdton & Mdton & Mdton and Mdton Mdton & Mdton & Mdton &
Hidden Protected Blink Dim Reverse Under-
line
DIM Text is Dim & Dim & Dim & Dim Dim & Dim &
Hidden & Protected Blink Mdton Reverse Under-
area is line
Dim
REVERSE Reverse Reverse & Reverse & Reverse & Reverse & Reverse Reverse &
& Hidden Protected Blink Mdton Dim Under-
line
UNDER- Underline Underline Underline Underline Underline Underline Under-
LINE & & & Blink & Mdton & Dim & Reverse line
Hidden Protected
[ ON { base-screen-name-n } ,... ] .
ON base-screen-name-n
specifies the base screens for which the declarative procedures are to be used. If this
phrase is omitted, the declarative procedures are used for all screens not mentioned
in another USE statement.
The recovery process performs the equivalent of a DISPLAY BASE for the current base
screen followed by a DISPLAY OVERLAY for all currently active overlay screens. The
applicable declarative procedure statements are then executed. When the declarative
procedures complete execution, control returns to the statement that was being executed
when the problem was detected; the statement is executed again. USE FOR SCREEN
RECOVERY must immediately follow a section header in the Declaratives portion of
the Procedure Division. The following example illustrates this USE statement:
PROCEDURE DIVISION.
DECLARATIVES.
S-R SECTION.
USE FOR SCREEN RECOVERY.
RECOV-1.
MOVE "SCREEN RECOVERY" TO error-msg,
DISPLAY msg-1.
END DECLARATIVES.
MAIN SECTION.
If an irrecoverable terminal I/O error occurs, the TCP executes the declaratives
procedure immediately following any USE FOR TERMINAL-ERRORS statement. The
TCP executes the procedure as soon as it determines that a terminal error is
irrecoverable. It differs in this respect from the USE FOR SCREEN RECOVERY
statement that executes its declaratives procedure only after the terminal is suspended
and resumed.
If an irrecoverable terminal I/O error occurs and the program does not contain a USE
FOR TERMINAL-ERRORS statement, the program suspends.
If a program contains a USE FOR TERMINAL-ERRORS statement and an
irrecoverable terminal I/O error occurs, the TCP attempts screen recovery automatically
at the next screen operation, unless a DISPLAY RECOVERY statement is executed
successfully before the next screen operation. The next screen operation need not be in
the Declaratives section for the TCP to perform the automatic screen recovery.
The following SCREEN COBOL statements add data to the terminal buffers and thus
could cause an irrecoverable terminal I/O error:
ACCEPT DISPLAY
CLEAR INPUT RECONNECT MODEM
DISPLAY BASE RESET
DISPLAY OVERLAY SCROLL
DISPLAY RECOVERY TURN
For programs operating in conversational mode, an irrecoverable terminal I/O error can
be associated directly with one of the statements listed. For programs operating in block
mode, the error might not result directly from one of these statements.
In block mode, output data is buffered and an irrecoverable terminal I/O error occurs
only when data is actually written to or read from the terminal. A number of input or
output statements could be executed before the buffer fills or some other action forces an
actual write to the terminal. In block mode, actual terminal writes occur in the following
situations:
• When the terminal buffer is full
• Before executing an ACCEPT statement
• Before executing statements such as DELAY, SEND, or CALL
If an irrecoverable terminal I/O error occurs and you have included a USE FOR
TERMINAL-ERRORS procedure in your program, the TCP performs the following
actions:
1. Sets the TERMINATION-SUBSTATUS special register to the appropriate file-
system error code
2. Sets the PW-TERMINAL-ERROR-OCCURRED special register to 1 (otherwise, it
is set to zero)
3. Executes the declaratives procedure immediately following the USE FOR
TERMINAL-ERRORS statement
4. Resumes execution at the statement immediately following the statement during
which the I/O failure occurred
If an error occurs in the declaratives procedure itself, the TCP sets the special registers
PW-TERMINAL-ERROR-OCCURRED to 1 and TERMINATION-SUBSTATUS to the
file-system error code just as in steps 1 and 2, but resumes execution at the next
statement in the procedure itself.
The USE FOR TERMINAL-ERRORS declarative is both simple and powerful. It
allows you maximum control when a terminal I/O error occurs, but it can lead to
unexpected results. You should be careful both in how you use this procedure and for
what purpose.
Consider the following:
• In block mode, you have no way of knowing which statement caused the error.
• Pathway logging is not performed on errors handled by the USE FOR TERMINAL-
ERRORS procedure.
• If an irrecoverable terminal I/O error occurs during an ACCEPT statement, the TCP
resets TERMINATION-STATUS to zero before returning to the statement following
the ACCEPT.
• If you call another SCREEN COBOL program unit from within a USE FOR
TERMINAL-ERRORS declaratives procedure:
° The called program (and any program it calls) must not contain a USE FOR
TERMINAL-ERRORS statement; if it does, a run-time error occurs and the
program suspends.
° An irrecoverable terminal I/O error in the called program will cause the calling
program to suspend.
You should consider the nature of the error before attempting a retry within the
Declaratives section. Some errors can be retried, others cannot. To determine the nature
of the error, you can check the TERMINATION-SUBSTATUS special register for the
file-system error code.
If the declaratives procedure does not contain any executable statement, execution
resumes with the next statement following the statement that caused the error. Thus,
irrecoverable terminal I/O errors can occur with no indication that they have occurred.
One way to avoid this situation is to include at least one statement in the declaratives
procedure, possibly an EXIT PROGRAM statement.
The Declaratives procedures can be used to save current data (context). Saving current
data by using the declaratives procedures lets you resume the application with a more
completely recovered screen than is possible with, for instance, EXIT PROGRAM
WITH ERROR or CALL...ON ERROR when used outside the declaratives procedure.
The following example saves the current and last record when a terminal I/O error
occurs.
. . .
DATA DIVISION.
WORKING-STORAGE SECTION.
01 CONTEXT-INFO.
02 CURRENT-REC.
04 NAME PIC A(33).
04 ACCT-NUM.
06 ACCT-PRE PIC AA.
SCOBOLX [ / [ IN source-file ]
[ , OUT [ list-file ] ]
[ , run-option ] ... / ]
[ tclprog-file ]
[ , copy-library ]
[ ; compiler-command ] ...
Note. You must compile a source program unit using a SCOBOLX run command on the same
node where the source program unit resides. You cannot compile on one node a program unit
residing on another node.
IN source-file
is a file containing SCREEN COBOL statements and compiler commands. The
SCREEN COBOL compiler reads source-file as 132-byte records. If this
parameter is omitted, input is taken from the current input file of the command
interpreter; this is typically the home terminal.
OUT list-file
directs listing output to a named file. The file has the same form as source-
file. If list-file is an unstructured disk file, each list-file record is 132
characters (partial lines are blank filled through column 132).
If list-file is omitted and OUT is present, no listing is produced. If the entire
option is omitted, the listing output is directed to the command interpreter OUT file;
this is typically the home terminal.
run-option
is one of the following operating system command options:
NAME $process-name
specifies the symbolic process name.
CPU cpu-number
specifies the processor module.
PRI priority
specifies the execution priority.
MEM num-pages
specifies the maximum number of data pages.
NOWAIT
specifies the command interpreter does not suspend while the program runs.
SWAP $disk-volume
specifies the disk volume where the SCOBOLX and SCOBOLX2 process swap
files are created.
If you do not specify this option and you do not specify a default disk volume
for process swap files (using the Compaq Tandem Advanced Command
Language (TACL) SET SWAP command), the process swap files are created in
the same subvolume where the SCOBOLX object program file resides. System
performance might be adversely affected if the SCOBOLX object program file
resides on $SYSTEM and the process swap files are created in the same
subvolume as that of the SCOBOLX object program file.
For information about swap-file management, refer to the Kernel-Managed Swap
Facility (KMSF) Manual.
tclprog-file
is the file specification from which the compiler generates names of disk files that
contain the object program and other information. The tclprog-file has a disk
file name of the following form:
file must not exceed 5 characters. If this parameter is omitted, POBJ is used.
file specifies the root of the actual file names that the compiler generates by
appending characters as follows:
COD
specifies the code file (contains the object program).
DIR
specifies the directory to the code file.
SYM
specifies the symbols table (generated if you specify the compiler option
SYMBOLS).
The default file names are: POBJCOD, POBJDIR, and POBJSYM.
copy-library
is the name of an EDIT disk file. This file is used as the default library for source
code when expanding a COPY statement that does not include a specific library
name. copy-library has the form of a disk file name.
If this parameter is omitted, COPYLIB is used.
compiler-command
is any of the following compiler commands:
ANSI OPTION
COMPILE SHOWCOPY/NOSHOWCOPY
CROSSREF/NOCROSSREF SMAP/NOSMAP
ERRORS SYMBOLS/NOSYMBOLS
HEADING SETTOG
LINES SYNTAX
LIST/NOLIST TANDEM
MAP/NOMAP WARN/NOWARN
The following examples illustrate the command to run the SCREEN COBOL compiler:
SCOBOLX / IN MYSOURCE, OUT $S, NOWAIT / MPROG; MAP; &
CROSSREF ONLY LABELS; LIST
SCOBOLX / IN APROG /
The SCREEN COBOL compiler recognizes the SAMECPU parameter passed in the
command interpreter PARAM command. The format of the command is:
number
is any nonzero number. A 0 disables SAMECPU.
number does not designate which CPU the processes run in; that is controlled by
the CPU run option.
The command sequence to run processes in the same CPU is:
TACL 1> PARAM SAMECPU 1
TACL 2> SCOBOLX/IN ... , OUT ...
$volume
specifies a disk volume other than the current one.
If you do not specify PARAM SWAPVOL, all temporary work files for both SCOBOLX
and SCOBOLX2 are created in the same subvolume where the SCOBOLX object
program file resides, unless the current swap volume has been specified in a TACL SET
SWAP command. System performance might be adversely affected if the SCOBOLX
object program file resides on $SYSTEM and the process swap files are created in the
same subvolume as that of the SCOBOLX object program file.
Note. The SWAP option of the SCOBOLX run command does not affect where the temporary
work files for SCOBOLX and SCOBOLX2 are created, but it does affect where the Kernel
Managed Swap Facility (KMSF) creates the run-time data stack swap file to be used by the
SCOBOLX process.
For example, the command sequence to specify $MINT as the disk volume on which
temporary work files reside is:
TACL 3> PARAM SWAPVOL $MINT
?compiler-command
?
appears in the indicator field (column 1 for Tandem standard reference format and
either column 1 or 7 for ANSI standard reference format).
compiler-command
is any of the compiler commands described in this section.
The question mark is a source text format indicator and not part of the compiler
command. The compiler command entered as part of the SCREEN COBOL run
command is not preceded by a question mark.
overrides all others. Commands specified in the source text override commands
specified in the SCOBOLX run command.
ANSI Command
The ANSI command specifies that the following source text is in ANSI standard
reference format.
ANSI
Lines longer than 80 characters are truncated; shorter lines are padded with trailing
blanks. The positions following Margin R (columns 73 through 80) form the
identification field. This field, which can contain any ASCII characters, is treated as a
comment and has no effect on the meaning of a program.
COMPILE Command
The COMPILE command requests full compilation and production of an object file.
COMPILE
If this command and the SYNTAX command are omitted, COMPILE is assumed.
CROSSREF Command
The CROSSREF command causes a list of the SCREEN COBOL program identifiers to
be added to the compiled program output. The list is a cross-reference showing where
the identifiers are described, read, or written throughout the program. This command
contains a list of classes into which program identifiers are classified. Selections from
the class list determine the identifiers to be included in the cross-reference listing.
The NOCROSSREF command is the default and disables the CROSSREF command.
ONLY
requests information for just the classes specified.
INCLUDE
adds a class of identifiers to an existing class list.
EXCLUDE
deletes a class of identifiers from an existing class list.
class
is one of the following SCREEN COBOL identifiers:
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
7 -8
Compilation CROSSREF Command
CONDITIONS
Items tested in the program that have condition names
DATANAMES
VARIABLES
Data items defined in the Working-Storage Section
LABELS
PROCNAMES
Paragraph names and section names
LITERALS
Numeric and nonnumeric literals
MNEMONICS
Mnemonic names associated with display attributes
PROGRAMS
Program unit names for called programs
SCREEN
Screen groups or fields described in the Screen Section
UNREFS
Items defined in the program, but never referred to
Specifying CROSSREF with no options or classes produces a list of the following
program identifiers:
CONDITIONS
DATANAMES or VARIABLES
LABELS or PROCNAMES
MNEMONICS
PROGRAMS
SCREENS
If the NOLIST or SYNTAX commands are specified in the SCREEN COBOL source
program or at compile time, no cross-reference listing is produced. For a complete
description of CROSSREF, refer to the CROSSREF Manual.
ENDIF Command
The ENDIF command terminates the effect of a preceding IF or IFNOT command.
ENDIF toggle-number
toggle-number
is the toggle-number specified in the IF or IFNOT command.
ERRORS Command
The ERRORS command sets the maximum number of errors allowed during
compilation.
ERRORS nnnnn
nnnnn
is an integer from 0 through 32,767.
If this command is omitted, the default limit is 100 errors.
If the limit set by the ERROR command is exceeded, the compilation terminates.
HEADING Command
The HEADING command replaces or sets to blanks the heading portion of the standard
top-of-page line that appears on each page of the compilation listing.
HEADING [ "character-string" ]
"character-string"
is a string of any ASCII characters enclosed in quotation marks. At least one
character must appear. If a quotation mark is part of the string, it must be
represented as two contiguous quotation marks. The character string is used in all
subsequent top-of-page lines.
If the character-string option is omitted, the heading portion of these lines is
set to all blanks.
IF Command
The IF command causes the compiler to ignore subsequent source text unless the
specified toggle is turned on with a SETTOG command.
IF toggle-number
toggle-number
is an integer from 1 through 15.
COPY statements are not affected by this command; these statements are still processed
and expanded.
The following example illustrates the IF command:
?RESETTOG 1, 2
.
.
.
?IF 2
.
.
.
text
.
.
.
?ENDIF 2
The source text bounded by the IF 2 and ENDIF 2 commands is ignored.
IFNOT Command
The IFNOT command causes the compiler to ignore subsequent source text unless the
specified toggle is turned off either with the RESETTOG command or by default (never
set).
IFNOT toggle-number
toggle-number
is an integer from 1 through 15.
COPY statements are not affected by this command; these statements are still processed
and expanded.
The following example illustrates the IFNOT command:
?RESETTOG 1, 2
.
.
.
?IFNOT 1
.
.
.
text
.
.
.
?ENDIF 1
The source text bounded by the IFNOT 1 and ENDIF 1 commands will be compiled.
LINES Command
The LINES command sets the number of lines listed on each page. Whenever the next
line to be listed would overflow the line count, a page is ejected and the standard page
heading and two blank lines are listed at the top of the next page, followed by the
pending line.
LINES nnnnn
nnnnn
is an integer from 10 through 32,767.
The line limit is ignored if paging does not apply to the compilation list device.
If this command is omitted, LINES 60 is assumed.
LIST Command
The LIST command transmits each source image to the compilation list device. The
NOLIST command disables the LIST option.
{ LIST }
{ NOLIST }
MAP Command
The MAP command lists a table of user-defined symbols following the listing of the
program or subprogram source text. The NOMAP command disables the MAP option.
{ MAP }
{ NOMAP }
The MAP command is not effective unless LIST is enabled. The MAP command does
not produce a statement offset list if the SYNTAX option is specified.
OPTION Command
The OPTION command controls the source text input format, the source listing options,
the title field of the page header, and compilation options.
command-option
is any of the following commands:
ANSI NOSMAP
COMPILE NOSYMBOLS
ERRORS NOWARN
HEADING OPTION
LINES SHOWCOPY
LIST SMAP
MAP SYMBOLS
NOLIST SYNTAX
NOMAP TANDEM
NOSHOWCOPY WARN
A single OPTION command can contain any combination of the available options, in
any order. An option takes effect at the beginning of the next source text line. If a
command contains two or more conflicting options, the last option specified overrides
all the others. For example, the following commands are equivalent:
OPTION LIST, ERRORS 20, LIST, NOLIST
OPTION ERRORS 20, NOLIST
The OPTION command can cause confusion over the uses of commas and semicolons
as separators in the SCOBOLX run command. The same compiler commands can
appear as follows:
• Listed as a command option in the OPTION command with the comma as the
separator
• Specified as a compiler command with the semicolon as the separator
For example, the following commands are equivalent:
SCOBOLX / in infile / mprog; OPTION ERROR 20, NOLIST;
SCOBOLX / IN INFILE / mprog; ERROR 20; NOLIST
The keyword OPTION is not required. The following examples show the items ERROR
20 and NOLIST listed in an OPTION command where OPTION is assumed. The
examples show a run command and a source text entry.
SCOBOLX / IN INFILE / ; ERROR 20, NOLIST; CROSSREF
RESETTOG Command
The RESETTOG command turns off all specified toggles.
toggle-number
is an integer from 1 through 15.
If the toggle-number option is omitted, all toggles are turned off.
SECTION Command
The SECTION command is used to identify individual texts in a SCREEN COBOL
source library accessed by a COPY statement. The command is ignored if it appears in
the text of the compilation source file.
text-name
is a SCREEN COBOL word (1 to 30 letters, digits, and hyphens, but not all digits).
The compiler assumes that the format of the library text is the same as the current source
text format. Although this default format can be overridden by entering a compiler
command as the first line following the SECTION command, the ANSI or TANDEM
command is usually more convenient for this purpose.
The following reserved words cannot be used in a SECTION command:
ANSI LABELS
CHECK LITERALS
COMPILE MESSAGES
CONDITIONS ONLY
DEBUG1 OPTION
DEBUG2 PROGRAMS
ENDIF SCREENS
ERRORS SYNTAX
EXCLUDE TRACE
INCLUDE VARIABLES
SETTOG Command
The SETTOG command turns on all specified toggles.
toggle-number
is an integer from 1 through 15.
SHOWCOPY Command
The SHOWCOPY command specifies listing the COPY statement as a comment line in
the list file before the copied statements. The NOSHOWCOPY disables SHOWCOPY.
{ SHOWCOPY }
{ NOSHOWCOPY }
SMAP Command
The SMAP command creates a descriptor map following the listing of the program or
subprogram source text. The map produced by the SMAP command is more compact
and contains more information than that produced by the MAP command. If both MAP
and SMAP are specified, only SMAP is effective.
{ SMAP }
{ NOSMAP }
SYMBOLS Command
The SYMBOLS command causes a symbol table file to be built for the SCREEN
COBOL program. This file is used by INSPECT to examine and debug programs. The
NOSYMBOLS command disables the SYMBOLS command so that the compiler does
not build a symbol table file.
{ SYMBOLS }
{ NOSYMBOLS }
SYNTAX Command
The SYNTAX command requests a syntax check of the source text only. No object file
is produced.
SYNTAX
If this command and the COMPILE command are omitted, COMPILE is assumed.
If this command is specified with the CROSSREF command, no cross-reference listing
is produced.
If the SYNTAX option is specified, the MAP and SMAP commands do not produce
statement offset lists.
TANDEM Command
The TANDEM command specifies that the following source text is in Tandem standard
reference format.
TANDEM
WARN Command
The WARN command allows minor error conditions to be reported in the source text.
The NOWARN command disables the WARN option.
{ WARN }
{ NOWARN }
Compilation Statistics
Statistics are printed at the end of every compilation. For example:
PROGRAM NAME IS
the name of the program (this line is printed only if no errors occurred).
PROGRAM VERSION IS
the version number of the program (this line is printed only if no errors occurred).
NO. ERRORS =
the total number of error messages issued.
NO. WARNING =
the total number of warning messages issued.
CODE SIZE =
the total number of bytes used for all Procedure Division code in the object file.
DATA SIZE =
the total number of bytes of user-allocated working storage, plus compiler-allocated
working storage.
ELAPSED TIME -
wall-clock elapsed time for the compilation.
• If a configured terminal has a command interpreter, the terminal operator must type
PAUSE to activate the SCREEN COBOL application on the terminal.
The sample SCREEN COBOL requester program for terminals operating in block mode
describes a base screen only that appears as shown in the following example. The
program accepts operator input that consists of a name and address until an appropriate
function key is pressed.
NAME : ______________________________
ADDR : ____________________
REPLY -
• If the operator types the name SMITH and presses the F2 key to enter data, the
server returns a reply code of 999 and an error code of 1; this causes the message
SMITH IS ALREADY ON FILE to be displayed in the advisory field of the
terminal.
• If the operator types the name JONES and presses the F2 key to enter data, the
server returns a reply code of 999 and an error code of 2; this causes the message
JONES IS ALREADY ON FILE to be displayed in the advisory field of the
terminal.
• If the operator types any other name and presses the F2 key to enter data, the server
returns a reply code of 0 and writes the record; this causes the entered record to be
displayed on the terminal screen.
The sample SCREEN COBOL requester program for terminals operating in
conversational mode describes a base screen only and illustrates the SCREEN COBOL
characteristics for conversational mode programs. The program displays a screen
header, prompts the operator, accepts operator input that consists of a name and an
address. The program also contains a function selection and responds to the input
control characters named in the program, but no server response is provided.
(1) These lines give the program name that is specified in the SET TERM INITIAL
command. This program is used when a terminal is first started.
(2) These lines illustrate a sample header for the transaction messages.
(3) These lines are not required.
(4) These lines show the reply code that is required by Pathway. The item must be
defined as COMPUTATIONAL.
(5) These lines show that two reply messages are used to limit the amount of data
sent between the server and the SCREEN COBOL program. When only an error
code is returned from the server, ERROR-REPLY is used. When data is
returned, ENTRY-REPLY is used.
SCREEN SECTION.
01 EXAMPLE-SCREEN BASE SIZE 24, 80.
03 FILLER AT 1, 20 VALUE "EXAMPLE SCREEN COBOL PROGRAM".(1)
03 FILLER AT 3, 1 VALUE "DEPARTMENT :". (2)
03 DEPT-HEADER AT 3, 14 PIC X(3) FROM DEPT-HEADER OF WS. (3)
03 FILLER AT 3, * + 10 VALUE "PASSWORD :". (4)
03 PASSWORD AT 3, * + 2 PIC X(3) LENGTH 1 THRU 3, HIDDEN, (5)
UPSHIFT INPUT, MUST BE "AAA", "X", TO PASSWORD OF WS. (5)
03 DATA-IN.
05 FILLER AT 5, 1 VALUE "NAME :".
05 NAME-IN AT 5, 8 PIC A(30) LENGTH 1 THRU 30 (6)
TO NAME-IN OF ENTRY-MSG, FILL "_". (6)
05 FILLER AT 6, 1 VALUE "ADDR :".
05 ADDR-IN AT 6, 8 PIC X(20) LENGTH 1 THRU 20
TO ADDR-IN OF ENTRY-MSG, FILL "_".
05 DATE-GRP AT 8, 1.
07 FILLER AT @, 1 VALUE "MONTH :". (7)
07 MONTH-IN AT @, * + 2 PIC A(10) LENGTH 1 THRU 10
MUST BE "JANUARY", "FEBRUARY" USING MONTH-IN OF
ENTRY-MSG, UPSHIFT INPUT, VALUE "FEBRUARY".
07 FILLER AT @, * + 4 VALUE "DAY :".
07 DAY-IN AT @, * + 2 PIC Z9 LENGTH 1 THRU 2, VALUE "15"
MUST BE 1 THRU 31, USING DAY-IN OF ENTRY-MSG.
07 FILLER AT @, * + 4 VALUE "YEAR :".
07 YEAR-IN AT @, * + 2 PIC Z9 MUST BE 79, 82, 85 THRU 88
USING YEAR-IN OF ENTRY-MSG, VALUE "85".
03 FILLER AT 10, 1 VALUE "REPLY -".
03 SERVER-RECORD AT 10, * + 2 PIC X(64)
FROM SERVER-RECORD OF ENTRY-REPLY.
03 FILLER AT 18, 1 VALUE
"F1 - ENTER PASSWORD F5 - BLINK REPLY".
03 FILLER AT 19, 1 VALUE
"F2 - ENTER DATA F6 - RESET ATTR REPLY".
03 FILLER AT 20, 1 VALUE
"F3 - CLEAR INPUT F7 - RESET DATA REPLY".
03 FILLER AT 21, 1 VALUE
"F4 - RESET DATA SCREEN F16 - EXIT PROGRAM".
03 ERROR-MSG AT 24, 2 PIC X(76) ADVISORY (8)
FROM ERROR-MSG OF WS. (8)
(1) The literal is displayed on the screen starting at line 1, column 20.
(2) The literal is displayed on the screen starting at line 3, column 1.
(3) If a data name is used in a screen section, a PIC clause must be associated with
that data name. The FROM (data association clause) specifies an output
association. Data is moved from DEPT-HEADER OF WS to this position on the
screen.
(4) The asterisk means relative to the current position; therefore, the literal
PASSWORD is displayed on the screen at line 3, column 26 (16 + 10).
(5) The data entered for PASSWORD is hidden from the operator as it is entered.
The password is upshifted and tested for the correct value. If the password is
correct, the password is moved to the data name PASSWORD of working
storage.
(6) The operator must type in from 1 to 30 alphabetic characters that are moved to
ENTRY-MSG. A fill character of underscore is present on the screen in these 30
positions.
(7) The at sign (@) indicates the position is relative to the home position of the
group. This literal is displayed on line 8, column 1.
(8) These lines identify the field to be used for information and error messages
generated by the TCP. The programmer also can use this field.
PROCEDURE DIVISION.
A-MAIN.
DISPLAY BASE EXAMPLE-SCREEN (1)
MOVE "MKT" TO DEPT-HEADER OF WS.
DISPLAY DEPT-HEADER OF EXAMPLE-SCREEN (2)
ACCEPT PASSWORD OF EXAMPLE-SCREEN UNTIL F1-KEY (3)
PERFORM CASE-MANAGER UNTIL EXIT-PROGRAM.
A-EXIT.
EXIT PROGRAM.
CASE-MANAGER.
ACCEPT DATA-IN OF EXAMPLE-SCREEN UNTIL F2-KEY (4)
ESCAPE ON F3-KEY F4-KEY F5-KEY F6-KEY F7-KEY F16-KEY (4)
PERFORM ONE OF
DATA-ENTERED, CLEAR-INPUT, RESET-DATA, BLINK-REPLY
RESET-ATTR-REPLY, RESET-DATA-REPLY, SET-EXIT
DEPENDING ON TERMINATION-STATUS (5)
DATA-ENTERED.
MOVE SPACES TO PW-HEADER OF ENTRY-MSG.
PERFORM SEND-DATA.
CLEAR-INPUT.
CLEAR INPUT (6)
RESET-DATA.
RESET DATA EXAMPLE-SCREEN (7)
BLINK-REPLY.
TURN ATTENTION IN SERVER-RECORD OF EXAMPLE-SCREEN (8)
RESET-ATTR-REPLY.
RESET ATTR SERVER-RECORD OF EXAMPLE-SCREEN (9)
RESET-DATA-REPLY.
RESET DATA SERVER-RECORD OF EXAMPLE-SCREEN (10)
SET-EXIT.
MOVE 1 TO EXIT-FLAG.
SEND-DATA.
SEND ENTRY-MSG TO "EXAMPLE-SERVER" (11)
REPLY CODE 0 YIELDS ENTRY-REPLY
CODE 999 YIELDS ERROR-REPLY.
IF TERMINATION-STATUS = 2 AND ERROR-CODE = 1
MOVE "SMITH IS ALREADY ON FILE" TO ERROR-MSG OF WS
PERFORM 901-DISPLAY-ADVISORY
ELSE IF TERMINATION-STATUS = 2 AND ERROR-CODE = 2
MOVE "JONES IS ALREADY ON FILE" TO ERROR-MSG OF WS
PERFORM 901-DISPLAY-ADVISORY
ELSE
DISPLAY SERVER-RECORD OF EXAMPLE-SCREEN (12)
901-DISPLAY-ADVISORY.
DISPLAY TEMP ERROR-MSG OF EXAMPLE-SCREEN (13)
TURN TEMP ATTENTION IN ERROR-MSG OF EXAMPLE-SCREEN. (14)
(1) This line displays the screen and the initial values, FILL characters, and default
values.
(2) The value of DEPT-HEADER is moved to the screen at line 3, column 14.
(3) When the F1 key is pressed, the field is tested for validity. Data can be typed
into any other field on the screen, but only the PASSWORD field is used.
(4) The UNTIL F2-KEY expects data to be entered before the F2 key is pressed
and validity checks are performed. The ESCAPE series of function keys causes
the statement to terminate without data being entered.
(5) The key that was pressed to terminate the ACCEPT statement has a positional
value associated with it from the ACCEPT statement; the key is put into
TERMINATION-STATUS.
(6) All unprotected fields are cleared.
(7) This line resets the fields to the initial values and FILL characters declared.
(8) This line causes SERVER-RECORD to blink by setting the BLINK attribute.
(9) This line stops the blinking of SERVER-RECORD by resetting the attribute to
normal.
(10) This line resets the portion of SERVER-RECORD to its original value (blank
line).
(11) This line specifies the server class to be used. This can be a data name in
working storage.
(12) The fields that comprise SERVER-RECORD are displayed.
(13) This line displays ERROR-MSG on the screen as temporary data.
(14) This line sets the BLINK attribute as a temporary attribute and makes the value
of ERROR-MSG blink.
(1) These lines give the program name that you use in the SET TERM INITIAL
command.
(2) This line specifies a conversational mode terminal type and identifies the
terminal type that you use in the SET PROGRAM TYPE and SET TERM TYPE
commands.
SCREEN SECTION.
01 EMPLOYEE-REC-SCREEN BASE SIZE 24, 80
* FIELD-SEPARATOR "," (1)
* GROUP-SEPARATOR ";" (1)
ABORT-INPUT "AI" (2)
END-OF-INPUT 47 (2)
* The keyboard character for END-OF-INPUT is "/" (1)
RESTART-INPUT 58, 58.
* The keyboard characters for RESTART-INPUT is "::" (1)
05 TITLE AT 1, 3 VALUE "PERSONNEL SYSTEM EXAMPLE".
05 NAME-PROMPT AT 2, 1 VALUE "LAST NAME: ".
05 LAST-NAME-FLD AT 3, 1 PIC X(10)
USING EMP-LAST-NAME
LENGTH 1 THRU 10
PROMPT NAME-PROMPT. (3)
05 FIRST-NAME-PROMPT AT 2, 12 VALUE "FIRST NAME: ".
05 FIRST-NAME-FLD AT 3, 12 PIC X(10)
USING EMP-FIRST-NAME
LENGTH 1 THRU 10
PROMPT FIRST-NAME-PROMPT.
05 MI-PROMPT AT 2, 24 VALUE "MI: ".
05 MIDDLE-INIT-FLD AT 3, 24 PIC X(2)
USING EMP-MIDDLE-INIT
PROMPT MI-PROMPT.
05 ADDR-PROMPT AT 4, 1 VALUE "ADDRESS: ".
05 ADDR-FLD AT 4, 11 PIC X(30)
USING EMP-ADDR
PROMPT ADDR-PROMPT.
05 CITY-PROMPT AT 5, 1 VALUE "CITY: ".
05 CITY-FLD AT 5, 11 PIC X(10)
USING EMP-CITY
PROMPT CITY-PROMPT.
05 STATE-PROMPT AT 5, 22 VALUE "STATE: ".
05 STATE-FLD AT 5, 30 PIC X(10)
USING EMP-STATE
PROMPT STATE-PROMPT.
05 ZIP-PROMPT AT 5, 45 VALUE "ZIP: ".
05 ZIP-FLD AT 5, 51 PIC Z(5)
USING EMP-ZIP
PROMPT ZIP-PROMPT.
05 TYPEAHEAD-MSG AT 10, 1 VALUE "TO GET TYPEAHEAD, ENTER (4)
- " LAST NAME, FIRST NAME, MIDDLE INITIAL." (4)
05 PROMPT-AREA AREA AT 23, 1 SIZE 1, 80.
05 ADVISORY-FLD AT 24, 1 PIC X(70)
ADVISORY FROM WS-ADVISORY.
(1) These lines are instructive comments about the input control characters. They
are not required by SCREEN COBOL.
(2) These lines redefine the terminal input characters you use for control during an
ACCEPT statement.
(3) This is the first PROMPT clause for the screen. The value of this clause will be
displayed indicating the terminal is ready to accept data for this field.
(4) These lines identify the typeahead message that is included in the heading
displayed at the beginning of the screen.
PROCEDURE DIVISION.
BEGIN-PROGRAM.
DISPLAY BASE EMPLOYEE-REC-SCREEN.
DISPLAY TITLE, TYPEAHEAD-MSG.
PERFORM LOOP UNTIL EXIT-PROGRAM.
EXIT-PROG.
EXIT PROGRAM.
LOOP.
ACCEPT EMPLOYEE-REC-SCREEN
UNTIL INPUT
ESCAPE ON ABORT.
IF TERMINATION-STATUS = 1
PERFORM FUNCTION-DISPLAY
PERFORM INIT-EMPLOYEE-REC
ELSE
PERFORM EXIT-IT.
FUNCTION-DISPLAY.
DISPLAY OVERLAY EMPLOYEE-REC-PROMPT AT PROMPT-AREA.
MOVE 2 TO EXIT-FLAG.
PERFORM OPERATION UNTIL NOT INVALID-RESPONSE.
OPERATION.
ACCEPT EMPLOYEE-REC-PROMPT
UNTIL INPUT
ESCAPE ON ABORT.
IF TERMINATION-STATUS = 1
PERFORM FUNCTION-SELECTION
ELSE
PERFORM EXIT-IT.
FUNCTION-SELECTION.
MOVE ZERO TO EXIT-FLAG.
IF WS-SEARCH-REQUEST
PERFORM SEARCH-IT
ELSE
IF WS-ADD-REQUEST
PERFORM ADD-IT
ELSE
IF WS-DELETE-REQUEST
PERFORM DELETE-IT
ELSE
IF WS-SHOW-REQUEST
PERFORM SHOW-IT
ELSE
IF WS-EXIT-REQUEST
PERFORM EXIT-IT
ELSE
PERFORM INVALID-FUNCTION.
SEARCH-IT.
MOVE 1 TO MESSAGE-ID.
SEND MESSAGE-ID, EMPLOYEE-REC TO "USER-SERVER"
REPLY CODE 1 YIELDS R-CODE, EMPLOYEE-REC
CODE 2 YIELDS R-CODE
ON ERROR MOVE 999 TO R-CODE.
IF NOT SEND-ERROR
PERFORM ONE OF DISPLAY-EMPLOYEE-REC, EMPLOYEE-NOT-FOUND
DEPENDING ON R-CODE
ELSE
PERFORM SEND-ERROR-NOTICE.
ADD-IT.
MOVE 2 TO MESSAGE-ID.
SEND MESSAGE-ID, EMPLOYEE-REC TO "USER-SERVER"
REPLY CODE 1, 3 YIELDS R-CODE
ON ERROR MOVE 999 TO R-CODE.
IF NOT SEND-ERROR
PERFORM ONE OF EMPLOYEE-ADDED, EMPLOYEE-ALREADY-EXISTS
DEPENDING ON R-CODE
ELSE
PERFORM SEND-ERROR-NOTICE.
DELETE-IT.
MOVE 3 TO MESSAGE-ID.
SEND MESSAGE-ID, EMPLOYEE-REC TO "USER-SERVER"
REPLY CODE 1, 2 YIELDS R-CODE
ON ERROR MOVE 999 TO R-CODE.
IF NOT SEND-ERROR
PERFORM ONE OF EMPLOYEE-DELETED, EMPLOYEE-NOT-FOUND
DEPENDING ON R-CODE
ELSE
PERFORM SEND-ERROR-NOTICE.
SHOW-IT.
MOVE 4 TO MESSAGE-ID.
SEND MESSAGE-ID, EMPLOYEE-REC TO "USER-SERVER"
REPLY CODE 1, 2 YIELDS R-CODE
ON ERROR MOVE 999 TO R-CODE.
IF NOT SEND-ERROR
PERFORM ONE OF DISPLAY-EMPLOYEE-REC, EMPLOYEE-NOT-FOUND
DEPENDING ON R-CODE
ELSE
PERFORM SEND-ERROR-NOTICE.
EXIT-IT.
MOVE 1 TO EXIT-FLAG.
DISPLAY-EMPLOYEE-REC.
DISPLAY EMPLOYEE-REC-SCREEN.
EMPLOYEE-NOT-FOUND.
MOVE "EMPLOYEE DOES NOT EXIST" TO WS-ADVISORY.
DISPLAY ADVISORY-FLD.
EMPLOYEE-ADDED.
MOVE "EMPLOYEE ADDED" TO WS-ADVISORY.
DISPLAY ADVISORY-FLD.
EMPLOYEE-ALREADY-EXISTS.
MOVE "EMPLOYEE ALREADY EXISTS" TO WS-ADVISORY.
DISPLAY ADVISORY-FLD.
EMPLOYEE-DELETED.
MOVE "EMPLOYEE DELETED" TO WS-ADVISORY.
DISPLAY ADVISORY-FLD.
INIT-EMPLOYEE-REC.
MOVE SPACES TO EMPLOYEE-REC.
MOVE ZEROES TO EMP-ZIP.
INVALID-FUNCTION.
MOVE 2 TO EXIT-FLAG.
MOVE "INVALID FUNCTION REQUESTED" TO WS-ADVISORY.
DISPLAY ADVISORY-FLD.
SEND-ERROR-NOTICE.
MOVE "ERROR ACCESSING PERSONNEL SYSTEM" TO WS-ADVISORY.
DISPLAY ADVISORY-FLD.
01 ERROR-REPLY.
02 REPLY-CODE PIC S9(4) COMP.
02 FILLER PIC X(22).
02 ERROR-CODE PIC S999 COMP.
WORKING-STORAGE SECTION.
01 RECEIVE-FILE-STATUS.
02 STAT-1 PIC 9.
88 CLOSE-FROM-REQUESTOR VALUE 1.
02 STAT-2 PIC 9.
PROCEDURE DIVISION.
BEGIN-COBOL-SERVER.
OPEN INPUT MESSAGE-IN.
OPEN OUTPUT MESSAGE-OUT SYNCDEPTH 1.
PERFORM B-TRANS UNTIL CLOSE-FROM-REQUESTOR.
STOP RUN.
B-TRANS.
MOVE SPACES TO ENTRY-REPLY, ENTRY-MSG.
READ MESSAGE-IN, AT END STOP RUN.
MOVE PW-HEADER OF MESSAGE-IN TO PW-HEADER OF MESSAGE-OUT.
IF NAME-IN = "SMITH"
MOVE 999 TO REPLY-CODE OF ERROR-REPLY
MOVE 1 TO ERROR-CODE
WRITE ERROR-REPLY
ELSE IF NAME-IN = "JONES"
MOVE 999 TO REPLY-CODE OF ERROR-REPLY
MOVE 2 TO ERROR-CODE
WRITE ERROR-REPLY
ELSE
MOVE 0 TO REPLY-CODE OF ENTRY-REPLY
MOVE ENTRY-GROUP TO SERVER-RECORD
WRITE ENTRY-REPLY.
1
REQUIRED FIELD MISSING
2
PREVIOUS FIELD MISSING
3
EARLIER FIELD MISSING
Cause. For an occurring field with a DEPENDING clause, a different occurring field
depending on the same item was required but absent for this occurrence number, and
this field’s occurrence is present.
4
FIELD TOO SHORT
Cause. The length of the field data, after stripping of fill characters and spaces, is
shorter than allowed.
5
FIELD NOT CORRECT LENGTH
6
FIELD TOO LONG
Cause. The input is too long. Generally, this occurs only when the terminal’s
formatting has been corrupted.
7
WRONG FORMAT
Cause. Input to an alphanumeric item does not obey the PICTURE clause.
8
WRONG FORMAT: DIGIT EXPECTED
Cause. Input to an alphanumeric item does not have a digit where a 9 symbol appeared
in the PICTURE clause.
9
WRONG FORMAT: LETTER EXPECTED
Cause. Input to an alphanumeric item does not have a letter or space where an A
appeared in the PICTURE clause.
10
INVALID NUMBER FORMAT
Cause. Input to a numeric item does not obey the PICTURE clause.
11
VALUE WRONG
Cause. The numeric value input is larger than allowed by the constraints imposed by
the field and the receiving data item.
12
VALUE INCORRECT
13
MESSAGE:
14
DEP OCCUR FLD ERR-INPUT RESTARTED
15
ABORT NOT ALLOWED
Cause. The ESCAPE ON ABORT phrase is not present; therefore, the abort-input
control character is not effective. ACCEPT processing continues from where the
control character is entered.
This advisory message is displayed only for terminals operating in conversational mode.
17
WRONG FORMAT: DBCS EXPECTED
Cause. The operator entered single-byte (alphanumeric) data into a screen field that
requires double-byte data.
18
WRONG FORMAT: KATAKANA NOT ALLOWED
Cause. Katakana data was entered on a device that has not been configured for
Katakana support.
19
WRONG FORMAT: INVALID ASIAN CHARACTERS
Cause. Translation routines were unable to process the input character stream.
If you are converting existing alternate advisory message routines to pTAL for use with a D40
or later version of Pathway/iTS, refer to the pTAL Conversion Guide and the pTAL Reference
Manual for further information. Many advisory message routines are simple enough that no
changes will be needed.
error-message numbers are to be used (through the use of user conversion procedures),
the numbers should be larger than 100 to avoid conflict with future Pathway error
numbers.
The BUF parameter is a string buffer where the text associated with MSGNUM should
be placed. The text cannot be longer than 255 characters.
The MESSLEN parameter should be set to the length of the text returned.
After revising the standard advisory message procedure or coding a new one, compiling
the procedure with the pTAL compiler, and removing all compilation errors, build the
user library by using the following command:
advisory-msg-object
is the pTAL object file.
$volume
is the volume where the installation subvolume ZPATHWAY resides.
native-user-library
is the native user library object file used by the TCP.
Example A-1 provides a sample of the source listing for the standard
ADVISORY^MESSAGE procedures. This listing can be modified and used for foreign-
language versions.
PRINTER BUSY
Cause. The print device that is the target of a PRINT SCREEN statement is currently in
use.
Cause. The printer device that is the target of a PRINT SCREEN statement needs to be
placed in the READY state.
Cause. The terminal stopped because the highest level program unit was exited.
Cause. The terminal was stopped or aborted by command from the system operator.
Cause. The terminal was suspended by command from the system operator.
Cause. The terminal was suspended because an error occurred during program
execution.
Cause. The terminal was suspended without possibility of restart because an error
occurred during program execution.
END;!DIAGNOSTIC^MESSAGE!
All messages carry a number, are preceded by the word FAILURE, WARNING, or
ERROR, and are surrounded by asterisks. For example:
** FAILURE nnn **
** WARNING nnn **
** ERROR nnn **
0
TOO MANY ERRORS
Type. Failure
Cause. The number of error diagnostics exceeds the limit specified. The default limit is
100.
1
UNABLE TO INVOKE COMPILER PROCESS
Type. Failure
Cause. The compiler is unable to invoke one of its processes. The error code returned
by the NEWPROCESS procedure (bits 0 through 7) is appended to the message.
2
UNABLE TO OPEN $RECEIVE
Type. Failure
Cause. The compiler is unable to open the job communication file. The error code
returned by the operating system is appended to the message.
3
UNABLE TO OPEN COMMUNICATION FILE
Type. Failure
Cause. The compiler is unable to open the interprocess communication file. The error
code returned by the operating system is appended to the message.
4
UNABLE TO OPEN (SOURCE/LIST) FILE
Type. Failure
Cause. The compiler is unable to open the specified file. The error code returned by
the operating system is appended to the message.
5
UNABLE TO USE (SOURCE/LIST) FILE
Type. Failure
Cause. The message applies to one of the following conditions:
• The source file does not have read capability, or the list file does not have write
capability.
• Access to the source file (an EDIT file) failed. The error code returned from the
attempt to access the file is appended to the message.
• The record length of the list file is less than 40 bytes, or the list device is a printer or
process and the initial control operation failed.
6
UNABLE TO CREATE WORK FILE
Type. Failure
Cause. The compiler is unable to create one of its work files. The error code returned
by the operating system is appended to the message.
7
UNABLE TO OPEN WORK FILE
Type. Failure
Cause. The compiler is unable to open one of its work files. The error code returned by
the operating system is appended to the message.
8
UNABLE TO OPEN COPY FILE
Type. Failure
Cause. The compiler is unable to open a COPY library file. The error code returned by
the operating system is appended to the message.
9
UNABLE TO USE COPY FILE
Type. Failure
Cause. The message applies to one of the following conditions:
• The default COPY library file name is not a legal file name.
• The COPY library file is not an EDIT file or has been modified since the start of this
compilation.
• An attempt to access the COPY library failed. The error code returned from the
attempt to access the file is appended to the message.
10
COMPILER COMMUNICATION LOST
Type. Failure
Cause. Communication between compiler processes failed. The error code returned by
the operating system is appended to the message. If the code is 0, one of the compiler
processes has abended.
11
(SOURCE/LIST) FILE (READ/WRITE) FAILURE
Type. Failure
Cause. The compiler is unable to access the specified file. The error code returned by
the operating system is appended to the message.
12
SOURCE FILE EDITREAD FAILURE
Type. Failure
Cause. A read issued to the source file failed. The error code returned from the attempt
to access the file is appended to the message.
13
COPY FILE EDITREAD FAILURE
Type. Failure
Cause. A read issued to the COPY library file failed. The error code returned from the
attempt to access the file is appended to the message.
14
UNABLE TO CREATE RUN UNIT FILE
Type. Failure
Cause. The compiler is unable to create the object file. The error code returned by the
operating system is appended to the message.
15
UNABLE TO OPEN RUN UNIT FILE
Type. Failure
Cause. The compiler is unable to open the object file. The error code returned by the
operating system is appended to the message.
16
FAILURE IN USING OR ALLOCATING EXTENDED SEGMENT
Type. Failure
Cause. The compiler cannot allocate an extended segment because of insufficient
memory or disk space.
17
COMPILER LOGIC ERROR
Type. Failure
Cause. Internal consistency checking has discovered an error in the compiler logic.
Report this failure to your service provider.
18
DICTIONARY OVERFLOW
Type. Failure
Cause. Compiler dictionary space is insufficient for the number of items defined in the
current program unit. The deficiency might be corrected by invoking the SCREEN
COBOL compiler with a larger value for the MEM parameter. If the failure persists
when MEM 64 is used, the program must be subdivided into smaller program units.
19
FILE ERROR ON WORK FILE
Type. Failure
Cause. An operation on a compiler work file failed. The error code returned by the
operating system is appended to the message.
20
RUN UNIT OVERFLOW
Type. Failure
Cause. The union of the code space and data descriptor area has overflowed. The user
data space which is in Working-Storage is not monitored by the compiler.
21
CONTROL DATA SPACE OVERFLOW
Type. Failure
Cause. For each program unit, the SCREEN COBOL compiler allocates an auxiliary
data space used for control purposes. The cumulative requirements for these control
data spaces exceed the maximum available to SCREEN COBOL.
22
PROGRAM CODE SPACE OVERFLOW
Type. Failure
Cause. Either the code requirements for a single program unit or the cumulative
requirements for the entire object file exceed the maximum code space available to
SCREEN COBOL.
23
FILE ERROR ON RUN UNIT FILE
Type. Failure
Cause. An operation on the object file failed. The error code returned by the operating
system is appended to the message.
25
INTERPROCESS MESSAGE OVERFLOW
Type. Failure
Cause. The length of the source line exceeds the input buffer size.
26
MISSING QUOTE CHARACTER
Type. Error
Cause. The terminating quotation mark is missing from a nonnumeric literal.
27
NULL LITERAL
Type. Error
Cause. A nonnumeric literal contains no characters (that is, has no value).
28
LITERAL EXCEEDS 120 CHARACTERS
Type. Error
Cause. A nonnumeric literal contains more than 120 characters.
29
LITERAL EXCEEDS 18 DIGITS
Type. Error
Cause. A numeric literal contains more than 18 digits.
30
WORD EXCEEDS 30 CHARACTERS
Type. Error
Cause. A SCREEN COBOL word contains more than 30 characters.
31
NOT SUPPORTED
Type. Warning
Cause. SCREEN COBOL does not support some of the optional elements of the ANSI
COBOL language. The message probably refers to one of the following language
elements, which are not normally critical to correct program execution:
• The Rerun facility
• File labels—SCREEN COBOL does not have file-handling capability
• More than one system name appears in an ASSIGN clause (NO ASSIGN)
31
NOT SUPPORTED
Type. Error
Cause. A SCREEN COBOL does not support some of the optional elements of the
ANSI COBOL language.
32
ILLEGAL CONTEXT FOR RESERVED WORD
Type. Warning
Cause. A SCREEN COBOL reserved word is used as the text name or library name in
a COPY statement.
32
ILLEGAL CONTEXT FOR RESERVED WORD
Type. Error
Cause. The indicated SCREEN COBOL reserved word cannot appear in this context.
The cause for this message might be an attempt to define one of the reserved words as a
user-defined name.
33
ILLEGAL CHARACTER
Type. Error
Cause. The character indicated is not permitted in this context. Since the character
might be unprintable, the internal value of the character is listed with the message.
34
TOKEN EXCEEDS 120 CHARACTERS
Type. Error
Cause. An entry considered to be a character string contains more than 120 characters.
If the character string is actually several adjacent language elements, you can correct the
problem by inserting blanks to separate the elements.
35
BLANK CONTINUATION LINE
Type. Warning
Cause. A source line marked as a continuation line contains only blanks.
36
ILLEGAL INDICATOR CHARACTER
Type. Warning
Cause. The message applies to one of the following conditions:
• The character in the indicator field of a source line is not - * / ? (hyphen, asterisk,
slash, or question mark) or a blank space.
• A continuation line appears as part of a comment entry in a paragraph of the
Identification Division.
37
MISSING SEPARATOR
Type. Warning
Cause. The message applies to one of the following conditions:
• A character string is not followed by a separator.
• A comma, semicolon, or period separator is not followed by a blank space.
38
UNEXPECTED TEXT
Type. Error
Cause. The message applies to one of the following conditions:
• A section header or division header is followed by other text on the same source
line.
• The program name in the PROGRAM-ID paragraph of the Identification Division is
followed by other text on the same source line.
• The Identification Division header or the PROGRAM-ID paragraph must be
followed by an Identification Division paragraph header or the Environment
Division header, and it must begin in Area A of the source line.
39
UNEXPECTED END OF TEXT
Type. Error
Cause. The source text ended before the appearance of all four required divisions.
40
INCORRECT NUMBER OF PARAMETERS
Type. Error
Cause. The number of operands in the USING clause of a CALL statement differs from
the number of names in the USING Division header for the SCREEN COBOL
subprogram it invokes.
41
NAME CONFLICT
Type. Error
Cause. The message applies to one of the following conditions:
• The definition of a user-defined name in one class conflicts with its previous
definition in another class.
• The name of a new data item cannot be distinguished from the name of a previous
data item, even with full qualification.
42
AMBIGUOUS REFERENCE
Type. Error
Cause. A reference has insufficient qualification to identify a unique object within the
program unit.
43
NON-STANDARD ALPHABET NOT SUPPORTED
Type. Warning
Cause. A clause specifies EBCDIC, which is not supported.
43
NON-STANDARD ALPHABET NOT SUPPORTED
Type. Error
Cause. The message applies to one of the following conditions:
• The program’s collating sequence is not standard.
• An integer value is out of the range of valid values; the range depends on the
specific context.
44
SYNTAX ERROR DETECTED AT TOKEN: xxxxx
Type. Error
Cause. A syntax error occurred at the token pointed to by the indicator line. The
compiler attempted to correct token xxxxx but could not. The compiler examined and
discarded subsequent source code until reaching the token indicated by error 48.
45
SYNTAX ERROR REPLACING UNEXPECTED TOKEN BY xxxxx
Type. Error
Cause. A syntax error occurred at the token pointed to by the indicator line. The
compiler tried to correct the error by inserting token xxxxx. Verify the compiler's
correction for accuracy in your program.
46
SYNTAX ERROR - INSERTING MISSING TOKEN: xxxxx
Type. Error
Cause. A syntax error occurred at the token pointed to by the indicator line. The
compiler corrected the error by inserting token xxxxx. Usually, the correction is one of
several choices. Verify the compiler's correction for accuracy in your program.
47
SYNTAX ERROR - DELETING UNEXPECTED TOKEN: xxxxx
Type. Error
Cause. A syntax error occurred at the token pointed to by the indicator line. The
compiler attempted to correct the error by deleting token xxxxx. Verify the compiler's
correction for accuracy in your program.
48
PARSING RESUMED AT TOKEN: xxxxx
Type. Warning
Cause. This message follows errors 44, 45, 46, and 47. It indicates that in attempting
recovery, the compiler ignored all tokens between the original error token and token
xxxxx (but not including token xxxxx). When this message occurs, error correction by
the compiler is usually not the preferred correction. Examine the program from the
original error to determine the appropriate correction.
49
END-OF-FILE ENCOUNTERED DURING RECOVERY
Type. Failure
Cause. A syntax error has probably occurred near the end of the source code. Error 44
indicates where the error occurred. There is insufficient source code following the error
for the compiler to make a correction.
50
EXPECTED 'IDENTIFICATION'
Type. Error
Cause. A SCREEN COBOL program unit must begin with an Identification Division
header. The reserved word IDENTIFICATION must start in Area A of the source line.
51
EXPECTED UNSIGNED INTEGER
Type. Error
Cause. The message applies to one of the following conditions:
• A numeric literal in this context must be an unsigned integer.
• Only an unsigned integer numeric literal is permitted in this context.
52
0 NOT PERMITTED IN THIS CONTEXT
Type. Error
Cause. The indicated integer numeric literal cannot be zero in this context.
53
INTEGER NOT IN EXPECTED RANGE
Type. Error
Cause. The message applies to one of the following conditions:
• The value of the integer numeric literal is too small for this context.
• The value of the integer numeric literal is too large for this context.
54
ILLEGAL RANGE
Type. Error
Cause. The message applies to one of the following conditions:
• The first value in a numeric range exceeds the last value.
• The first value in a nonnumeric range is greater than the last value.
55
OUT OF ORDER
Type. Warning
Cause. The position of a phrase, clause, or paragraph does not conform to SCREEN
COBOL language requirements.
55
OUT OF ORDER
Type. Error
Cause. The message applies to one of the following conditions:
• The REDEFINES clause must be the first clause in a data description entry.
• A section of the Data Division occurs out of order.
56
DUPLICATE PHRASE
Type. Error
Cause. The indicated phrase duplicates the function of a preceding one.
57
DUPLICATE CLAUSE
Type. Error
Cause. The indicated clause duplicates the function of a preceding one.
58
DUPLICATE PARAGRAPH
Type. Error
Cause. The indicated paragraph header duplicates the function of a preceding one.
59
DUPLICATE SECTION
Type. Error
Cause. The indicated section header duplicates the function of a preceding one.
61
EXPECTED COMMAND WORD
Type. Error
Cause. A compiler command line must begin with the keyword of a command or with
one of the command options defined for the OPTION command.
62
EXPECTED QUOTED STRING
Type. Error
Cause. The heading value in a HEADING command option must be a quoted string
(that is, a nonnumeric literal).
63
EXPECTED COMMA
Type. Error
Cause. The message applies to one of the following conditions:
• Compiler command options must be separated by commas.
• Toggle numbers in a SETTOG or RESETTOG command must be separated by
commas.
64
MISSING TEXT NAME
Type. Error
Cause. The message applies to one of the following conditions:
• The text name is missing from a SECTION command.
• The text name in a COPY statement cannot be found in the copy library.
65
COMMAND NOT PERMITTED AFTER OPTION
Type. Error
Cause. A command keyword follows one or more command options. Only a single
command is permitted on each command line.
66
TEXT NOT PERMITTED AFTER COMMAND
Type. Error
Cause. Additional text follows a complete command. Only a single command is
permitted on each command line.
68
COMMAND NOT COMPATIBLE WITH PREVIOUS COMMANDS
Type. Warning
Cause. The SYNTAX and SYMBOLS commands are both used.
70
MISSING PROGRAM ID
Type. Error
Cause. The required PROGRAM-ID paragraph of the Identification Division is
missing.
71
MISSING CONFIGURATION SECTION
Type. Error
Cause. The required Configuration Section of the Environment Division is missing.
72
MISSING SOURCE COMPUTER PARAGRAPH
Type. Warning
Cause. The Configuration Section should contain the SOURCE-COMPUTER
paragraph. The default is SOURCE-COMPUTER. TANDEM/16.
73
MISSING OBJECT COMPUTER PARAGRAPH
Type. Warning
Cause. The Configuration Section should contain the OBJECT-COMPUTER
paragraph.
75
ILLEGAL EXTERNAL FILE NAME FORM
Type. Error
Cause. An attempt to convert an external file name to an internal file name has failed.
76
MISSING CONDITION NAME
Type. Warning
Cause. A switch has been encountered without a condition name.
77
ILLEGAL CURRENCY SYMBOL
Type. Error
Cause. Either the alternative currency symbol specified is not a single character, or the
specified character is not among the set of characters permitted for this purpose.
94
ALPHABET NAME NOT FOUND
Type. Error
Cause. The indicated name is either not defined or not an alphabet name.
111
CLAUSE NOT PERMITTED FOR THIS ENTRY
Type. Error
Cause. The indicated clause appears in an entry whose level number prohibits it.
112
NOT PERMITTED IN THIS SECTION
Type. Error
Cause. A VALUE clause defining an initial value appears in the Linkage Section or the
Data Division.
113
ILLEGAL LEVEL NUMBER
Type. Error
Cause. A level number is not 66, 77, 88, or in the range 01 through 49. The compiler
converts the illegal number to 50.
114
INCONSISTENT LEVEL NUMBER
Type. Error
Cause. A level number is neither greater than the level number of the preceding data
description entry nor equal to that of some preceding data description entry in the same
data structure.
115
MISSING 01 LEVEL ENTRY
Type. Error
Cause. A level number in the range 02 through 49 is not subordinate to a data
description entry with level number 01; that is, it is not within a data structure.
116
PRECEDED BY VARIABLE OCCURRENCE TABLE
Type. Error
Cause. Within a data structure, the data description entry for a variable occurrence table
(one containing an OCCURS clause with a range) cannot be followed by a data
description entry with a lower level number.
117
NOT PRECEDED BY CONDITIONAL VARIABLE
Type. Error
Cause. The definition of a condition-name (that is, a name whose data description entry
has level number 88) must be preceded by the entry of the data item whose value it tests.
Any intervening data description entries must also have level number 88.
118
NOT PRECEDED BY RECORD
Type. Error
Cause. A data description entry with level number 66 must be preceded by a data
structure. Any intervening data description entries must also have level number 66.
119
FILLER PERMITTED ONLY FOR ELEMENTARY RECORD ITEM
Type. Error
Cause. The data description entry of a FILLER data item must have a level number in
the range 02-49 and cannot be followed by descriptions of subordinate data items; that
is, it must be an elementary data item defined within a data structure.
120
DO NOT QUOTE PICTURE STRING
Type. Warning
Cause. A PICTURE character string should not be written as a nonnumeric literal. The
SCREEN COBOL compiler accepts the contents of the nonnumeric literal as the
PICTURE character string.
121
PICTURE STRING EXCEEDS 30 CHARACTERS
Type. Error
Cause. The SCREEN COBOL language limits the representation of a PICTURE
character string to 30 characters. Data items with more than 30 character positions must
be described with parenthesized repetition counts.
122
TOO MANY DIGIT POSITIONS
Type. Error
Cause. The SCREEN COBOL language supports a maximum of 18 digits in a numeric
or numeric edited data item.
123
TOO MANY CHARACTER POSITIONS
Type. Error
Cause. SCREEN COBOL supports a maximum of 32,000 character positions for an
elementary data item.
124
ILLEGAL PICTURE STRING
Type. Error
Cause. The PICTURE character string does not conform to SCREEN COBOL syntax.
Some of the causes for this message are illegal characters, unmatched parentheses,
improper combinations of otherwise legal characters, and pictures with no positions for
data characters.
125
LAST SYMBOL IS ',' OR '.'
Type. Warning
Cause. After removing the terminating comma, semicolon, period, or blank, the last
character in the PICTURE character in the PICTURE character string is a comma or
decimal point. The compiler accepts the picture and interprets the character in
conformance with the presence or absence of the DECIMAL-POINT IS COMMA
clause in the SPECIAL-NAMES paragraph.
126
PICTURE NOT PERMITTED FOR INDEX ITEM
Type. Error
Cause. An indexed item may not have a PICTURE clause.
127
SUBORDINATE USAGE CONFLICTS WITH GROUP USAGE
Type. Error
Cause. The data description entry for a containing group item has a USAGE clause.
The description of the subordinate data item cannot specify a different usage.
128
DISPLAY USAGE REQUIRED IN GROUP WITHOUT VALUE OR CONDITION
NAME
Type. Error
Cause. The data description entry of a containing group item has a VALUE clause
specifying an initial value or is followed by entries defining condition-names for the
group item. The subordinate data item must have DISPLAY usage.
129
COMPUTATIONAL USAGE REQUIRES NUMERIC
Type. Error
Cause. The category of a data item must be numeric when its usage is
COMPUTATIONAL.
130
SUBORDINATE SIGN CONFLICTS WITH GROUP SIGN
Type. Error
Cause. The data description for a containing group item has a SIGN clause. The
description of the subordinate data item cannot specify different sign characteristics.
131
SIGN CLAUSE REQUIRES DISPLAY USAGE
Type. Error
Cause. The message applies to one of the following conditions:
• The data description entry for a containing group item has a SIGN clause. The
subordinate numeric data item is signed (that is, has an S in its PICTURE);
therefore, the item must have DISPLAY usage.
• The data description entry for the current data item has a SIGN clause; therefore,
the item must have DISPLAY usage.
132
SIGN CLAUSE REQUIRES SIGNED NUMERIC
Type. Error
Cause. The data description entry for the current data item has a SIGN clause;
therefore, the item PICTURE must specify category numeric and contain an S.
133
JUSTIFIED REQUIRES DISPLAY USAGE
Type. Error
Cause. A data item described with the JUSTIFIED clause must have DISPLAY usage.
134
JUSTIFIED NOT PERMITTED FOR NUMERIC OR EDITED
Type. Error
Cause. The JUSTIFIED clause cannot appear for a data item described as numeric.
135
JUSTIFIED NOT PERMITTED IN GROUP WITH VALUE OR CONDITION NAME
Type. Error
Cause. The data description entry of a containing group item has a VALUE clause
specifying an initial value or is followed by entries defining condition names for the
group item. The subordinate data item cannot be described with the JUSTIFIED clause.
136
SYNCHRONIZED NOT PERMITTED FOR INDEX ITEM
Type. Warning
Cause. An indexed item may not have a SYNCHRONIZED clause.
137
SYNCHRONIZED NOT PERMITTED IN GROUP WITH VALUE OR CONDITION
NAME
Type. Error
Cause. The data description entry of a containing group item has a VALUE clause
specifying an initial value or is followed by entries defining condition names for the
group item. The subordinate data item cannot be described with the SYNCHRONIZED
clause.
138
BLANK WHEN ZERO REQUIRES DISPLAY USAGE
Type. Error
Cause. A data item described with the BLANK WHEN ZERO clause must have
DISPLAY usage. BLANK WHEN ZERO syntax is enforced when used, but data items
using this syntax cannot be accessed by SCREEN COBOL programs.
139
BLANK WHEN ZERO REQUIRES NUMERIC EDITED
Type. Error
Cause. Only a numeric data item can be described with the BLANK WHEN ZERO
clause. BLANK WHEN ZERO syntax is enforced when used, but data items using this
syntax cannot be accessed by SCREEN COBOL programs.
140
BLANK WHEN ZERO NOT COMPATIBLE WITH '*'
Type. Error
Cause. A data item cannot be described with both the BLANK WHEN ZERO clause
and a picture containing the asterisk (*). BLANK WHEN ZERO syntax is enforced
when used, but data items using this syntax cannot be accessed by SCREEN COBOL
programs.
141
TOO MANY NESTED TABLES
Type. Error
Cause. The SCREEN COBOL language supports access to a data item with at most
three subscripts. The OCCURS clause is subordinate to three or more other OCCURS
clauses and would require four or more subscripts to access the data item it describes.
142
VARIABLE OCCURRENCE NOT PERMITTED FOR SUBORDINATE TABLE
Type. Error
Cause. The SCREEN COBOL language does not permit a variable occurrence table to
be subordinate to a group table item.
143
VARIABLE OCCURRENCE NOT PERMITTED IN REDEFINITION
Type. Error
Cause. A data item described in a redefinition cannot be a variable occurrence table.
144
VARIABLE OCCURRENCE NOT COMPATIBLE WITH GROUP INITIAL VALUE
Type. Error
Cause. The data description entry of a containing group item has an initial value. The
subordinate data item cannot be a variable occurrence table.
145
TOO MANY KEYS
Type. Error
Cause. There are more than 30 keys.
146
SUBORDINATE VALUE NOT PERMITTED WITH GROUP VALUE
Type. Error
Cause. The data description entry of a containing group item specifies an initial value
for the group item. The subordinate data item cannot also specify an initial value.
147
ONLY ONE INITIAL VALUE PERMITTED
Type. Error
Cause. A data item cannot be initialized with more than one value.
148
RANGE NOT PERMITTED FOR INITIAL VALUE
Type. Error
Cause. A data item cannot be initialized with a range of values.
149
INITIAL VALUE OR CONDITION NAME NOT PERMITTED FOR INDEX ITEM
Type. Error
Cause. An indexed item may not have a VALUE clause.
150
INITIAL VALUE NOT PERMITTED FOR TABLE ITEM
Type. Error
Cause. A data item that is described with an OCCURS clause or is subordinate to a
group table item cannot be initialized.
151
INITIAL VALUE NOT PERMITTED FOR REDEFINITION
Type. Error
Cause. A data item described in a redefinition cannot be initialized.
152
SIGNIFICANCE RANGE OF LITERALS EXCEEDS 18 DIGITS
Type. Error
Cause. The number of significant digits of a numeric literal exceeds 18.
153
NUMERIC LITERAL NOT COMPATIBLE WITH NONNUMERIC FIGURATIVE OR
LITERAL
Type. Error
Cause. When a VALUE clause contains a numeric literal, all other values must also be
numeric literals or one of the figurative constants ZERO, ZEROS, or ZEROES.
154
RENAME OBJECT NOT DATA ITEM
Type. Error
Cause. The RENAMES clause can only rename data items.
155
RENAME OBJECT IS 66 LEVEL ITEM
Type. Error
Cause. A RENAMES clause cannot rename a level 66 item.
156
RENAME OBJECT NOT SUBORDINATE TO PRECEDING RECORD
Type. Error
Cause. A data item referenced in the RENAMES clause must be defined within the
preceding data description.
157
RENAME OBJECT IN TABLE OR HAS VARIABLE SIZE
Type. Error
Cause. The RENAMES clause cannot reference a table item; in addition, it cannot
reference a group data item which contains a table whose occurence is variable.
158
ILLEGAL RENAMES OBJECT RANGE
Type. Error
Cause. The second data item in the range of a RENAMES clause must include some
character positions that are not part of the first data item. However, the initial character
position of the second data item cannot precede the initial character position of the first
data item within their data structure.
159
REDEFINITION OBJECT NOT FOUND
Type. Error
Cause. Either the name in the REDEFINES clause cannot be found or it is not the name
of a data item. Note that when a REDEFINES clause appears in a data structure, only
that data structure is searched for the data item to be redefined.
160
REDEFINITION OBJECT HAS CONFLICTING LEVEL NUMBER
Type. Error
Cause. The data item to be redefined must have the same level number as the
redefining data description entry.
161
REDEFINITION OBJECT IS REDEFINITION
Type. Error
Cause. A data item described with a REDEFINES clause cannot itself be redefined.
This restriction does not apply to a subordinate of a redefinition item unless its data
description entry also contains a REDEFINES clause.
162
REDEFINITION OBJECT AND REDEFINITION NOT SUBORDINATE TO SAME
LEVELS
Type. Error
Cause. When the redefined data item is subordinate to a set of group items, the
redefinition item must also be subordinate to them.
163
REDEFINITION OBJECT NOT PRECEDING ITEM AT THIS LEVEL
Type. Error
Cause. The data description entry of a redefinition must not be separated from that of
the redefined item by any other data description entry with the same level number,
unless the intervening entry redefines the same data item.
164
REDEFINITION OBJECT IS TABLE OR HAS VARIABLE SIZE
Type. Error
Cause. A table item or a group item that has a variable size (that is, a subordinate
variable occurrence table) cannot be redefined.
165
MISSING VALUE CLAUSE
Type. Error
Cause. The required VALUE clause is missing from a data description entry with level
number 88.
166
MISSING RENAMES CLAUSE
Type. Error
Cause. The required RENAMES clause is missing from a data description entry with
level number 66.
167
GROUP ITEM HAS ELEMENTARY ITEM CLAUSE
Type. Error
Cause. The data description entry of a group item has a BLANK WHEN ZERO,
JUSTIFIED, SYNCHRONIZED, or PICTURE clause. These clauses can only describe
an elementary data item. BLANK WHEN ZERO syntax is enforced when used, but
data items using this syntax cannot be accessed by SCREEN COBOL programs.
168
GROUP WITH SIGN CLAUSE HAS NO SIGNED NUMERIC SUBORDINATE
Type. Warning
Cause. The SCREEN COBOL language required a group data item described with a
SIGN clause to have at least one signed numeric subordinate data item. SCREEN
COBOL reports nonconformance for informational purposes only.
169
ELEMENTARY ITEM HAS NO PICTURE
Type. Error
Cause. An elementary data item must be described with a PICTURE clause.
174
FIRST ELEMENTARY ITEM NOT DISPLAY AND NOT ALIGNED
Type. Error
Cause. The indicated data item cannot be aligned to the first character position of the
area it redefines. SCREEN COBOL does not permit a redefinition that requires
allocation of implicit FILLER character positions to align the first elementary item.
175
REDEFINITION HAS INCORRECT SIZE
Type. Error
Cause. The number of character positions occupied by a redefinition must equal the
number of character positions occupied by the redefined data item(s), unless the
redefinition begins at the 01 level.
176
NONNUMERIC FIGURATIVE OR LITERAL NOT PERMITTED FOR NUMERIC
ITEM
Type. Error
Cause. The initial value for a numeric data item must be a numeric literal or one of the
figurative constants ZERO, ZEROS, or ZEROES.
177
SIGNED LITERAL NOT PERMITTED FOR UNSIGNED NUMERIC ITEM
Type. Error
Cause. The initial value for an unsigned numeric data item must be an unsigned
numeric literal or one of the figurative constants ZERO, ZEROS, or ZEROES.
178
TOO MANY FRACTION DIGITS IN NUMERIC LITERAL
Type. Error
Cause. Assignment of the initial value to the numeric data item would require
truncation of nonzero digits to the right of the decimal point.
179
NUMERIC LITERAL VALUE TOO LARGE FOR ITEM
Type. Error
Cause. Assignment of the initial value to the numeric data item would require
truncation of nonzero digits to the left of the decimal point.
180
NUMERIC LITERAL NOT PERMITTED FOR NONNUMERIC OR GROUP ITEM
Type. Error
Cause. A numeric literal can only be used as the initial value for an elementary numeric
data item.
181
NONNUMERIC LITERAL EXCEEDS ITEM SIZE
Type. Error
Cause. Assignment of the initial value to the indicated data item would require
truncation of one or more characters.
182
01 OR 77 LEVEL ITEM TOO LARGE
Type. Error
Cause. SCREEN COBOL supports a maximum of 32,000 character positions for a
level 01 or level 77 data item defined in the Working-Storage Section or Linkage
Section.
183
DATA ITEM DESCRIPTION NOT COMPATIBLE WITH FILE CODE SET
Type. Error
Cause. A file with CODE SET may not have a data item with this description.
190
DEPENDING ITEM NOT FOUND
Type. Error
Cause. A name referenced in the DEPENDING phrase of an OCCURS clause is not
defined.
191
DEPENDING ITEM NOT SIMPLE UNSIGNED INTEGER DATA ITEM
Type. Error
Cause. Either the indicated name (referenced in the DEPENDING phrase of an
OCCURS clause) does not identify an elementary unsigned integer data item, or access
to the item requires subscripting.
192
DEPENDING ITEM IN TABLE
Type. Error
Cause. The indicated data item is allocated within the table it controls. The allocation
is a result of an explicit or implicit redefinition.
203
MESSAGE FORMAT MUST BE THE SAME IN ALL REPLIES
Type. Error
Cause. All reply messages in any one SEND MESSAGE statement must have the same
format (either FIXED, VARYING1, or VARYING2). A reply from working storage is
FIXED.
205
USING OPERAND NOT FOUND IN LINKAGE SECTION
Type. Error
Cause. A name in the USING phrase of the Procedure Division header is not defined in
the Linkage Section of the Data Division.
206
USING OPERAND NOT DATA ITEM
Type. Error
Cause. The indicated name does not identify a data item. Only data item names can be
specified in the USING phrase of the Procedure Division header.
207
USING OPERAND IS REDEFINITION OR NOT LEVEL 01 OR LEVEL 77
DATA ITEM
Type. Error
Cause. SCREEN COBOL requires that a data item in the USING phrase be a level 01
or level 77 item. SCREEN COBOL does not permit a redefinition, including one of a
level 01 or level 77 item, to appear in the USING phrase.
208
DATA ITEM PERMITTED ONLY ONCE AS USING OPERAND
Type. Error
Cause. The same name cannot appear more than once in the USING phrase of the
Procedure Division header.
209
TOO MANY USING OPERANDS
Type. Error
Cause. SCREEN COBOL supports a maximum of 29 names in the USING phrase of
the Procedure Division header.
210
LINKAGE DATA ITEM MUST BE USING OPERAND
Type. Error
Cause. The indicated data item is defined in the Linkage Section but cannot be
addressed. Addressable items are those specified in the USING phrase of the Procedure
Division header; their subordinate items; and the redefinition, renaming, and condition-
names of the subordinate items.
211
TOO MANY RECORDS
Type. Error
Cause. The program defines more data structures than the compiler can address.
212
TOO MANY ELEMENTARY ITEMS
Type. Error
Cause. The program defines more level 77 data items than the SCREEN
COBOL compiler can address.
213
FEATURE NOT SUPPORTED BY SCREEN COBOL
Type. Error
Cause. There are many features not supported by SCREEN COBOL, of which this is
one.
214
MULTIPLE UNIT COMPILES NOT SUPPORTED BY SCREEN COBOL
Type. Error
Cause. Multiple IDENTIFICATION divisions encountered during compilation.
221
INSUFFICIENT SPECIFICATION TO DETERMINE TYPE OF SCREEN ITEM
Type. Error
Cause. Any screen item (other than the 01 level screen name) must be either a group,
an overlay area, a literal field, an input field, an output field, or an input-output field.
This item cannot be classified because it does not have the minimum requirements for
definition.
222
THIS SCREEN ITEM MUST BE NAMED
Type. Error
Cause. A name is required for 01 levels (screen names) and overlay areas.
223
THIS SCREEN ITEM MUST HAVE BASE SPECIFICATION
Type. Error
Cause. The screen item must have a BASE clause specified.
224
THIS SCREEN ITEM MUST HAVE 'OVERLAY' SPECIFICATION
Type. Error
Cause. The screen item must have an OVERLAY clause specified.
225
THIS SCREEN ITEM MUST HAVE SIZE SPECIFIED
Type. Error
Cause. Overlay areas must have a SIZE clause.
226
THIS SCREEN ITEM MUST HAVE 'AREA' SPECIFICATION
Type. Error
Cause. Overlay areas must have an AREA clause.
227
THIS SCREEN ITEM MUST HAVE LOCATION ('AT') SPECIFIED
Type. Error
Cause. All screen items must have allocation specified. Screen fields can use either the
AT clause or the REDEFINES clause or both.
228
THIS SCREEN ITEM MUST HAVE LOCATION ('REDEFINES') SPECIFIED
Type. Error
Cause. All screen items must have a location specified. Screen fields can use either the
AT clause or the REDEFINES clause or both.
229
THIS SCREEN ITEM MUST HAVE FROM (OR USING) DATA ITEM
Type. Error
Cause. The screen item must have a FROM or USING clause specified with an
associated data item.
230
THIS SCREEN ITEM MUST HAVE TO (OR USING) DATA ITEM
Type. Error
Cause. The screen item must have a TO or USING clause specified with an associated
data item.
231
THIS SCREEN ITEM MUST HAVE SHADOW DATA ITEM SPECIFIED
Type. Error
Cause. The screen item must have a SHADOWED clause specified with an associated
data item.
232
THIS SCREEN ITEM MUST HAVE PICTURE SPECIFICATION
Type. Error
Cause. Input fields, output fields, and input-output fields must have a PICTURE clause.
233
THIS SCREEN ITEM MUST HAVE INITIAL VALUE
Type. Error
Cause. Literal fields must have an initial value.
234
THIS SCREEN ITEM MUST HAVE FILL CHARACTER SPECIFIED
Type. Error
Cause. The screen item must have a FILL clause specified with a fill character.
235
THIS SCREEN ITEM MUST HAVE OCCURS SPECIFICATION
Type. Error
Cause. The screen item must have an OCCURS clause specified.
236
THIS SCREEN ITEM MUST HAVE ACCEPTABLE VALUE(S) ('MUST')
SPECIFIED
Type. Error
Cause. The MUST BE clause for the screen item must specify a value that is
compatible with the screen PICTURE clause.
237
THIS SCREEN ITEM MUST HAVE ACCEPTABLE LENGTH(S) SPECIFIED
Type. Error
Cause. The LENGTH clause for the screen item must specify a length that is
compatible with the screen PICTURE clause.
238
THIS SCREEN ITEM MUST HAVE UPSHIFT SPECIFICATION
Type. Error
Cause. The screen item must have an UPSHIFT clause specified with a valid input or
output specification.
239
THIS SCREEN ITEM MUST HAVE FULL ACTION ('WHEN FULL')
SPECIFIED
Type. Error
Cause. The screen item must have a WHEN FULL clause specified.
240
THIS SCREEN ITEM MUST HAVE USER CONVERSION NUMBER SPECIFIED
Type. Error
Cause. The screen item must have a USER CONVERSION clause specified.
243
THIS SCREEN ITEM MUST HAVE PROMPT FIELD SPECIFIED
Type. Error
Cause. The screen item must have a PROMPT clause specified in the Screen Section.
254
THIS SCREEN ITEM MUST NOT BE NAMED
Type. Error
Cause. Literal fields must not be named.
255
THIS SCREEN ITEM MUST NOT HAVE BASE SPECIFICATION
Type. Error
Cause. The BASE clause is allowed only at the 01 level.
256
THIS SCREEN ITEM MUST NO HAVE 'OVERLAY' SPECIFICATION
Type. Error
Cause. The OVERLAY clause is allowed only at the 01 level.
257
THIS SCREEN ITEM MUST NOT HAVE SIZE SPECIFIED
Type. Error
Cause. The SIZE clause is allowed only at the 01 level or for overlay area items.
258
THIS SCREEN ITEM MUST NOT HAVE 'AREA' SPECIFICATION
Type. Error
Cause. AREA can be specified only for overlay areas. This item either has conflicting
clauses or subordinate items (is a group).
259
THIS SCREEN ITEM MUST NOT HAVE LOCATION ('AT') SPECIFIED
Type. Error
Cause. The screen item must not have an associated screen location. The AT clause is
allowed only for screen groups and fields.
260
THIS SCREEN ITEM MUST NOT HAVE LOCATION ('REDEFINES')
SPECIFIED
Type. Error
Cause. The screen item must not redefine another screen item. The REDEFINES
clause is allowed only for elementary screen fields.
261
THIS SCREEN ITEM MUST NOT HAVE FROM (OR USING) DATA ITEM
Type. Error
Cause. Only output fields and input-output fields can have FROM or USING clauses.
262
THIS SCREEN ITEM MUST NOT HAVE TO (OR USING) DATA ITEM
Type. Error
Cause. Only input fields and input-output fields can have TO or USING clauses.
263
THIS SCREEN ITEM MUST NOT HAVE SHADOW DATA ITEM SPECIFIED
Type. Error
Cause. SHADOWED clauses are allowed only for input, output, or input-output fields.
264
THIS SCREEN ITEM MUST NOT HAVE PICTURE SPECIFICATION
Type. Error
Cause. PICTURE clauses are allowed only for input, output, or input-output fields.
265
THIS SCREEN ITEM MUST NOT HAVE INITIAL VALUE
Type. Error
Cause. VALUE clauses are allowed only for input, output, input-output, or literal fields.
266
THIS SCREEN ITEM MUST NOT HAVE FILL CHARACTER SPECIFIED
Type. Error
Cause. FILL clauses are allowed only for input, output, or input-output fields.
267
THIS SCREEN ITEM MUST NOT HAVE OCCURS SPECIFICATION
Type. Error
Cause. OCCURS clauses are allowed only for input, output, or input-output fields.
268
THIS SCREEN ITEM MUST NOT HAVE ACCEPTABLE VALUE(S) ('MUST')
SPECIFIED
Type. Error
Cause. MUST clauses are allowed only for input or input-output fields.
269
THIS SCREEN ITEM MUST NOT HAVE ACCEPTABLE LENGTH(S) SPECIFIED
Type. Error
Cause. LENGTH clauses are allowed only for input or input-output fields.
270
THIS SCREEN ITEM MUST NOT HAVE UPSHIFT SPECIFICATION
Type. Error
Cause. UPSHIFT clauses are allowed only for input, output, or input-output fields.
271
THIS SCREEN ITEM MUST NOT HAVE FULL ACTION ('WHEN FULL')
SPECIFIED
Type. Error
Cause. WHEN FULL clauses are allowed only for input or input-output fields.
272
THIS SCREEN ITEM MUST NOT HAVE USER CONVERSION NUMBER
SPECIFIED
Type. Error
Cause. USER CONVERSION clauses are allowed only for input, output, or input-
output fields.
275
THIS SCREEN ITEM MUST NOT HAVE PROMPT FIELD SPECIFIED
Type. Error
Cause. The screen item must not have a PROMPT clause specified.
276
THIS SCREEN ITEM MUST NOT HAVE FIELD-SEPARATOR CHARACTER
SPECIFIED
Type. Error
Cause. The screen item must not have a FIELD-SEPARATOR clause specified. This
clause can be specified only for an 01 screen level item.
277
THIS SCREEN ITEM MUST NOT HAVE GROUP-SEPARATOR CHARACTER
SPECIFIED
Type. Error
Cause. The screen item must not have a GROUP-SEPARATOR clause specified. This
clause can be specified only for an 01 screen level item.
278
THIS SCREEN ITEM MUST NOT HAVE ABORT-INPUT CHARACTERS
SPECIFIED
Type. Error
Cause. The screen item must not have an ABORT-INPUT clause specified. This
clause can be specified only for an 01 screen level item.
279
THIS SCREEN ITEM MUST NOT HAVE END-OF-INPUT CHARACTERS
SPECIFIED
Type. Error
Cause. The screen item must not have an END-OF-INPUT clause specified. This
clause can be specified only for an 01 screen level item.
280
THIS SCREEN ITEM MUST NOT HAVE RESTART-INPUT CHARACTERS
SPECIFIED
Type. Error
Cause. The screen item must not have a RESTART-INPUT clause specified. This
clause can be specified only for an 01 screen level item.
281
THIS SCREEN ITEM MUST NOT HAVE FIXED-LENGTH SPECIFICATION
Type. Error
Cause. A fixed-length specification is not allowed for this item.
282
THIS SCREEN ITEM MUST NOT HAVE TRANSPARENT SPECIFICATION
Type. Error
Cause. A transparent specification is not allowed for this item.
285
THIS SCREEN ITEM MUST NOT HAVE ADVISORY SPECIFICATION
Type. Error
Cause. ADVISORY clauses are allowed only for output, or input-output fields.
286
THIS SCREEN ITEM HAS DUPLICATE NAMING
Type. Error
Cause. Duplicate clauses are not allowed.
287
THIS SCREEN ITEM HAS DUPLICATE BASE SPECIFICATION
Type. Error
Cause. Duplicate clauses are not allowed.
288
THIS SCREEN ITEM HAS DUPLICATE 'OVERLAY' SPECIFICATION
Type. Error
Cause. Duplicate clauses are not allowed.
289
THIS SCREEN ITEM HAS DUPLICATE SIZE SPECIFIED
Type. Error
Cause. Duplicate clauses are not allowed.
290
THIS SCREEN ITEM HAS DUPLICATE 'AREA' SPECIFICATION
Type. Error
Cause. Duplicate clauses are not allowed.
291
THIS SCREEN ITEM HAS DUPLICATE LOCATION ('AT') SPECIFIED
Type. Error
Cause. Duplicate clauses are not allowed.
292
THIS SCREEN ITEM HAS DUPLICATE LOCATION ('REDEFINES')
SPECIFIED
Type. Error
Cause. Duplicate clauses are not allowed.
293
THIS SCREEN ITEM HAS DUPLICATE FROM (OR USING) DATA ITEM
Type. Error
Cause. Duplicate clauses are not allowed.
294
THIS SCREEN ITEM HAS DUPLICATE TO (OR USING) DATA ITEM
Type. Error
Cause. Duplicate clauses are not allowed.
295
THIS SCREEN ITEM HAS DUPLICATE SHADOW DATA ITEM SPECIFIED
Type. Error
Cause. Duplicate clauses are not allowed.
296
THIS SCREEN ITEM HAS DUPLICATE PICTURE SPECIFICATION
Type. Error
Cause. Duplicate clauses are not allowed.
297
THIS SCREEN ITEM HAS DUPLICATE INITIAL VALUE
Type. Error
Cause. Duplicate clauses are not allowed.
298
THIS SCREEN ITEM HAS DUPLICATE FILL CHARACTER SPECIFIED
Type. Error
Cause. Duplicate clauses are not allowed.
299
THIS SCREEN ITEM HAS DUPLICATE OCCURS SPECIFICATION
Type. Error
Cause. Duplicate clauses are not allowed.
300
THIS SCREEN ITEM HAS DUPLICATE ACCEPTABLE VALUE(S) ('MUST')
SPECIFIED
Type. Error
Cause. Duplicate clauses are not allowed.
301
THIS SCREEN ITEM HAS DUPLICATE ACCEPTABLE LENGTH(S) SPECIFIED
Type. Error
Cause. Duplicate clauses are not allowed.
302
THIS SCREEN ITEM HAS DUPLICATE UPSHIFT SPECIFICATION
Type. Error
Cause. Duplicate clauses are not allowed.
303
THIS SCREEN ITEM HAS DUPLICATE FULL ACTION ('WHEN FULL')
SPECIFIED
Type. Error
Cause. Duplicate clauses are not allowed.
304
THIS SCREEN ITEM HAS DUPLICATE USER CONVERSION NUMBER
SPECIFIED
Type. Error
Cause. Duplicate clauses are not allowed.
307
THIS SCREEN ITEM HAS DUPLICATE PROMPT FIELD SPECIFIED
Type. Error
Cause. Duplicate clauses are not allowed.
308
THIS SCREEN ITEM HAS DUPLICATE FIELD-SEPARATOR CHARACTER
SPECIFIED
Type. Error
Cause. Duplicate characters are not allowed in multiple input character clauses.
309
THIS SCREEN ITEM HAS DUPLICATE GROUP-SEPARATOR CHARACTERS
SPECIFIED
Type. Error
Cause. Duplicate characters are not allowed in multiple input character clauses.
310
THIS SCREEN ITEM HAS DUPLICATE ABORT-INPUT CHARACTERS
SPECIFIED
Type. Error
Cause. Duplicate characters are not allowed in multiple input character clauses.
311
THIS SCREEN ITEM HAS DUPLICATE END-OF-INPUT CHARACTERS
SPECIFIED
Type. Error
Cause. Duplicate characters are not allowed in multiple input character clauses.
312
THIS SCREEN ITEM HAS DUPLICATE RESTART-INPUT CHARACTERS
SPECIFIED
Type. Error
Cause. Duplicate characters are not allowed in multiple input character clauses.
313
THIS SCREEN ITEM HAS DUPLICATE FIXED-LENGTH SPECIFICATION
Type. Error
Cause. Duplicate fixed-length specification is not allowed.
314
THIS SCREEN ITEM HAS DUPLICATE TRANSPARENT SPECIFICATION
Type. Error
Cause. Duplicate transparent specification is not allowed.
317
THIS SCREEN ITEM HAS DUPLICATE ADVISORY SPECIFICATION
Type. Error
Cause. Duplicate clauses are not allowed.
318
INPUT SCREEN ITEMS (TO OR USING) MAY NOT BE PROTECTED
Type. Error
Cause. Input and input-output fields must not be protected; if they were, data entry
would be impossible.
319
REDEFINED SCREEN ITEM HAS DIFFERENT LOCATION
Type. Error
Cause. A redefined field must have the same location as the field it redefines.
320
REDEFINED SCREEN ITEM HAS DIFFERENT LENGTH
Type. Error
Cause. A redefined field must have the same length as the field it redefines.
321
REDEFINED SCREEN ITEM HAS DIFFERENT DISPLAY ATTRIBUTE
Type. Error
Cause. A redefined field must have the same display attribute as the field it redefines.
322
REDEFINED SCREEN ITEM HAS DIFFERENT FULL ACTION
Type. Error
Cause. A redefined field must have the same full action (WHEN FULL) as the field it
redefines.
323
REDEFINED SCREEN ITEM HAS DIFFERENT OCCURS SPECIFICATION
Type. Error
Cause. A redefined field must have the same occurs specification as the field it
redefines.
324
DUPLICATE SPECIFICATION FOR DISPLAY ATTRIBUTE
Type. Error
Cause. A given type of display attribute has been declared more than once; the attribute
can only be declared once.
325
INITIAL VALUE MUST BE QUOTED STRING
Type. Error
Cause. Only string literals are allowed for initial values of screen items.
326
TOO MANY SEPARATORS OR OFFSETS IN COLUMN SPACING LIST
Type. Error
Cause. The column spacing list must contain fewer entries than there are column
occurrences.
327
UNKNOWN TERMINAL TYPE
Type. Error
Cause. Terminal type must be IBM-3270, T16-6510, T16-6520, T16-6530, or T16-
6540.
328
NO TERMINAL TYPE SPECIFIED
Type. Error
Cause. A terminal type clause is required.
329
FUNCTION KEY NOT ALLOWED FOR THIS TERMINAL TYPE
Type. Error
Cause. The function key mentioned is not available for this terminal type.
330
DISPLAY ATTRIBUTE NOT ALLOWED FOR THIS TERMINAL TYPE
Type. Error
Cause. The display attribute mentioned is not available for this terminal type.
331
FROM (USING) DATA ITEM HAS DIFFERENT TYPE (NUMBER VS STRING)
Type. Error
Cause. Numeric screen items must be associated with numeric data items; nonnumeric
screen items must be associated with nonnumeric data items.
332
FROM (USING) DATA ITEM HAS INSUFFICIENT NUMBER OF OCCURRENCES
Type. Error
Cause. The screen item has more occurrences than the data item.
333
FROM (USING) DATA ITEM HAS INCOMPATIBLE SCALE
Type. Error
Cause. The scale specified for the TO or USING data item is not compatible with that
specified by the screen item PICTURE. The scale should be adjusted for compatible
editing of data.
334
TO (USING) DATA ITEM HAS DIFFERENT TYPE (NUMBER VS. STRING)
Type. Error
Cause. Numeric screen items must be associated with numeric data items; nonnumeric
screen items must be associated with nonnumeric data items.
335
TO (USING) DATA ITEM HAS INSUFFICIENT NUMBER OF OCCURRENCES
Type. Error
Cause. The screen item has more occurrences than the data item.
336
TO (USING) DATA ITEM HAS INCOMPATIBLE SCALE
Type. Error
Cause. The scale specified for the FROM or USING data item is not compatible with
that specified by the screen item PICTURE. The scale should be adjusted for
compatible editing of data.
337
VALUE STRING LONGER THAN PICTURE
Type. Error
Cause. The value string must not be longer than the screen item.
338
OVERLAY AREA TOO LARGE
Type. Error
Cause. The overlay area is larger than the base screen.
339
OVERLAY SCREENS MAY NOT CONTAIN OVERLAY AREAS
Type. Error
Cause. An overlay screen cannot have an overlay area; only a base screen can contain
an overlay area.
340
OVERLAY AREAS MUST BE FULL WIDTH FOR THIS TERMINAL TYPE
Type. Error
Cause. Overlay areas must be as wide as the base screen on T16-6510 terminals.
341
SCREEN TOO LARGE FOR TERMINAL TYPE
Type. Error
Cause. Screen size exceeds the largest supported size for this terminal type.
342
ERROR ENHANCEMENT MAY NOT SPECIFY PROTECTION ATTRIBUTE
Type. Error
Cause. An ERROR-ENHANCEMENT clause must not specify PROTECTED attribute.
If a field in error is protected, correction of the error would not be possible.
343
SHADOWED DATA ITEM HAS INSUFFICIENT NUMBER OF OCCURRENCES
Type. Error
Cause. If a shadowed field contains an OCCURS clause, the shadowed data item must
have the same number of occurrences as the field.
344
SCREEN ITEM TOO LONG
Type. Error
Cause. The maximum field length of 255 characters has been exceeded.
345
UNKNOWN CHARACTER SET TYPE
Type. Error
Cause. Invalid character-set type was specified in the OBJECT-COMPUTER
paragraph of the Environment Division.
346
CHARACTER SET NOT VALID FOR THIS TERMINAL TYPE
Type. Warning
Cause. The character set specified is not valid for the terminal. The character set
specification is ignored.
347
PROMPT SCREEN ITEM MUST BE A FIELD IN SAME SCREEN
Type. Error
Cause. The message applies to one of the following conditions:
• The screen item named in the PROMPT clause and the definition of the screen field
must be in the same screen.
• The screen item must be a field.
• The screen item cannot be an overlay, a group, or a filler item.
348
PROMPT SCREEN ITEM MUST NOT BE THE CURRENT ITEM
Type. Error
Cause. The screen item named in the PROMPT clause cannot refer to the screen item
containing the PROMPT clause. A screen field cannot be prompted by itself.
349
PROMPT SCREEN ITEM MUST HAVE A FROM (OR USING) DATA ITEM
Type. Error
Cause. If the screen item named in the PROMPT clause has an associated Working-
Storage data item, the screen item must have a FROM or USING clause. A TO clause
generates this error.
350
DUPLICATE INPUT EDIT CONTROL CHARACTERS DEFINED
Type. Error
Cause. The same character cannot be defined for more than one input-control character
within each screen.
351
OPERAND MUST BE A SCREEN ITEM
Type. Error
Cause. The operand must be an item defined in the Screen Section.
352
OPERAND MUST BE A DATA ITEM
Type. Error
Cause. The operand must be an item defined in the Working-Storage Section.
353
OPERAND MUST BE A MNEMONIC-NAME
Type. Error
Cause. The operand must be a mnemonic name specified in the SPECIAL-NAMES
paragraph.
354
INVALID CONVERSATIONAL SEPARATOR
Type. Error
Cause. A field or group separator is defined incorrectly. A nonnumeric literal must be
one alphanumeric character enclosed in quotation marks. A numeric literal must be in
the range 0 through 255.
355
TOO MANY COLUMN OCCURRENCES SPECIFIED FOR SCREEN FIELD
Type. Error
Cause. An OCCURS clause includes a column number greater than the number of
columns in the size of the screen. For example, if a screen is defined as SIZE 20, 80, an
OCCURS IN 82 COLUMNS generates this message.
356
TOO MANY LINE OCCURRENCES SPECIFIED FOR SCREEN FIELD
Type. Error
Cause. An OCCURS clause includes a line number greater than the number of lines in
the size of the screen. For example, if a screen is defined as SIZE 20, 80, an OCCURS
IN 24 LINES generates this message.
357
LENGTH CLAUSE NOT VALID FOR SCREEN FIELD PICTURE
Type. Error
Cause. The length of the data item specified in the LENGTH clause is too short or long
for the length indicated by the PICTURE clause. Correct either the LENGTH or
PICTURE clause so that they specify compatible lengths.
358
THIS MESSAGE ITEM MUST HAVE TO, FROM, OR USING DATA ITEM
Type. Error
Cause. A field in the Message Section must be described with a TO, FROM,or USING
clause that names a data item in Working-Storage.
359
THIS MESSAGE ITEM MUST HAVE PICTURE SPECIFICATION
Type. Error
Cause. A field in the Message Section must be described with a PICTURE clause.
360
MESSAGE ITEM TOO LONG
Type. Error
Cause. A message field in the Message Section is defined with a size greater than
32,000 bytes.
361
THIS MESSAGE ITEM HAS DUPLICATE FROM (OR USING) DATA ITEM
Type. Error
Cause. Duplicate clauses are not allowed.
362
THIS MESSAGE HAS DUPLICATE TO (OR USING) DATA ITEM
Type. Error
Cause. Duplicate clauses are not allowed.
363
THIS MESSAGE ITEM HAS DUPLICATE PICTURE SPECIFICATION
Type. Error
Cause. Duplicate clauses are not allowed.
364
THIS MESSAGE ITEM HAS DUPLICATE USER CONVERSION NUMBER
SPECIFIED
Type. Error
Cause. Duplicate clauses are not allowed.
365
THIS MESSAGE ITEM HAS DUPLICATE FORMAT SPECIFICATION
Type. Error
Cause. Duplicate clauses are not allowed.
366
THIS MESSAGE ITEM HAS DUPLICATE NAMING
Type. Error
Cause. A field within the Message Section has more than one name clause specified;
only one name clause is allowed.
367
MESSAGE ITEM HAS DUPLICATE OCCURS SPECIFICATION
Type. Error
Cause. Duplicate OCCURS specifications are not allowed.
368
THIS MESSAGE ITEM HAS DUPLICATE FIELD STATUS
Type. Error
Cause. A field within the Message Section has more than one FIELD STATUS clause
specified; duplicate clauses are not allowed.
369
ITEM SPECIFIED BY FIELD STATUS IS TOO SHORT
Type. Error
Cause. A Message Section item referenced a Working-Storage Section item that was
not large enough to contain the field status information. The recommended size and
format for the Working-Storage item is two 9(4) COMP fields within one group item.
370
VARYING FORMAT NOT SUPPORTED FOR MULTI-FIELD MESSAGES
Type. Error
Cause. Only messages of FIXED, DELIMITED, or FIXED DELIMITED format can
have group and field items within the 01 level.
371
OPERAND MUST BE AN ELEMENTARY MESSAGE ITEM
Type. Error
Cause. The operand must be a Message Section item and cannot be an 01 level item, a
group item, or an OCCURS clause item.
372
RESULTING COUNT ALLOWED ON 01 LEVEL OR ELEMENTARY ITEMS ONLY
Type. Error
Cause. The RESULTING COUNT clause is not allowed as part of a group item
specification.
373
PRESENT IF MUST REFERENCE ELEMENTARY ITEM IN CURRENT MESSAGE
Type. Error
Cause. The PRESENT IF clause must reference an elementary Message Section item in
the same message. The PRESENT IF clause cannot reference an 01 level item, a group
item, or an OCCURS clause item.
374
PRESENT IF MAY NOT REFERENCE GROUP ITEM
Type. Error
Cause. The PRESENT IF clause cannot reference a group item because its item
reference must specify a PICTURE clause as part of its specification.
375
DELIMITER MUST BE QUOTED CHARACTER, OR NUMERIC IN 0-255 RANGE
Type. Error
Cause. The delimiting character defined by the FIELD-DELIMITER or MESSAGE-
DELIMITER clause must be specified in quotation marks ("P"), or the decimal
representation of the desired ASCII or EBCDIC character (80 = P, 3 = ETX).
376
ALLOWED ON 01 LEVEL ITEM ONLY
Type. Error
Cause. The MESSAGE FORMAT clause is allowed only on the 01 level item.
377
PRESENT IF NOT ALLOWED FOR THIS MESSAGE FORMAT
Type. Error
Cause. The PRESENT IF clause is allowed only on messages of DELIMITED format.
378
RESULTING COUNT MUST REFERENCE NUMERIC DATA ITEM
Type. Error
Cause. The Working-Storage field referred to by a RESULTING COUNT clause must
be a numeric data item.
379
PIC 1 NOT ALLOWED WITH DELIMITED FIELDS
Type. Error
Cause. Messages of delimited format cannot contain items with binary data PICTURE
clauses (PIC 1 format), unless delimiters are specified as OFF.
380
DEPENDING NOT ALLOWED IN FIXED LENGTH MESSAGE
Type. Error
Cause. A fixed length message may not have a DEPENDING clause.
381
PIC N NOT SUPPORTED IN MESSAGE
Type. Error
Cause. An attempt was made to define a data item with a PIC N in the Message
Section.
382
PIC N NOT ALLOWED UNLESS 'CHARACTER-SET IS KANJI-KATAKANA'
Type. Error
Cause. An attempt was made to define a PIC N data item without specifying the clause
CHARACTER-SET IS KANJI-KATAKANA in the Environment Division.
383
DATA/SCREEN ITEM VALUE (PIC N) IS NOT A VALID DBCS
Type. Error
Cause. Data items or screen items defined as PIC N and having the VALUE attribute
must use a valid double-byte character.
384
SCREEN ITEM DECLARED AS ADVISORY CANNOT REFERENCE PIC N DATA
ITEM
Type. Error
Cause. A screen item defined as an advisory field cannot reference a data item that is
declared as a PIC N.
385
SCREEN ITEM FILL CHARACTER (PIC N) IS NOT A VALID DBCS
Type. Error
Cause. A screen item defined as PIC N and that uses the FILL attribute must use a valid
double-byte character as the fill character.
386
SCREEN ITEM DECLARED WITH ILLEGAL FIELD ATTRIBUTE FOR PIC N
FIELD
Type. Error
Cause. An attempt was made to use a screen field attribute that is not supported for
double-byte data items.
387
SCREEN ITEM 'FILL' CHARACTER CAN NOT BE DBCS (PIC N ONLY)
Type. Error
Cause. A double-byte character is being used for an item which is not PIC N.
388
SCREEN ITEMS (PIC N) MUST DECLARE PIC BEFORE OTHER ATTRIBUTES
Type. Error
Cause. PIC must come before attributes.
389
REDEFINE IS NOT SUPPORTED FOR PIC N SCREEN ITEMS
Type. Error
Cause. An attempt was made to use a REDEFINES clause for a PIC N screen data
item.
390
SPECIFIED ATTRIBUTE COMBINATION IS ILLEGAL FOR THIS DEVICE
TYPE
Type. Error
Cause. Outline display attributes are available only on terminals in the IBM 3270
family.
391
PREVIOUS FOREGROUND OR BACKGROUND COLOR SETTING WILL BE RESET
Type. Warning
Cause. A foreground or background color will be reset.
392
FOREGROUND AND BACKGROUND ARE THE SAME COLOR
Type. Warning
Cause. The foreground and background colors are the same.
393
MNEMONIC NAME USED IN SCREEN SECTION MUST BE TYPE VIDEO
ATTRIBUTE
Type. Error
Cause. Mnemonic names must define supported extended field attributes.
394
OUTLINE ATTRIBUTES ARE ONLY ALLOWED FOR ELEMENTARY SCREEN
ITEMS
Type. Error
Cause. Outline display attributes can be in elementary screen items (not group items).
395
ILLEGAL ATTRIBUTE FOR OVERLAY AREA DEFINITION
Type. Error
Cause. Video or outline display attributes cannot be used for an overlay area in the
Screen Section.
396
PIC 1 NOT ALLOWED WITH VARYING1/2 MESSAGE FORMAT
Type. Error
Cause. VARYING1 and VARYING2 may not be used with PIC 1.
397
OVERLAY SCREEN MUST HAVE SUBORDINATE ENTRIES (CAN'T BE EMPTY)
Type. Error
Cause. An overlay screen is not a group item.
398
SCREEN 'AREA' MUST NOT HAVE SUBORDINATE ENTRIES
Type. Error
Cause. "AREA" may not be a group item.
399
SCREEN SECTION MUST HAVE 01 LEVEL ENTRY
Type. Error
Cause. The SCREEN SECTION must begin with an 01 level item.
400
TOO MANY ERRORS
Type. Failure
Cause. The error limit has been exceeded.
402
UNABLE TO OPEN $RECEIVE
Type. Failure
Cause. Call to OPEN for $RECEIVE failed.
403
UNABLE TO OPEN COMMUNICATION FILE
Type. Failure
Cause. Unable to open SEND file.
404
UNABLE TO OPEN LIST FILE
Type. Failure
Cause. Call to OPEN for LIST file failed.
405
UNABLE TO USE LIST FILE
Type. Failure
Cause. The record length for the LIST file is less than 40 bytes.
406
UNABLE TO CREATE WORK FILE
Type. Failure
Cause. Attempt to create WORK file failed.
407
UNABLE TO OPEN WORK FILE
Type. Failure
Cause. Attempt to open WORK file failed.
410
COMPILER COMMUNICATION LOST
Type. Failure
Cause. Communication between the two compiler processes has been lost.
411
LIST FILE WRITE FAILURE
Type. Failure
Cause. Attempt to write to line failed.
414
UNABLE TO CREATE RUN UNIT FILE
Type. Failure
Cause. Attempt to create run unit file failed.
415
UNABLE TO OPEN RUN UNIT FILE
Type. Failure
Cause. Attempt to open run unit file failed.
416
FAILURE IN USING OR ALLOCATING EXTENDED SEGMENT
Type. Failure
Cause. Either a call to ALLOCATESEGMENT or a call to USESEGMENT has failed.
417
COMPILER LOGIC ERROR
Type. Failure
Cause. This error appears when a failure whose cause cannot be easily determined
occurs.
421
CONTROL DATA SPACE OVERFLOW
Type. Failure
Cause. The compiler stack has exceeded 32K words.
423
FILE ERROR ON RUN UNIT FILE
Type. Failure
Cause. File operations on the run unit file repeated until a fatal file error occurred.
425
CODE FILE HAS EXCEEDED MAXIMUM POBJ CODE FILE SIZE
Type. Failure
Cause. The maximum size for a POBJ file has been exceeded.
431
NOT SUPPORTED
Type. Failure
Cause. Unsupported feature.
435
BLANK CONTINUATION LINE
Type. Warning
Cause. A continuation line is all blank.
436
ILLEGAL INDICATOR CHARACTER
Type. Warning
Cause. The indicator character is not valid on this line.
440
INCORRECT NUMBER OF PARAMETERS
Type. Error
Cause. Formal and actual parameter count do not match.
441
NAME CONFLICT
Type. Error
Cause. Two identifiers have the same name.
442
AMBIGUOUS REFERENCE
Type. Error
Cause. A reference is being made using a name which is satisfied by two or more
objects.
444
SYNTAX ERROR DETECTED AT TOKEN
Type. Error
Cause. Syntax error with no extra action.
445
SYNTAX ERROR - REPLACING UNEXPECTED TOKEN BY <token>
Type. Error
Cause. Syntax error repaired by replacing current token.
446
SYNTAX ERROR - INSERTING MISSING TOKEN
Type. Error
Cause. Syntax error repaired by inserting missing token.
447
SYNTAX ERROR - DELETING UNEXPECTED TOKEN
Type. Error
Cause. Syntax error repaired by deleting token.
448
PARSING RESUMED AT TOKEN
Type. Error
Cause. Syntax error repaired by discarding tokens in buffer up to current token.
449
END-OF-FILE ENCOUNTERED DURING ERROR RECOVERY
Type. Error
Cause. Syntax error; end of file encountered trying to recover.
453
ILLEGAL SENDING OR RECEIVING ITEM IN MOVE STATEMENT
Type. Error
Cause. The message applies to one of the following conditions:
• A numeric data item cannot be moved into an alphabetic data item.
• A non-integer numeric data item cannot be moved into an alphanumeric data item.
• An alphabetic data item cannot be moved into a numeric data item.
• A double-byte data item cannot be moved into a single-byte data item.
454
READ-ONLY SPECIAL REGISTER; MAY NOT BE ALTERED
Type. Error
Cause. The following special registers cannot be modified: PW-UNSOLICITED-
MESSAGE QUEUED, PW-TCP-PROCESS-NAME, and PW-TCP-SYSTEM-NAME.
455
UNABLE TO OPEN SCREEN COBOL LIBRARY FILE
Type. Error
Cause. The specified SCREEN COBOL library cannot be accessed. The library either
does not exist or could not be shared at compile time.
456
UNABLE TO LIST LOAD MAP
Type. Error
Cause. The object file cannot be opened to list the internal procedure load map.
457
UNDEFINED DATA NAME
Type. Error
Cause. The data item referred to is not described in the Environment Division or Data
Division.
458
ONLY A FILE NAME IS ALLOWED IN THIS CONTEXT
Type. Error
Cause. A valid Guardian operating environment file name is expected here.
459
ONLY A MNEMONIC NAME IS ALLOWED IN THIS CONTEXT
Type. Error
Cause. A system name (mnemonic-name) is required in this context.
460
NO CORRESPONDING DATA NAMES
Type. Error
Cause. No correspondence was found between the specified groups.
461
UNDEFINED OR AMBIGUOUS PROCEDURE ACCESS
Type. Error
Cause. Either a procedure name referred to in a PERFORM or GO TO statement was
not encountered in the source text, or the name was not sufficiently qualified to avoid
ambiguity.
462
ILLEGAL ALTER CANDIDATE
Type. Error
Cause. A procedure marked as altered is not a valid alter candidate.
463
INDEPENDENT SEGMENTS NOT SUPPORTED
Type. Error
Cause. SCREEN COBOL does not support independent segments.
464
ILLEGAL DATA ITEM IN IF STATEMENT
Type. Error
Cause. An operand in a conditional statement is an illegally defined data item; the
operand is defined as a numeric edited data item; or an attempt was made to use the IF
... DOUBLEBYTE statement to compare a PIC N data item or literal with a PIC 9
numeric data item.
465
ONLY A PROGRAM NAME IS ALLOWED IN THIS CONTEXT
Type. Error
Cause. A program name is expected here.
467
ONLY AN ALPHABET NAME IS ALLOWED IN THIS CONTEXT
Type. Error
Cause. The name specified must refer to an alphabetic name in this context.
468
EMPTY GO TO NOT LABELED
Type. Error
Cause. A GO TO statement of this form can only appear in a single statement
paragraph, which by definition is labeled.
470
EXPECT ELEMENTARY NUMERIC DATA ITEM IN THIS CONTEXT
Type. Error
Cause. A numeric data item is required in this context.
471
EXPECT GROUP DATA ITEM IN THIS CONTEXT
Type. Error
Meaning. Only a group data item is legal in this context.
472
INVALID TABLE SUBSCRIPT OR INDEX
Type. Error
Cause. The item is not a data item; indexes are not allowed.
473
TOO MANY OR TOO FEW PARAMETERS
Type. Error
Cause. The number of parameters specified in the USING phrase of a CALL statement
does not agree with the number specified in the USING phrase of the Procedure
Division header.
474
EXPECT A DATA WORD OR IDENTIFIER IN THIS CONTEXT
Type. Error
Cause. Only a data item can be used in a class condition.
475
CATEGORY MUST BE ALPHANUMERIC OR ALPHABETIC
Type. Error
Cause. The category of the data item must be alphanumeric or alphabetic in this
context.
476
CATEGORY MUST BE ALPHANUMERIC OR NUMERIC
Type. Error
Cause. The category of the data item must be alphanumeric or numeric in this context.
481
MISSING PROGRAM
Type. Error
Cause. A called program unit was neither found in a SCREEN COBOL program library
nor encountered in the source text.
485
EXPECT A TABLE SPECIFIER
Type. Error
Cause. The description of the data item must contain an OCCURS clause.
486
INCORRECT NUMBER OF SUBSCRIPTS OR INDICES
Type. Error
Cause. An incorrect number of subscripts, possibly zero, are used to access the data
item. (Indices are not allowed.)
487
REFERENCE DATA ITEM TOO LARGE
Type. Error
Cause. A data item has a PICTURE clause greater than 32,000 characters.
488
ONLY AN INDEX NAME IS ALLOWED IN THIS CONTEXT
Type. Error
Cause. Must be an index name to be used as an index.
489
AN UNEXPECTED ERROR OCCURRED WHILE BUILDING RUN UNIT
Type. Error
Cause. An irrecoverable I/O error occurred while building the object file. The
compilation must be restarted.
490
EXPECT AN INDEX NAME OR INDEX DATA ITEM
Type. Error
Cause. An index name or index data item is expected.
491
ILLEGAL USE OF INDEX NAME OR INDEX DATA ITEM
Type. Error
Cause. An index name or index data item is not allowed.
495
INVALID VARYING ITEM
Type. Error
Cause. The VARYING identifier in the PERFORM statement must be described as a
numeric elementary data item without any positions to the right of the assumed decimal
point.
498
ILLEGAL COMPARISON BETWEEN DISPLAY AND COMPUTATIONAL DATA
Type. Error
Cause. A comparison between a numeric computational data item and a nonnumeric
data item is illegal.
499
NON-INTEGER OR CONTAINS P'S
Type. Error
Cause. An integer data item containing no P symbols in its PICTURE clause is required
in this context.
500
EXPECT ALPHANUMERIC DATA ITEM
Type. Error
Cause. The data item must have an explicit or implied alphanumeric category.
501
EXPECT DISPLAY USAGE
Type. Error
Cause. The data item must have explicit or implied DISPLAY usage.
503
EXPECT LEVEL 01 OR 77 DATA ITEM
Type. Error
Cause. Only level 01 and level 77 data items can be specified in the USING phrase of a
CALL statement.
504
INVALID DISPLAY ITEM
Type. Error
Cause. An item is not defined in the Data Division.
507
INCONSISTENT OBJECT LIBRARY REFERENCES
Type. Error
Cause. A reference to a library is invalid because the library is not open or is otherwise
incorrect.
510
FEATURE NOT YET IMPLEMENTED
Type. Error
Cause. The program attempted to make use of a feature that is not yet available.
511
EXPECT A RECORD NAME
Type. Error
Cause. A record name is expected here.
515
INVALID OPERATOR OR OPERAND IN ARITHMETIC EXPRESSION
Type. Error
Cause. The expression contains operators other than + - / * (plus, minus, slash, or
asterisk) or contains one or more nonnumeric operands.
516
INVALID OPERATOR OR OPERAND IN CONDITIONAL EXPRESSION
Type. Error
Cause. The expression contains an illegal operator or illegal identifier form.
518
ILLEGAL TABLE OCCURRENCE NUMBER (BOUNDS VIOLATION)
Type. Error
Cause. An illegal occurrence number was detected.
523
ONLY INTEGER EXPONENTS ARE ALLOWED
Type. Error
Cause. A noninteger is being used as an exponent.
524
EXPONENT RANGE ERROR: ABS(EXPONENT) > 18
Type. Error
Cause. An exponent cannot be larger than 18.
525
RECORD MUST BE ASSOCIATED WITH SORT MERGE FILE
Type. Error
Cause. Record is not associated with sort merge file.
526
ONLY A SORT MERGE FILE IS ALLOWED
Type. Error
Cause. A sort merge file is expected here.
527
ONLY AN ELEMENTARY ALPHANUMERIC DATA ITEM IS ALLOWED
Type. Error
Cause. The data item referred to must be an elementary alphanumeric data item in this
context.
528
ILLEGAL USING FILE IN SORT OR MERGE
Type. Error
Cause. The using file is invalid in this context.
529
ILLEGAL DATA ITEM IN ARITHMETIC STATEMENT
Type. Error
Cause. An operand in an arithmetic statement is an illegally defined data item; the
operand is defined as a numeric edited data item.
530
DIVIDE BY ZERO
Type. Error
Cause. Division by a literal with a value of zero was detected in a DIVIDE or
COMPUTE statement.
531
ONLY A NUMERIC LITERAL IS ALLOWED
Type. Error
Cause. Only numeric literals and data items can be used in the composition of an
arithmetic expression.
540
VARIABLE LENGTH OR CONTAINS OCCURS CLAUSE
Type. Error
Cause. An OCCURS item cannot be used here.
544
INPUT AND OUTPUT PROCEDURES MUST BE SECTIONS
Type. Error
Cause. Input and output procedures must be sections.
545
ILLEGAL PERFORM INVOCATION
Type. Error
Cause. A statement generates an illegal implied or explicit transfer of control between
mutually exclusive sections. The statement is compiled as if the requested action were
legal.
545
ILLEGAL PERFORM INVOCATION
Type. Warning
Cause. A statement generates an illegal implied or explicit transfer of control between
mutually exclusive sections. The statement is compiled as if the requested action were
legal. The message applies to one of the following conditions:
• A debug section performs a declaration procedure.
• A nondebug declarative section performs a nondebug declarative procedure.
• A nondeclarative section performs a nondebug declarative procedure.
546
ILLEGAL GO TO INVOCATION
Type. Error
Cause. A statement generates an illegal implied or explicit transfer of control between
mutually exclusive sections. The statement is compiled as if the requested action were
legal. The message applies to one of the following conditions:
• A GO TO transfers between a declarative section and a nondeclarative section.
• A GO TO transfers between a debug section and a nondebug section.
546
ILLEGAL GO TO INVOCATION
Type. Warning
Cause. A statement generates an illegal implied or explicit transfer of control between
mutually exclusive sections. The statement is compiled as if the requested action were
legal.
551
MISSING USE STATEMENT
Type. Error
Cause. A USE statement is expected here.
552
MULTIPLE USE DEBUGGING PROCEDURE ASSIGNMENT
Type. Error
Cause. There are conflicting debugging specifications.
553
ILLEGAL ITEM FOR NUMERIC TEST
Type. Error
Cause. Alphabetic or group item with operational-sign subordinates is not valid here.
554
THIS ITEM CAN NOT BE DEBUGGED
Type. Error
Cause. This item is invalid for debugging.
558
ALPHABETIC ITEM NOT ALLOWED
Type. Error
Cause. Destination in an ACCEPT statement cannot be alphabetic.
559
TOO MANY VARYING PHRASES
Type. Error
Cause. The nesting level of a VARYING phrase is nested too deeply.
560
RECEIVING ITEM INCONSISTENT WITH SENDING ITEM
Type. Error
Cause. The source and destination data items are incompatible in a MOVE statement.
561
ONLY AN INTEGER ALLOWED IN THIS CONTEXT
Type. Error
Cause. A non-integer is used as a literal or as a subscript.
562
ITEM IS BOTH SUBSCRIPTED AND INDEXED
Type. Error
Cause. Subscripting and indexing are mutually exclusive.
563
INTEGER NOT IN EXPECTED RANGE
Type. Error
Cause. This is a generic error for integer values exceeding different limits depending on
the context.
564
EXPECT NUMERIC OR NUMERIC-EDITED DATA ITEM
Type. Error
Cause. A numeric item is expected here.
565
ACCESS TO DEBUG SPECIAL REGISTERS ALLOWED ONLY IN DEBUGGING
SECTIONS
Type. Error
Cause. Accessing debug special registers is not allowed while outside of debugging
section.
567
DEBUGGING SECTIONS MUST BE FIRST
Type. Error
Cause. A debugging section must be first.
568
ADDRESSING RANGE EXCEEDED
Type. Error
Cause. The sizes of the Working-Storage variables in a SEND statement cannot exceed
32,000 bytes; this applies both to the list of variables used for sending and for storing
the reply. The sum of the sizes in each list can be as large as 32,000 bytes, but no more.
569
SOURCE ITEM MAY NOT EXCEED 18 DIGITS
Type. Error
Cause. A MOVE statement attempts to store an alphanumeric literal exceeding
18 characters in a numeric item. Numeric data is limited to 18 digits.
573
PROTECTION ATTRIBUTE MAY NOT BE CHANGED
Type. Error
Cause. The PROTECTED attribute must not be changed for the T16-6510.
574
OVERLAY SCREEN LARGER THAN OVERLAY AREA
Type. Error
Cause. The overlay screen is larger than the overlay area.
575
ACCEPT TERMINATION MNEMONIC NAME MUST BE FUNCTION KEY
Type. Error
Cause. Display attributes must not be used to terminate an ACCEPT statement.
576
SERVER CLASS NAME MUST BE ALPHA OR ALPHANUMERIC
Type. Error
Cause. PATHCOM does not accept numeric server class names.
577
TURN MNEMONIC NAME MUST BE DISPLAY ATTRIBUTE
Type. Error
Cause. Function keys are not allowed in TURN statements.
578
MUST BE SCREEN NAME
Type. Error
Cause. Groups, overlay areas, and fields are not allowed in this context.
579
MUST BE BASE SCREEN NAME
Type. Error
Cause. Overlay screens must not be used in this context.
580
MUST BE OVERLAY SCREEN NAME
Type. Error
Cause. Base screens must not be used in this context.
581
MUST BE SCREEN ITEM
Type. Error
Cause. Data items are not allowed in this context.
582
SCREEN ITEM TOO CLOSE TO START OF SCREEN
Type. Error
Cause. The space preceding the first screen item is insufficient. For detailed
information on the rules for declaring screen fields, refer to the Compaq NonStop™
Pathway/iTS TCP and Terminal Programming Guide.
583
SCREEN ITEM TOO CLOSE TO END OF SCREEN
Type. Error
Cause. The space following the last screen item is insufficient.
584
SCREEN ITEM SPANS NOT-FULLWIDTH OVERLAY AREA LINE
Type. Error
Cause. A screen item cannot span an overlay screen line when that overlay screen is
narrower than the base screen.
585
SCREEN ITEM OVERLAPS OR IS TOO CLOSE TO NEXT ITEM
Type. Error
Cause. Required separation between screen elements is not present.
586
SCREEN ITEM OVERLAPS OR IS TOO CLOSE TO PREVIOUS ITE
Type. Error
Cause. Required separation between screen elements is not present.
587
SCREEN ITEM WITHOUT OCCURS CLAUSE IS SUBSCRIPTED
Type. Error
Cause. Only a screen item with an OCCURS clause can be subscripted.
588
SCREEN ITEMS MAY HAVE ONE (1) SUBSCRIPT ONLY
Type. Error
Cause. A screen item with an OCCURS clause is considered to be a single table.
589
SCREEN ITEM SUBSCRIPT TOO LARGE
Type. Error
Cause. The subscript exceeds the count of screen items.
590
SCREEN ITEM SUBSCRIPT MUST BE INTEGER
Type. Error
Cause. All subscripts must be integers.
591
MUST BE OVERLAY AREA SCREEN NAME
Type. Error
Cause. The overlay area following the AT clause in a DISPLAY OVERLAY statement
is not defined as an overlay area.
592
'LENGTH MUST BE' VALUE MUST BE LESS THAN 256
Type. Error
Cause. The maximum value that can be specified in a LENGTH MUST BE clause
is 255.
593
INCORRECT NUMBER OF OPERANDS IN ARITHMETIC EXPRESSION
Type. Error
Cause. An arithmetic expression contains either too many or too few operands.
594
SCALE OF MUST BE VALUE EXCEEDS SCALE OF ASSOCIATED DATA ITEM
Type. Error
Cause. A numeric literal named in the MUST BE clause contains too many digits to the
right of the decimal.
595
MUST BE VALUE TOO LARGE FOR ASSOCIATED DATA ITEM
Type. Error
Cause. A numeric literal named in the MUST BE clause exceeds the size of the data
item PICTURE clause.
596
TYPE OF MUST BE VALUE IS INCOMPATIBLE WITH ASSOCIATED DATA
ITEM
Type. Error
Cause. The type of literal named in the MUST BE clause does not match the associated
data item. A numeric literal must be associated with a numeric data item;
a nonnumeric literal must be associated with a nonnumeric data item.
597
QUALIFIED NAME TOO LONG - CROSSREF LINE WILL BE TRUNCATED
Type. Warning
Cause. During compilation, SCOBOLX builds fully qualified names to send to
CROSSREF. A name exceeded the length of the buffer and will appear in the
CROSSREF listing in truncated form. This might occur with multiple levels of
qualification.
598
MUST NOT BE OVERLAY AREA NAME
Type. Error
Cause. An overlay area name is not allowed in this context.
599
EXPECT LEVEL 01 MESSAGE NAME
Type. Error
Cause. Compiler is looking for an 01-level message entry or data item; this message or
data item has higher level number.
600
EXPECT DATA ITEM OR MESSAGE NAME
Type. Error
Cause. Compiler expects specified name to identify an existing 01-level data item or
message entry.
601
THIS VERB IS NOT LEGAL WHEN 'TERMINAL IS INTELLIGENT'
Type. Error
Cause. You cannot use this verb in a SCREEN COBOL program that runs in a Pathway
environment where terminal type was specified as INTELLIGENT in a SET TERM,
SET PROGRAM, or RUN PROGRAM command.
602
THIS VERB IS NOT LEGAL WITHOUT 'TERMINAL IS INTELLIGENT'
Type. Error
Cause. In order to use this verb, you must specify terminal type as INTELLIGENT in a
SET TERM, SET PROGRAM, or RUN PROGRAM command.
603
MESSAGE FORMAT MUST BE THE SAME IN ALL REPLIES
Type. Error
Cause. All replies must have the same message format.
604
REPLY CODE FIELD MUST BE WORKING-STORAGE ITEM
Type. Error
Cause. The REPLY CODE FIELD IS clause specified within a SEND MESSAGE
statement referenced a field that is not in Working-Storage.
605
ITEMS IN TRANSFORM LIST MUST BE ALL OF THE SAME TYPE
Type. Error
Cause. All items specified in either the input or output list of a TRANSFORM
statement must be the same type, all Working-Storage or all Message Section items.
606
'MUST BE' AGGREGATE LENGTHS GREATER THAN 768 BYTE MAXIMUM
Type. Error
Cause. The total length, in bytes, of the literals specified in a Screen Section MUST BE
clause plus 1 byte for each literal specified cannot exceed 768 bytes.
607
VARYING1 255-BYTE MAXIMUM LENGTH EXCEEDED
Type. Error
Cause. A message of VARYING1 format has a maximum length of 255 bytes.
608
ILLEGAL FIGURATIVE CONSTANT SPECIFIED IN MOVE TO DBCS ITEM
Type. Error
Cause. An attempt was made to move a figurative constant other than SPACE or
SPACES to a double-byte data item.
609
QUOTED LITERAL STRING CONTAINS NON-DBCS IN MOVE TO DBCS ITEM
Type. Error
Cause. An attempt was made to move a quoted literal string containing non-double-
byte characters to a PIC N data item.
610
ILLEGAL DATA ITEM OR LITERAL IN DOUBLEBYTE TEST
Type. Error
Cause. An attempt was made to use the IF ... DOUBLEBYTE statement on data items
that are not PIC X, PIC A, or PIC N.
611
SCREEN ITEM REQUIRES 'AT <OVERLAY>' QUALIFIER
Type. Error
Cause. Screen item needs AT <OVERLAY> in this context.
612
MUST BE ELEMENTARY SCREEN ITEM
Type. Error
Cause. Only an elementary screen item is valid in this context.
613
SELECT or REPLY CODE ITEM HAS BEEN SYNCHRONIZED
Type. Warning
Cause. A SELECT or REPLY CODE item is synchronized.
614
CURSOR WITHIN CLAUSE USED WITH SCREEN FIELD THAT WRAPS
Type. Warning
Cause. This screen field wraps.
615
MNEMONIC USED MUST BE A DISPLAY VIDEO ATTRIBUTE
Type. Error
Cause. A display video attribute is expected here.
616
'CODE OTHER' MUST BE LAST STMT IN REPLY CODE LIST OF SEND
Type. Error
Cause. In a set of yield groups belonging to any one SEND statement the yield group
containing OTHER must be last.
617
THERE CAN ONLY BE ONE 'CODE OTHER' IN A SEND CLAUSE
Type. Error
Cause. There is more than one OTHER in a SEND statement.
618
THERE IS AN ERROR IN THIS ACCEPT STATEMENT
Type. Error
Cause. This ACCEPT statement is missing a clause such as FROM, TO, and so on.
619
A PROMPT IS NOT ALLOWED IN BLOCK MODE
Type. Error
Cause. Block mode programs cannot use the PROMPT clause.
620
THE MAXIMUM NUMBER OF REPLY CODES PER YIELD GROUP IS 255
Type. Error
Cause. Each yield group can have at most 255 reply codes.
Cause. A file-system error occurred during an input or output operation. This error
applies to the following statements:
• SEND MESSAGE statement
• RECEIVE UNSOLICITED MESSAGE statement
• REPLY TO UNSOLICITED MESSAGE statement
Effect. TERMINATION-SUBSTATUS contains the file system error number.
If no ON ERROR clause is specified, the system suspends the program unit with a fatal
error. The TCP error is logged to the PATHMON log file.
If no ON ERROR clause is specified, the system suspends the program unit with a fatal
error. The TCP error is logged to the PATHMON log file.
Cause. The message received was larger than 32,000 bytes. This error applies to the
following statements:
• SEND MESSAGE statement
• TRANSFORM statement
Effect. If no ON ERROR clause is specified, the system suspends the program unit with
a fatal error. The TCP error is logged to the PATHMON log file.
Cause. The assembled message for output was larger than 32,000 bytes. This error
applies to the following statements:
• SEND MESSAGE statement
• TRANSFORM statement
Effect. If no ON ERROR clause is specified, the system suspends the program unit with
a fatal error. The TCP error is logged to the PATHMON log file.
Cause. In the PATHCOM SET TERM command, the TYPE parameter is specified by
terminal-type : terminal-subtype. For terminal-type
INTELLIGENT, terminal-subtype was a value other than 0 or 1.
This error applies to the SEND MESSAGE statement.
Effect. If no ON ERROR clause is specified, the system suspends the program unit with
a fatal error. The TCP error is logged to the PATHMON log file.
Cause. An illegal timeout value was specified for the statement. The illegal value is
either lesser than zero or greater than 21474836. This error applies to the following
statements:
• SEND MESSAGE statement
• RECEIVE UNSOLICITED MESSAGE statement
Effect. If no ON ERROR clause is specified, the system suspends the program unit with
a fatal error. The TCP error is logged to the PATHMON log file.
Cause. An invalid end-of-message was detected. This error is returned only for
messages that are mapped through the Message Section. This error applies to the
following statements:
• SEND MESSAGE statement
• RECEIVE UNSOLICITED MESSAGE statement
Effect. For unsolicited messages, the message is rejected. An error 10 (COULD NOT
DELIVER) is returned by the sender of the unsolicited message.
If no ON ERROR clause is specified, the system suspends the program unit with a fatal
error. The TCP error is logged to the PATHMON log file.
Cause. The data in a particular message field was too large to be mapped through the
corresponding field in the Message Section template. This error applies to the following
statements:
• SEND MESSAGE statement
• TRANSFORM statement
• REPLY TO UNSOLICITED MESSAGE statement
Effect. If no ON ERROR clause is specified, the system suspends the program unit with
a fatal error. The TCP error is logged to the PATHMON log file.
Cause. The message that you attempted to send was longer than 12,288 bytes. This
error applies to the following statements:
• SEND MESSAGE statement
• TRANSFORM statement
Effect. If no ON ERROR clause is specified, the system suspends the program unit with
a fatal error. The TCP error is logged to the PATHMON log file.
Cause. An unsolicited message arrived. The file system reported an I/O error while
attempting to terminate an outstanding READ operation. This error applies to the
SEND MESSAGE statement.
Effect. TERMINATION-SUBSTATUS contains the error. If no ON ERROR clause is
specified, the system suspends the program unit with a fatal error. The TCP error is
logged to the PATHMON log file.
Cause. An edit error was detected while the TCP was building the output message.
This error applies to the following statements:
• SEND MESSAGE statement
• TRANSFORM statement
• REPLY TO UNSOLICITED MESSAGE statement
Effect. A TERMINATION-SUBSTATUS of 15 is returned only for messages mapped
through the Message Section. If no ON ERROR clause is specified, the system
suspends the program unit with a fatal error. The TCP error is logged to the PATHMON
log file.
Cause. An attempt was made to receive an unsolicited message but no reply has been
made to the previous message. This error applies to the RECEIVE UNSOLICITED
MESSAGE statement.
Effect. If no ON ERROR clause is specified, the system suspends the program unit with
a fatal error. The TCP error is logged to the PATHMON log file. The SCREEN
COBOL program unit needs to execute the REPLY TO UNSOLICITED MESSAGE
statement.
Cause. The output (source) record was longer than the input (destination) record
specified in the YIELDS list. This error applies to the TRANSFORM statement.
Effect. If no ON ERROR clause is specified, the system suspends the program unit with
a fatal error. The TCP error is logged to the PATHMON log file.
Cause. The output (source) record was shorter than the input (destination) record
specified in the YIELDS list. This error applies to the TRANSFORM statement.
Effect. If no ON ERROR clause is specified, the system suspends the program unit with
a fatal error. The TCP error is logged to the PATHMON log file.
Cause. A message field’s occurrences exceed its related Working-Storage data item’s
maximum occurrences.
Effect. If no ON ERROR clause is specified, the system suspends the program unit with
a fatal error. The TCP error is logged to the PATHMON log file.
Cause. A file system error has occurred on the performance statistics collection file.
Effect. The performance statistics collection process is suspended.
Cause. The TCP statistics gathering process has started; a result of issuing a START
TCP or CONTROL <tcp-name> MEASURE ON command.
Effect. None
Cause. The TCP statistics gathering process has stopped; a result of issuing a
CONTROL <tcp-name> MEASURE OFF command while in operation.
Effect. None.
If you are using the Data Definition Language (DDL) utility to describe your files, you
might not need these tables. See the Data Definition Language (DDL) Reference
Manual for more information.
Input-control L
character clauses
Language elements
ABORT-INPUT 5-30
character set 2-4
END-OF-INPUT 5-31
character strings 2-4
FIELD-SEPARATOR 5-31
punctuation characters 2-5
GROUP-SEPARATOR 5-32
separators 2-4, 2-6
RESTART-INPUT 5-33
Language elements (editing characters) 2-5
characters 5-23
LEFTLINE 4-8, 4-10
Input-Output screen fields 5-28
LENGTH clause 5-41
Input-Output Section 4-10
Less than (<) 2-4
Inspect symbolic debugger 1-7
Level numbers 5-5
Intelligent device support 4-3, 6-5
Limits
Intelligent devices
for SCREEN COBOL compiler 7-19
described 1-3
on number of characters in screen input
Message Section 2-2 field 5-41
Intelligent mode programs 2-2 LINES compiler command 7-12
Intermediate results, arithmetic Linkage Section 5-2, 5-3
operations 2-16
data description entries 5-6
Interprocess communication 1-7
LIST compiler command 7-12
Interprocess message
Literal screen fields 5-28
correspondence 1-5
Literals
sample SEND 6-73
defined 2-7
Interprogram communication 6-5
in arithmetic expressions 2-15
Item size 5-49, 5-80
Logical operators 2-21
I/O operations for PRINT SCREEN
statement 6-59 LOGICAL-TERMINAL-NAME special
register 5-94
LOW-VALUE/LOW-VALUES (figurative
J constants) 2-9
Julian date 6-14
JUSTIFIED clause 2-9, 2-29, 5-8 M
Managing object code 1-10
K MAP compiler command 7-12
Kanji characters 2-4, 4-5 MDT (modified data tag)
KANJI-KATAKANA 2-4, 4-5 CLEAR statement 6-28
Katakana characters 2-4, 4-5 described 6-13
Keywords, reserved words 2-6 SHADOW bits 5-53
Tab key 5-40
MDTOFF 4-8
MDTON 4-8, 4-9, 5-53