RM COBOL Win 70 Manual
RM COBOL Win 70 Manual
RM COBOL Win 70 Manual
User’s Guide
®
Version 7.0 for 32-Bit Windows
This manual is a user’s guide for Liant Software Corporation’s RM/COBOL language.
It is assumed that the reader is familiar with programming concepts and with the COBOL
language in general.
The information in this document is subject to change without prior notice. Liant
Software Corporation assumes no responsibility for any errors that may appear in this
document. Liant reserves the right to make improvements and/or changes in the products
and programs described in this guide at any time without notice. Companies, names, and
data used in examples herein are fictitious unless otherwise noted.
The software described in this document is furnished to the user under a license for a
specific number of uses and may be copied (with inclusion of the copyright notice) only
in accordance with the terms of such license.
_____________________
The RM/COBOL operating procedures described in this manual are for use on Microsoft
32-bit Windows and UNIX-based systems that support remote file access using Novell
NetWare (version 3.11 and above), Client for Microsoft Networks, or Btrieve software.
Note 1 Beginning with version 6.5, the -85 suffix is no longer a part of the RM/COBOL
product name. The -85 suffix was used to reflect current technology and to avoid
confusion with an earlier product named RM/COBOL, which referred to the 1974 ANSI
standard version. Support for RM/COBOL (74) ceased on December 31, 1994.
Note 2 The term “Windows” in this document refers to Windows 95, Windows 98, or
Windows NT, unless specifically stated otherwise.
What's New
The following section summarizes the major enhancements available in RM/COBOL
version 7.0 for Windows. This summary describes the main features of each
enhancement. The RM/COBOL Language Reference Manual and this user’s guide
contain the details regarding these features.
xxvi Preface
What's New
A library of P$ subprograms (described in Appendix E, Windows Printing) and two
Windows registry properties, Printer Dialog Always and Printer Dialog Never (see
Chapter 3, Installation and System Considerations for Microsoft Windows), have been
added to allow developer control of this dialog box. The RM/COBOL for Windows
compiler can use this capability to select the printer for the listing file.
The RM/COBOL for Windows runtime also has been enhanced to support raw mode
printing, which is useful when printing with escape sequences to a Windows NT network
printer. Limited support for Windows printers via escape sequences is provided as well
(see also Appendix E).
• C$Delay relinquishes the CPU for a specified length of time (in seconds).
• C$GetSyn and C$SetSyn retrieve and set, respectively, the values of RM/COBOL
synonyms used in the Windows registry file.
• C$Show sets the show state of the main RM/COBOL window (rmguife.exe).
• Support for Large Files. The runtime system allows RM/COBOL 7.0 files to grow
past limits imposed in previous versions. On Windows 95 and Windows 98, files up
to 4 GB (gigabytes) are supported. Windows NT supports multiple terabyte files on
the NT file system. Only files on FAT32 (Windows 95 and Windows 98 file system
format) or NTFS (Windows NT file system) may be larger than 2 GB.
xxviii Preface
What's New
• Runtime Registration. The RM/COBOL version 7.0 for Windows runtime now
consists of two components: a client (runcobol.exe) and a server (rmcblrun.dll).
The client component is completely compatible with previous versions of the
runcobol.exe program—no command line changes are required. The server DLL,
however, must be registered with Windows before RM/COBOL programs can be run.
This is automatically performed during program installation and is an issue only if
the runtime is moved to a different directory without being installed again. In this
case, the client can be used to reregister the server. See the installation procedures in
Chapter 3, Installation and System Considerations for Microsoft Windows.
• More Flexible Filenames. Two new options have been added to the
RUN-FILES-ATTR configuration record. The ALLOW-EXTENDED-CHARS-IN-
FILENAMES keyword allows extended characters in filenames. The ENABLE-
OLD-DOS-FILENAME-HANDLING keyword supports the way in which filenames
are handled in the old DOS-style 8.3 format. See Chapter 10 for further details.
• New Reserved Words. To support some of the features described in the following
paragraphs, the reserved words list has been extended with the following new words:
ADDRESS, CENTURY-DATE, CENTURY-DAY, COUNT-MAX, COUNT-MIN,
DATE-AND-TIME, DAY-AND-TIME, NULL, NULLS, and RETURNING.
Note that if you use these reserved words as user-defined words, you must either
change the spelling of these user-defined words or use the DERESERVE keyword in
the COMPILER-OPTIONS configuration record.
xxx Preface
What's New
• POINTER Data Types. The POINTER data type has been added. Pointer data
items can be used to point to other data items in the program or in allocated memory.
Support for pointer data items includes the NULL and NULLS figurative constants,
which are pointer literals with a null pointer value. There are two new formats of the
SET statement to manipulate pointer data items and an ADDRESS OF special
register for obtaining the address of a data item as a pointer value. A non-null
pointer refers to an area of memory that may be accessed in COBOL by setting the
base address of a level-number 01 or 77 data item described in the Linkage Section
of the program to the pointer value. Dynamic memory allocation is supported by two
new subprograms in the provided library, C$MemoryAllocate and
C$MemoryDeallocate.
• In-Line Comments. The compiler now supports the *> symbol as an in-line
comment introducer. Any characters on the same source record following *> will be
treated as commentary. The *> symbol must be preceded by a space separator.
• OMITTED Arguments. The compiler now supports the keyword OMITTED in the
USING list of a CALL statement. Since arguments are positional, this feature allows
an argument to be omitted from other than the end of the USING list.
This also means that a program can call the supplied subprogram C$CARG with an
argument that the calling program omitted without getting a data reference error. In
this case, the call to C$CARG will succeed and return an argument descriptor that
includes a type of OMITTED and a length of zero. In the case of reference
modification, an omitted actual argument would cause a data reference error, but for
an argument that is not omitted, the reference modification can use any offset and
length combination that is consistent with the actual argument. Previous to this
enhancement, reference modification that used variables implied a reference to the
item as described in the Linkage Section for the formal argument data item and this
xxxii Preface
What's New
implied reference, if larger than the corresponding actual argument, would cause a
data reference error before the reference modification was applied.
• New Listing Date Formats. The compilation listing date format can now be
configured to include four-digit years with the new format values DDMMYYYY,
MMDDYYYY, YYYYMMDD, and YYYYDDD. The default listing date format
has been changed to MMDDYYYY so that a four-digit year will be used by default.
This change also included making the DATE-COMPILED paragraph use the same
date format as the compilation listing header.
• Enhanced Debugging Options. The Y Compile Command Option has two new
variations that direct the compiler to embed additional debugging information in the
program object file. The additional debugging information allows CodeWatch to
display the program source during execution without requiring that the program be
compiled under Enterprise CodeBench. See the description of the Y compiler
command line option in Chapter 6, Compiling, and the DEBUG-TABLE-OUTPUT
keyword in the COMPILER-OPTIONS configuration record, as detailed in
Chapter 10, Configuration.
Chapter 7—Running details the RM/COBOL Runtime Command, runcobol, and its
options, and defines the types of errors that can be encountered during program
execution. It also lists the messages generated as a result.
Chapter 9—Debugging presents general debug concepts and a detailed discussion of the
Debug commands.
xxxiv Preface
Organization of Information
Chapter 11—Instrumentation details the data-gathering Instrumentation facility. It
also describes a sample data analysis program—provided with Instrumentation—called
analysis.
Appendix A—Runtime Messages lists and defines the messages that may be generated
during program execution.
Appendix G—Utilities describes the full range of file conversion, management, and
manipulation facilities.
Appendix H—Object Versions lists the new object features that are incompatible with
earlier releases of RM/COBOL.
Appendix J—Code-Set Translation Tables lists each ASCII and EBCDIC hexadecimal
value and its corresponding numeric, alphabetic or control character.
The RM/COBOL User’s Guide for 32-Bit Windows also includes an index.
xxxvi Preface
Related Publications
Conventions and Symbols
The following conventions and symbols are used or followed throughout this guide.
1. Words in all capital letters indicate COBOL reserved words, such as statements,
phrases, and clauses; acronyms; configuration keywords; environment variables; and
RM/COBOL Compiler and Runtime Command line options.
Bold type style is also used for emphasis on some types of lists.
3. Text that is displayed in a monospaced font indicates user input or system output
(according to context as it appears on the screen). This type style is also used for
sample command lines, program code and file listing examples, and sample sessions.
4. Italic type identifies the titles of other books and the names of chapters in this guide,
and it occasionally is used for emphasis.
In syntax, italic type denotes a placeholder or variable for information you supply, as
described in the following item.
5. The symbols found in the syntax charts are used as follows:
italicized words indicate items for which you substitute a specific value
UPPERCASE WORDS indicate items that you enter exactly as shown (although
not necessarily in uppercase)
... indicate indefinite repetition of the last item
| separate alternatives
[ ] surround optional items
{ } surround a set of alternatives, one of which is required
{| |} surround a set of unique alternatives, one or more of
which is required, but each alternative may be specified
only once; when multiple alternatives are specified, they
may be specified in any order.
13. Key combinations with a plus sign between key names indicate to press and hold
down the first key while pressing the second key. For example, “Press Alt + Esc”
means to press and hold down the Alt key and press the Escape key. Then release
both keys. A comma between key names means to press and release the keys one
after the other.
xxxviii Preface
Conventions and Symbols
Registration
Please take a moment to fill out and mail (or fax) the registration card you received with
RM/COBOL. You can also complete this process by registering your Liant product
online at: http://www.liant.com.
• Special upgrades. Free media updates and upgrades within 60 days of purchase.
You can also receive up-to-date information about Liant and all its products via our web
site. Check back often for updated content.
Technical Support
Liant Software Corporation is dedicated to helping you achieve the highest possible
performance from the RM/COBOL family of products. The technical support staff is
committed to providing you prompt and professional service when you have problems or
questions about your Liant products.
These technical support services are subject to Liant’s prices, terms, and conditions in
place at the time the service is requested.
While it is not possible to maintain and support specific releases of all software
indefinitely, we offer priority support for the most current release of each product. For
customers who elect not to upgrade to the most current release of the products, support is
provided on a “limited" basis, as time and resources allow.
Support Guidelines
When you need assistance, you can expedite your call by having the following
information available for the technical support representative:
1. Company name, support contract, partner, ADR, or distributor number.
2. Liant product serial number (found on the media label, registration card, or product
banner message).
7. Concise explanation of the problem and process involved when the problem
occurred.
Test Cases
You may be asked for an example (test case) that demonstrates the problem. Please
remember the following guidelines when submitting a test case:
• The smaller the test case is, the faster we will be able to isolate the cause of the
problem.
• Reduce the test case to one or two programs and as few data files as possible.
• If you have very large data files, write a small program to read in your current data
files and to create new data files with as few records as necessary to reproduce the
problem.
• Test the test case before sending it to us to ensure that you have included all the
necessary components to recompile and run the test case. You may need to include
an RM/COBOL configuration file.
When submitting your test case, please include the following items:
1. README text file that explains the problems. This file must include information
regarding the hardware, operating system, versions of all relevant software (including
the operating system and all Liant products). It must also include step-by-step
instructions to reproduce the behavior.
2. Program source files. We require source for any program that is called during the
course of the test case. Be sure to include any copy files necessary for recompilation.
3. Data files required by the programs. These files should be as small as possible to
reproduce the problem described in the test case.
xl Preface
Technical Support
Version 6.6 Enhancements
The new compiler also offers additional statistics regarding the use of memory during
compilation. The message helps the user establish a proper setting of the workspace size
compiler option (W command line option and WORKSPACE-SIZE keyword of the
COMPILER-OPTIONS configuration record). The message is now part of the Program
Summary Statistics portion of the listing. Here is an example of the message:
xlii Preface
Version 6.6 Enhancements
Version 6.5 Enhancements
The following section summarizes the major enhancements available in version 6 of
RM/COBOL. This summary describes the main features of each enhancement. The
RM/COBOL Language Reference Manual and this user’s guide contain the details
regarding these features.
Note The Initialization File to Windows Registry utility (ini2reg.exe), available only in
Windows, converts an RM/COBOL for Windows initialization file and places its contents
into the registry database.
xliv Preface
Version 6.5 Enhancements
rmbtrv32 supports the following RM/COBOL version 6 features: split keys, duplicate
prime keys, multiple record locks, record lock timeouts, and START with FIRST or
LAST. In addition, rmbtrv32 supports the RUN-INDEX-FILES DATA-COMPRESSION
and BLOCK-SIZE keywords, and rmbtrv32 returns expanded error codes for better error
reporting. rmbtrv32 also supports selected features of Btrieve version 6 and 6.1 files as
well as Btrieve version 6.15 MicroKernel Database Engines. rmbtrv32 supports the
Btrieve maximum of 119 key segments, repeating duplicates, and the no currency change
(NCC) option on insert and update operations.
Using repeating duplicates along with the NCC option should eliminate the possible
position-lost errors that could occur when a second user deleted records as the first user
was reading through them.
rmbtrv32 allows pre-created Btrieve files that have multiple alternate collating sequences
(ACS) defined, although all Btrieve keys that map to RM/COBOL keys must use ACS
number zero since COBOL defines one ACS per file.
See Chapter 4, System Considerations for Btrieve, for further information on these
features.
• The ability to display the last 98 or 30 error received when accessing the file, and the
date and time it occurred.
• An option that allows the Open For Modify Count to be reset without performing a
full recovery.
xlvi Preface
Version 6.5 Enhancements
Dynamically Configurable Prompt Character
ACCEPT statements may now specify a prompt character in the CONTROL phrase. The
specified character is used for that ACCEPT statement only; the default prompt character
is not changed. The PROMPT keyword is described under “CONTROL Phrase” in
Chapter 8, RM/COBOL Features.
• RM/COBOL implements file and record locks through region locks. The algorithm
for computing the region to be locked is unique to RM/COBOL. This means that the
OPEN and READ statements only lock out other RM/COBOL applications; an
application not using the RM/COBOL file system can still access data in locked files.
This may cause inconsistent data when a file is shared between RM/COBOL
applications and other applications.
• RM/COBOL implements the WITH LOCK phrase of the OPEN statement and the
WITH NO LOCK phrase of the READ statement by applying region locks to
segments of the file. To ensure consistent results and to improve performance when
the WITH LOCK phrase is specified, the runtime system must recognize when two
distinct filenames identify the same file. This is accomplished under Windows by
resolving the user filename into a fully specified filename, including the remote
machine name when the file is remote. If a remote file resides on a UNIX server
accessed by Network File System (NFS), however, two very different filenames can
be associated with a single file through the ln command. This can cause a Windows
client program to read invalid data from the file or to diagnose file integrity errors.
Deficiencies that are version-specific or are discovered after printing are described in the
README files contained on the delivered media.
xlviii Preface
Deficiencies
Chapter 1: Introduction
This introductory section of the RM/COBOL User’s Guide provides an overview of the
RM/COBOL product. It explains the general concepts of the RM/COBOL compiler and
runtime system and how they are used, lists the additional add-on development tools that
are available to support RM/COBOL programs, describes how to rename program
executables, and explains file naming conventions.
RM/COBOL Software
RM/COBOL, delivered on appropriate media, contains a large number of individual
files and programs. The actual number of files and programs depends on the specific
version of the product you purchased and whether you purchased a development or a
runtime-only system. The delivered media contains one or more README files, which
list the actual files and programs delivered. Please check these README files after you
have installed the product to make sure that you have received all of the appropriate files
and programs.
RM/COBOL Compiler
The RM/COBOL compiler reads COBOL source code and produces object files that can
be executed using the runtime system. These object files are portable, and they can be
executed by an RM/COBOL runtime system on many computer configurations—even
computer configurations that are different from the one used to compile the object files.
For more information on compiling COBOL programs, see Chapter 6, Compiling.
CodeBridge
CodeBridge is a cross-language call system included with the RM/COBOL development
system. This facility simplifies communication between COBOL programs and non-
COBOL subprograms (such as those written in C or C++). CodeBridge allows COBOL
programmers to call external APIs or custom-developed subprograms without introducing
“foreign” language and data dependencies into their programs. For more information, see
the CodeBridge manual.
There are several utility programs delivered with RM/COBOL. These utility programs
are used to manage and manipulate both data files and RM/COBOL object files. For
more information on the utility programs, see Appendix G, Utilities.
1-2 Introduction
CodeWatch
Add-On Packages
Several add-on packages are available from Liant Software Corporation to support
RM/COBOL programs. They include the following:
• VanGui Interface Builder. An interface builder that allows Visual Basic and
Delphi to serve as graphical user interface (GUI) front-ends to COBOL programs
running across a network.
In order to more gracefully handle renamed executables, the message filename may be the
same as the root name of the executable or the default name. In a standard installation,
for example, the RM/COBOL runtime will first search for a runcobol.msg file. If one
can not be found, the runtime system will search for a RUN.MSG file. If the runtime
executable were renamed to myapp (myapp.exe for DOS and Windows), the
RM/COBOL runtime would first search for myapp.msg.
The Windows version of RM/COBOL, like Windows 95, Windows 98, and
Windows NT, supports long filenames and filenames containing embedded spaces.
RM/COBOL filenames can be enclosed in quotation marks (ASCII code 22 hex).
RM/COBOL filenames containing embedding spaces must be enclosed in quotation
marks to avoid having the embedded spaces interpreted as separators. For example:
Note Although Windows 95, Windows 98, and Windows NT store long filenames with
case preserved, filenames are always compared and searched for in a case-insensitive
manner (that is, filenames that differ only in whether letters are uppercase or lowercase
refer to the same physical file).
RM/COBOL uses the extensions .cbl, .cob, and .lst to designate the source, object and
listing files of a program. This allows all three files to reside in the same directory.
These extension names may be changed with the EXTENSION-NAMES configuration
record (see page 10-19).
Source files do not need to have an extension of .cbl; in fact, they do not need an
extension at all. If the compiler cannot locate the source file with the name given and the
name does not have an extension, it will try to locate the file again, using first .cbl as an
extension to the filename and then .CBL.
1-4 Introduction
Renaming Executables
The RM/COBOL compiler always creates object and listing files with extensions. It will
either replace the current extension of the source file, or append an extension if the source
filename does not have one. The case of the extension will match the case of the first
character of the source file’s extension, or the first character in the source file’s name if
there is no extension. If there is no extension and the first character of the source
filename is not a letter, the extension will be lowercase.
The RM/COBOL runtime system does not require object files to have an extension of
.cob. However, since the compiler generates objects with the .cob extension, the
runtime system will try to locate object files by adding first .cob and then .COB, but
only if the original filename does not already have an extension. Table 1-1 contains
sample filenames.
Your computer configuration is the assembled set of hardware and software that makes up
your system. Before you can develop or run RM/COBOL programs, your configuration
must meet or exceed the requirements set forth in this chapter.
System Requirements
The version of RM/COBOL that you have purchased is for a particular combination of
hardware and operating system. Several items listed below vary depending on the actual
version of the product that you have purchased.
Required Hardware
• Memory. The amount of memory depends on the specific version of the product that
you have purchased.
• Hard Disk. A hard disk drive is required for installing this product. The amount of
space required is version-specific. The average minimum disk space required to
install this product is 3 megabytes (3 MB) for a development system and 2.5
megabytes (2.5 MB) for a runtime system.
• Removable Media. Some form of removable media (magnetic tape or floppy disk)
is required for installing this product. The type of media is version-specific.
The delivered media contains compressed files. This allows Liant to use fewer floppies in
a distribution set and also speeds up the install time. The files are compressed or
decompressed using the GNU gzip and gunzip programs. A copy of these programs or
the source is available from the Free Software Foundation (FSF), which can be accessed
from CompuServe (using GO UNIXFORUM) or from the Internet (using “anonymous
ftp” from prep.ai.mit.edu). The COPYING.gnu file is a copy of the GNU General Public
License. Use the cat or pg commands to review the file contents. If you do not have
access to these online services, FSF provides a copy of the source for a minimum media
handling charge. A copy of the source also may be obtained from Liant Software
Corporation.
Note Installation information specific to your UNIX system can be found on the media
label.
1. Log in as root.
2. The amount of disk space required to install this product is noted on the media
envelope label. You can check the availability of space on your system by executing
the following command:
df
3. Create an empty directory in which you want to install RM/COBOL. For example:
mkdir /usr/rmcobol
cd /usr/rmcobol
4. Copy the contents of the distribution media (all volumes) onto your hard disk. Use
the cpio command on the distribution media to copy the files.
5. Issue the following command to install RM/COBOL. This command performs the
necessary steps to copy the proper files into the system command directory (/usr/bin)
and to decompress the data files.
./rminstall
RM/COBOL is distributed with a default configuration that will satisfy your system
requirements. Configuration options for your system are found in Chapter 10,
Configuration.
Specifying a directory path with a leading slash or tilde indicates to RM/COBOL that an
exact filename has been specified. If RM/COBOL cannot find the file in the specified
location, it will not look elsewhere. If you do not specify a directory path, and
RM/COBOL cannot find the file relative to the current directory, it will search for the file
according to the directory search sequence. If a directory path is specified, but there is no
leading slash or tilde, then the EXPANDED-PATH-SEARCH keyword of the
RUN-FILES-ATTR configuration record determines whether the directory search
sequence will be used. When the configuration keyword is set to its default value of NO,
the directory search sequence will not be used (see page 10-27). If the value is set to
YES, then the entire name, including the directory path, will be appended to each entry in
the directory search sequence in an attempt to locate the file.
The tilde (~) character at the beginning of a pathname is used to refer to home directories.
Standing alone, it expands to the user’s home directory as reflected in the environment
variable HOME. When followed by a name consisting of letter and digit characters, the
name identifies the user whose home directory should be used.
To direct the RM/COBOL compiler to use the directory search sequence, set the
environment variable RMPATH as follows:
To direct the RM/COBOL runtime system to use the directory search sequence, set the
environment variable RUNPATH as follows:
In both commands, path indicates the directory that is to be searched for the file and has
the form:
[/]directory[/directory ] ...
If multiple paths are specified, they must be separated with colons. If the file is not
located in the current directory or the explicitly defined paths and if the file should be
created, then the file is created in the current directory. Figure 2-1 and Figure 2-2
illustrate the compiler and runtime system search sequences, respectively.
RMPATH=WAGE/HOURLY/OVERTIME:/usr/local/cobol
RUNPATH=usr/local/cobol:~
The compiler, runtime system, and recovery utility (recover1.exe) require access to other
files in order to operate. These include the message files (RMC.MSG, RUN.MSG, and
REC.MSG), and, for the compiler, the compiler overlay file rmcobol.ovy. RM/COBOL
looks for these files first in the directory containing the executable file, then in the current
directory, and finally in the directories specified in the PATH environment variable.
The compiler overlay file is located by the compiler, not by the operating system. The
compiler will attempt to locate the overlay file first in the directory containing the
compiler executable, then in the current directory, and finally in the directories specified
in the PATH environment variable. After locating the overlay file, the compiler will use
the compiler directory search sequence to locate all other files.
To establish synonymity between a file access name specified in your source program and
another name specified when the program is run, use environment variables that are set
before starting the runtime system.
If you specified a generic file access name for program input-output and wish to direct it
to a specific device or file, enter:
file-access-name = file-access-name-2;
export file-access-name-1
and no environment variable named “report” exists, RM/COBOL will create a file named
report in the current directory.
RM/COBOL will create a file audit.lst in the directory /output without any need to
modify or recompile the source program.
When environment variables are not used, the file access name in the COBOL program
specifies the UNIX filename. The effect of a prior environment variable assignment may
be canceled by the command:
unset file-access-name
Whether or not an environment variable is used to modify the file access name, if the
resulting file access name does not include a directory path, RUNPATH will be used by
the runtime system to obtain the fully qualified pathname (see “File Locations Within
Operating System Pathnames” on page 2-3 for additional information).
When the resulting file access name is TAPE, then the default configuration writes the file
to the default tape device. See “Tape Support” on page 8-47 for additional information
on tape devices.
The DEFINE-DEVICE configuration record may define other file access names that are
to be treated as devices and also may change the default treatment of PRINTER and
TAPE. See “DEFINE-DEVICE Record” on page 10-16 for additional information on
configuring file access names that are to be treated as devices.
The resulting file access name should follow the operating system rules for valid
filenames and pathnames.
Most modern UNIX systems (for example, BSD, System V, Sun OS) are supplied with
built-in virtual memory systems. These systems make it appear as though there is always
sufficient memory for the runtime system, regardless of how much physical RAM is
installed in the machine.
A small number of UNIX machines (for example, the NCR Tower systems), are
configured by the manufacturer to limit the maximum size of a program to less than
10 MB (2 MB in the case of the NCR Tower range). This limitation is enforced
regardless of the availability of physical RAM. Execution of the runtime system on such
machines can lead to unpredictable results. Moreover, it is not uncommon for the runtime
system to terminate with the following message:
Number of Files
The operating system determines the number of files a run unit is allowed to open. The
maximum number of files that may be opened is three fewer than the maximum number of
open files per process. Most UNIX systems allow this maximum to be changed by
reconfiguring the kernel.
Terminal Interfaces
The runtime system uses one of two terminal interface mechanisms, termcap or terminfo,
to control cursor positioning, video display attributes, and function key mapping.
The termcap version of the runtime system uses the older termcap database, which has
a description of the user’s terminal in it. See “Termcap Database” on page 2-10 for
more information.
The terminfo version of the runtime system uses the terminal description in the terminfo
database for both input and output control of the terminal. See “Terminfo Database” on
page 2-11 for more information.
Both the termcap and terminfo versions of the runtime system are present on the
distribution media. During the installation process you will be asked which version to
install. To switch to the other interface, you must either install RM/COBOL again or use
the customiz utility as described in Appendix D, Customizing RM/COBOL for UNIX.
Cursor Types
The termcap and terminfo versions of the runtime system support two types of cursors,
each of which indicates a different edit mode during ACCEPT operations.
1. The attribute cursor_normal (or cursor-on) indicates that standard overtype mode is
active.
2. The attribute cursor_visible (or cursor-blink) indicates that insert mode is active.
Terminal Attributes
Some terminals under UNIX require that special characters appear on the screen just
before the start of an attribute and right after the end of it. Characters in between these
special characters take on the specified attribute. To accommodate these terminals, the
oV capability for termcap specifies the number of screen positions to be used by the nM,
nB, nR, nS, aL, aB, aR, aS and rS capabilities. The xmc capability is used for the
terminfo runtime system. RM/COBOL places the attribute characters at the position
specified by the ACCEPT or DISPLAY operation, and moves the actual start of the field
by the number of positions specified by oV or xmc. If you want, you can use the keyword
MOVE-ATTR with the TERM-UNIT configuration record to specify moving the
The lA is a Boolean termcap capability and is used with terminals that require screen
positions to implement attributes, as described in the preceding paragraph. The standard
RM/COBOL model is to keep an attribute in effect—without regard to the number of
screen lines to which it applies—until it encounters the special character that signals the
end of the attribute. Some terminals, however, recognize the end of a line as the end of
the attribute, without regard to the presence or absence of the ending special character. In
this case, the presence of lA will tell RM/COBOL that a new attribute character must be
placed at the start of every new line in a multiline ACCEPT or DISPLAY operation.
The sA is a Boolean termcap capability that is also used with terminals that require screen
positions to implement attributes. The RM/COBOL model is to assume that attributes
will not wrap from the bottom to the top of the screen. If your terminal behaves
differently, and if you have specified the MOVE-ATTR configuration keyword, use sA.
This allows fields placed at the home position (line 1, position 1) to have their attributes
placed at the last line of the screen.
Termcap Database
The runtime system locates the termcap database by first looking for the environment
variable TERMCAP. If the TERMCAP environment variable is found and contains a
valid pathname, that value is used as the pathname to the database. If the environment
variable is found but it contains a valid termcap entry, that entry will be used as the
terminal description. Otherwise, the filename /etc/termcap will be used as the name of
the database.
For example:
The runtime system locates the terminfo database by first looking for the environment
variable TERMINFO. If the TERMINFO environment variable is found, that value is
used as the pathname to the database subdirectories. Otherwise, the path /usr/lib/terminfo
will be used.
For example:
The name of the database entry that describes the behavior of your terminal is obtained
from the environment variable TERM. This variable should be set to the appropriate
terminal name before invoking the runtime system. The TERM environment variable can
be set as follows:
Table 2-1 describes the information from the terminfo and termcap databases that the
runtime system uses.
Terminfo Termcap
Name Name Description
Booleans
am am Terminal has automatic margins.
bce be Screen erased with background color.
xenl xn Newline ignored after 80 columns. Also used to
signify that the terminal’s cursor will not
automatically advance to the next line after column 80
is reached, but will instead wait for the next character.
Numbers
cols co Number of columns in a line.
lines li Number of lines on screen or page.
pb pb Lowest baud where padding is needed.
xmc sg Number of blank characters left by smso or rmso.
Output Strings
acsc ac Graphic charset pairs.
batt1 Attributes for box characters—primary set (AIX
systems only).
batt2 Attributes for box characters—alternate set (AIX
systems only).
box1 Box characters—primary set (AIX systems only).
box2 Box characters—alternate set (AIX systems only).
bel bl Audible signal (bell).
blink Turn on blinking.
civis vi Make cursor invisible.
clear cl Clear screen and home cursor.
cnorm ve Make cursor appear normal (undo vs/vi).
cr cr Carriage return.
Terminfo Termcap
Name Name Description
Output Strings
cub1 le Move cursor left one space.
cud1 do Down one line.
cuf1 nd Nondestructive space (cursor right).
cup cm Cursor motion.
cuu1 up Upline (cursor up).
cvvis vs Make cursor very visible—insert mode.
dim Turn on half-bright mode.
ed cd Clear to end of display.
el ce Clear to end of line.
enacs eA Enable alternate character set.
home ho Home cursor.
ko Termcap entries for other non-function keys.
ind sf Scroll text up.
pad pc Pad character (rather than null).
op op Set all colors to the original color pairs.
rev Turn on reverse video mode.
rmacs ae End alternate character set.
rmcup te String to end programs that use cup.
rmso se End of standout mode (if no nM or sgr0).
is Terminal initialization string.
rs1 r1 Terminal reset/initialization string 1.
rs2 r2 Terminal reset/initialization string 2.
rs3 r3 Terminal reset/initialization string 3.
setb Sb Set current background color.
setf Sf Set current foreground color.
sgr Define video attributes, 1 through 9.
sgr0 me Turn off all attributes.
smacs as Start alternate character set.
smcup ti String to begin programs that use cup.
tc Entry of similar terminal.
xenl xn Newline ignored after 80 columns.
Terminfo Termcap
Name Name Description
Input Strings
kf5 k5 Sent by function key f5.
kf6 k6 Sent by function key f6.
kf7 k7 Sent by function key f7.
kf8 k8 Sent by function key f8.
kf9 k9 Sent by function key f9.
kf10 k; Sent by function key f10.
kf11 F1 Sent by function key f11.
kf12 F2 Sent by function key f12.
kf13 F3 Sent by function key f13.
kf14 F4 Sent by function key f14.
kf15 F5 Sent by function key f15.
kf16 F6 Sent by function key f16.
kf17 F7 Sent by function key f17.
kf18 F8 Sent by function key f18.
kf19 F9 Sent by function key f19.
kf20 FA Sent by function key f20.
kf21 FB Sent by function key f21.
kf22 FC Sent by function key f22.
kf23 FD Sent by function key f23.
kf24 FE Sent by function key f24.
kf25 FF Sent by function key f25.
kf26 FG Sent by function key f26.
kf27 FH Sent by function key f27.
kf28 FI Sent by function key f28.
kf29 FJ Sent by function key f29.
kf30 FK Sent by function key f30.
kf31 FL Sent by function key f31.
kf32 FM Sent by function key f32.
kf33 FN Sent by function key f33.
kf34 FO Sent by function key f34.
kf35 FP Sent by function key f35.
kf36 FQ Sent by function key f36.
kf37 FR Sent by function key f37.
kf38 FS Sent by function key f38.
Terminfo Termcap
Name Name Description
Input Strings
kf39 FT Sent by function key f39.
kf40 FU Sent by function key f40.
kf41 FV Sent by function key f41.
kf42 FW Sent by function key f42.
kf43 FX Sent by function key f43.
kf44 FY Sent by function key f44.
kf45 FZ Sent by function key f45.
kf46 Fa Sent by function key f46.
kf47 Fb Sent by function key f47.
kf48 Fc Sent by function key f48.
kf49 Fd Sent by function key f49.
kf50 Fe Sent by function key f50.
kf51 Ff Sent by function key f51.
kf52 Fg Sent by function key f52.
kf53 Fh Sent by function key f53.
kf54 Fi Sent by function key f54.
kf55 Fj Sent by function key f55.
kf56 Fk Sent by function key f56.
kf57 Fl Sent by function key f57.
kf58 Fm Sent by function key f58.
kf59 Fn Sent by function key f59.
kf60 Fo Sent by function key f60.
kf61 Fp Sent by function key f61.
kf62 Fq Sent by function key f62.
kf63 Fr Sent by function key f63.
kfnd @0 Sent by find key.
khlp %1 Sent by help key.
khome kh Sent by home key.
khts kT Sent by set-tab key.
kich1 kI Sent by insert character/enter insert mode key.
kil1 kA Sent by insert line.
kind kF Sent by scroll-forward/down key.
kll kH Sent by home-down key.
kmov %4 Sent by move key.
kmrk %2 Sent by mark key.
Terminfo Termcap
Name Name Description
Input Strings
kmsg %3 Sent by message key.
knp kN Sent by next-page key.
knxt %5 Sent by next-object key.
kopn %6 Sent by open key.
kopt %7 Sent by options key.
kpp kP Sent by previous-page key.
kprt %9 Sent by print key.
kprv %8 Sent by previous-object key.
krdo %0 Sent by redo key.
kref &1 Sent by reference key.
kres &5 Sent by resume key.
krfr &2 Sent by refresh key.
kri kR Sent by scroll-backward/up key.
krmir kM Sent by exit insert mode key.
krpl &3 Sent by replace key.
krst &4 Sent by restart key.
ksav &6 Sent by save key.
kslt *6 Sent by select key.
kspd &7 Sent by suspend key.
ktbc ka Sent by clear-all-tabs key.
kund &8 Sent by undo key.
kBEG &9 Sent by shifted beginning key.
kCAN &0 Sent by shifted cancel key.
kCMD *1 Sent by shifted command key.
kCPY *2 Sent by shifted copy key.
kCRT *3 Sent by shifted create key.
kDC *4 Sent by shifted delete-char key.
kDL *5 Sent by shifted delete-line key.
kEND *7 Sent by shifted end key.
kEOL *8 Sent by shifted clear-line key.
kEXT *9 Sent by shifted exit key.
kFND *0 Sent by shifted find key.
kHLP #1 Sent by shifted help key.
kHOM #2 Sent by shifted home key.
kIC #3 Sent by shifted input key.
Terminfo Termcap
Name Name Description
Input Strings
kLFT #4 Sent by shifted left arrow key.
kSAV !1 Sent by shifted save key.
kSPD !2 Sent by shifted suspend key.
kUND !3 Sent by shifted undo key.
kMSG %a Sent by shifted message key.
kMOV %b Sent by shifted move key.
kNXT %c Sent by shifted next key.
kOPT %d Sent by shifted options key.
kPRV %e Sent by shifted prev key.
kPRT %f Sent by shifted print key.
kRDO %g Sent by shifted redo key.
kRPL %h Sent by shifted replace key.
kRIT %i Sent by shifted right arrow key.
kRES %j Sent by shifted resume key.
lf0 l0 Labels on function key f0 if not f0.
lf1 l1 Labels on function key f1 if not f1.
lf2 l2 Labels on function key f2 if not f2.
lf3 l3 Labels on function key f3 if not f3.
lf4 l4 Labels on function key f4 if not f4.
lf5 l5 Labels on function key f5 if not f5.
lf6 l6 Labels on function key f6 if not f6.
lf7 l7 Labels on function key f7 if not f7.
lf8 l8 Labels on function key f8 if not f8.
lf9 l9 Labels on function key f9 if not f9.
lf10 la Labels on function key f10 if not f10.
nel nw Sent by newline key.
Termcap
Name Description
lA Attributes will not wrap lines.
sA Attributes will wrap screen.
Table 2-4 describes the additional output string capabilities used by RM/COBOL when
accessing the termcap database.
Termcap
Name Description
aB Low intensity blink.
Ab Low intensity underline and blink.
aL Low intensity.
Al Low intensity underline.
aR Low intensity reverse.
aS Low intensity blink and reverse.
nB High intensity blink.
Nb High intensity underline and blink.
nM High intensity.
Nm High intensity underline.
nR High intensity reverse.
nS High intensity blink and reverse.
vr End of field.
Termcap
Name Description
oV Number of blank characters left by additional RM/COBOL attribute
capabilities.
The Boolean capabilities sA and lA cannot be added to the terminfo database since it is a
closed system; these capabilities are not used by the terminfo runtime system. Under
runtime systems that use terminfo for output, the xmc numeric capability determines the
width of attribute characters and the starting position of fields. Specifying xmc#0
indicates a physical attribute terminal for which the attributes do not occupy a screen
position but still must be written at the physical start and end of each field.
Runtime systems that use the terminfo database directly for output sequences will use the
set_attributes or sgr string for all field attributes, if it is available. The terminfo
set_attributes string has nine parameters or attributes that can be set. RM/COBOL makes
use of six of these parameters. The second parameter is set if the underline attribute is
requested. The third parameter is set if the reverse attribute is requested. The fourth
parameter is set if the blinking attribute is requested. The fifth parameter is set if the
low-intensity attribute is used. The sixth parameter is set if the high-intensity attribute is
used. The ninth parameter may be used when line draw characters are requested for
pop-up window borders. The only exception to requesting line draw characters in this
manner is in terminals where xmc and sgr are specified (for example, physical attribute
terminals). On these terminals the alternate character set attribute can either be a field
attribute or a single character attribute. Because the terminfo database does not indicate
how to determine this behavior for a terminal, RM/COBOL will infer that the terminal has
the alternate character set as a single character attribute, if the smac definition is in the
terminfo database for the terminal. In this case, the smacs and rmacs sequence will be
used for the writing of graphics or alternate character set data and the ninth parameter will
always be specified as off.
Each of the sgr parameters is set to one if an ACCEPT or DISPLAY requests the
corresponding attribute. Otherwise, a zero is set for the parameter. A zero is also set for
all other parameters.
Attributes are reset by using the sgr0 string if it is defined. Otherwise, they are reset
using all zeroes as parameters to the set_attributes string.
Terminfo
Name Description
blink High intensity blink.
dim Low intensity.
rev High intensity reverse video.
rmacs End alternate character set.
rmso Reset attributes (also used for high intensity if no sgr0).
sgr0 High intensity.
smacs Start alternate character set.
smso High intensity (if no sgr0 or rmso).
If color keywords are specified in the CONTROL phrase, the terminfo setf or setb
sequence will be used to set the foreground or background color. These sequences accept
a single numeric parameter indicating the desired color. If these sequences are not
already defined for your terminal and you wish to define them, the association of colors to
color numbers is normally defined in the C include file, curses.h.
If line draw characters are requested for either pop-up window borders, or because the
GRAPHICS keyword in the CONTROL phrase was specified in an ACCEPT or
DISPLAY statement, the terminfo database is examined for the acsc sequence or the box1
and box2 sequences. UNIX systems provide the acsc string to map generic (vt100) line
draw characters to the correct characters for your terminal. These characters are then
enabled through the ninth sgr parameter (see page 2-20). To support double-line draw
characters, RM/COBOL has extended the acsc string to include six more mappings.
These mappings extend the generic (vt100) characters by describing the double-line
graphic characters with the corresponding uppercase letters, as shown in Table 2-7.
AIX systems describe line draw graphic characters through the box1 and box2 sequences
in the terminfo file. In addition, if the first character of batt1 or batt2 is f, the ninth sgr
parameter will be set when writing the box1 or box2 line draw characters, respectively.
The use of the redirection and piping operators (>, >> , < and | ) on the Runtime
Command line affects the operation of ACCEPT and DISPLAY statements in several
ways. Piping is a means of chaining the standard output (DISPLAY statements) of one
run unit to the standard input (ACCEPT statements) of a second run unit; therefore,
piping appears identical to redirection at the program level. Note that a Format 1
ACCEPT or DISPLAY statement that includes the FROM/UPON CONSOLE phrase or
FROM/UPON mnemonic-name phrase where mnemonic-name is defined as CONSOLE
IS mnemonic-name, is not redirected or piped unless it is configured to come from
standard input or go to standard output. If this is not the case, you must use either 2> or
2>> for redirection. Note also that if an ACCEPT or DISPLAY statement contains a
UNIT phrase, it will not be redirected.
Standard Input
The standard input device is defined by default to be the keyboard of the terminal that
started the run unit. Standard input may be redirected to a file or other device by the
operating system conventions for standard input redirection and piping on the command
line that starts the run unit.
pipes the standard output from program putdata to the standard input of program
getdata.
ACCEPT statements that do not specify the FROM CONSOLE phrase read from the
standard input device.
When standard input is redirected, the ACCEPT statement (Formats 1 and 3) operation is
modified. Only the SIZE, CURSOR, ECHO, CONVERT and ON EXCEPTION phrases
of Format 3 are used; all other phrases are ignored. Note that Format 1 ACCEPT
statements with numeric operands are treated as Format 3 ACCEPT statements unless the
program containing the ACCEPT statements was compiled with the M Compile
Command Option (see page 6-11).
At the beginning of each ACCEPT statement, the next record is read from standard input
into the ACCEPT buffer. The following operations take place for each of the receiving
data items in the ACCEPT statement:
1. If there are no characters in the ACCEPT buffer, the next record is read from
standard input into the ACCEPT buffer.
2. If the number of characters in the ACCEPT buffer does not exceed the size of the
current receiving item, those characters are transferred to the receiving item in the
appropriate format (that is, left justified, space fill for all Format 1 and for
alphanumeric Format 3, and with appropriate conversion for numeric Format 3).
3. If the number of characters in the ACCEPT buffer exceeds the size of the current
receiving item, only the leftmost “size” characters are transferred, as described in the
previous operation. The characters that remain in the ACCEPT buffer are used for
the next receiving item or are discarded if the current receiving item is the last
receiving item in the ACCEPT statement.
Note Where numeric sending and receiving data items are used with piping,
the use of the CONVERT phrase with DISPLAY and ACCEPT statements is
strongly recommended.
1. If the number of characters in the ACCEPT buffer does not equal or exceed the size
of the current receiving item, one or more records are read from standard input and
are concatenated until there are enough characters.
2. The leftmost “size” characters are transferred as described in steps 2 and 3 on the
preceding page. The characters that remain in the ACCEPT buffer are discarded.
Note that the use of the M Runtime Command Option requires close matching of
ACCEPT and DISPLAY statements when used with piping.
Also note that the M Runtime Command Option affects the operation of Format 1
ACCEPT statements which are not redirected; the console operator is required to enter
enough characters to fill the receiving item. If the Enter key is pressed before enough
characters have been entered, the request will be reissued until the concatenation of the
characters entered is sufficient to fill the receiving item.
The M Runtime Command Option does not affect the operation of Format 3 ACCEPT
statements.
Standard Output
The standard output device is defined by default to be the monitor of the terminal that
started the run unit. Standard output may be redirected to a file or other device by the
operating system conventions for standard output redirection and piping on the command
line that starts the run unit.
For example:
pipes the standard output from program putdata to the standard input of
program getdata.
When standard output is redirected, all phrases, except SIZE and CONVERT, of the
Format 2 DISPLAY statement are ignored. All sending operands are concatenated
(within the limits of the ACCEPT/DISPLAY buffer as described in the following
paragraphs) and are transferred to standard output as one or more records.
A Format 1 DISPLAY statement generates one record and may generate more than one
record, depending on the presence or absence of the M Runtime Command Option (see
page 7-4). If the M Option is not present in the Runtime Command, all sending operands
are concatenated, the resulting operand is truncated to the DISPLAY buffer size, and a
single record is written. If the M Option is present, all sending operands are concatenated
and the resulting operand is split into zero or more records equal in length to the
DISPLAY buffer size, along with a final record no longer than the DISPLAY buffer size.
Standard Error
The standard error device is defined by default to be the monitor and keyboard.
Interactive debug input and output, STOP literal statements, and runtime system
messages are directed to the standard error device. These operations can be redirected by
a configuration option; see the discussion of the ERROR-MESSAGE-DESTINATION
keyword that begins on page 10-25.
These operations also can be redirected using the operating system standard-error
redirection convention on the command line that starts the run unit.
For example:
To direct standard output and standard error to the same destination, specify:
Your computer configuration is the assembled set of hardware and software that makes up
your system. Before you can develop or run RM/COBOL programs, your configuration
must meet or exceed the requirements set forth in this chapter.
System Requirements
RM/COBOL runs on the IBM PC and full compatibles. Appropriately licensed versions
run in conjunction with Client for Microsoft Networks or Novell NetWare software to
provide support for multiuser file access.
Required Hardware
• IBM PC or compatible machine with an 80486-class processor or higher.
• Microsoft Windows 95
• Microsoft Windows 98
To provide multiuser access, one or both of the following network programs is required:
• Novell NetWare version 3.11 or later
• Client for Microsoft Networks for Windows 95, Windows 98, or Windows NT
version 4.0
Btrieve Software
2. Insert your RM/COBOL for 32-bit Windows diskette into a disk drive.
4. In the Open text box in the Run dialog box, type the following:
A:setup
where “A” is the letter assigned to the drive where you inserted the diskette.
5. Click the OK command button and follow the prompts on your screen to complete
the installation process.
After installation is complete, you can display the RM/COBOL Program Folder, which is
illustrated in Figure 3-1. The programs are described in Table 3-1.
Note Depending upon which RM/COBOL package you purchased, not all of the
program icons in Figure 3-1 will appear on your system.
The runtime server DLL, which must be registered with Windows before RM/COBOL
programs can be run, is automatically registered by the Setup program when the runtime
system is installed. If the runtime is moved to a directory other than the installation
directory without a re-installation, the error message shown in Figure 3-2 is displayed
indicating that there is a registration problem.
There are two ways to resolve this problem. You can do either of the following:
To register the Windows runtime in a directory other than the installation directory, first
make sure that runcobol.exe and rmcblrun.dll are in the same directory. Then, click the
Windows Start button and select Run from the menu, or open a DOS window. Enter the
following command:
path\RUNCOBOL /REGSERVER
where path is the drive and directory or the UNC location of these two files.
For example:
Note The quotes are necessary only if the pathname contains spaces.
The RM/COBOL runtime also provides the /UNREGSERVER command line option to
unregister the runtime from Windows. Although the uninstallation program automatically
unregisters the runtime, this can be done manually with the following command:
path\RUNCOBOL /UNREGSERVER
It is not necessary to unregister the runtime before re-registering the runtime from a
different location.
Finally, the following option will display the location of the currently registered runtime
server:
path\RUNCOBOL /SHOWSERVER
Figure 3-4 illustrates the message box that is displayed when the server has been properly
registered:
Otherwise, a detailed error message is displayed. Note that “Class not registered” in the
this error message indicates that the server is not registered.
1. Click Start button, point to Settings, and then click Control Panel.
3. From the Install/Uninstall tab in the Add/Remove Programs Properties dialog box,
select “RM/COBOL” from the list of installed program packages.
All installed RM/COBOL system programs, files, shortcuts, and Windows registry entries
are now removed. Customer files are not affected.
System Configuration
As mentioned, RM/COBOL supports IBM PCs, full PC compatibles, and Windows
systems. This section sets forth information required to configure RM/COBOL with each
type of system.
To create a shortcut for an application under Windows, take the following steps:
1. Open the folder to which you want the item added. (Note that you can also add an
item directly to the desktop.)
2. Click the right mouse button to open a pop-up menu. Point to the New option and
click Shortcut. The Create Shortcut dialog box opens.
4. When prompted to name the shortcut, choose a name that uniquely identifies the
application program. This name becomes the label that appears under the shortcut
icon.
5. After Windows creates the shortcut, you must modify the properties of the shortcut in
order for it to work properly. Right-click the shortcut icon and choose Properties.
The Shortcut Properties dialog box opens.
6. Select the Shortcut tab in the dialog box. (Figure 3-5 illustrates the Shortcut
Properties Tab used in this example.) In the Start in text box, enter the name of the
directory where the program files for this application are located and where new files
will be placed. The directory you specify here becomes the current directory while
the application program is running.
Normally, you cannot pass command line options to Windows programs executed using a
filename extension association. However, using the Windows registry (described on
page 3-16), it is possible to inform the RM/COBOL compiler or runtime system of
command line options for all programs or for specific programs. (See page 3-20 for a
discussion of the Command Line Options property in the RM/COBOL configuration.)
Under Windows, it is also possible to drag and drop .cbl and .cob files to the
RM/COBOL compiler or runtime system for execution. Dropping a .cbl file on a printer
icon will print that source file.
When the user selects the file from the list available in the space below the Look in
drop-down list box, the filename in the File name text box replaces the ? character on the
command line. To open (or start) the source or runtime system file, click the Open
button. Double-clicking the name of the file also opens (or starts) the selected object file.
Specifying a directory path with a leading slash, a drive letter, or a volume name indicates
to RM/COBOL that an exact filename has been specified. If
RM/COBOL cannot find the file in the specified location, it will not look elsewhere. If
you do not specify a directory path, and RM/COBOL cannot find the file in the assumed
location, it will search for the file according to the directory search sequence. If a
directory path is specified, but there is no leading slash, drive letter, or volume name, then
the EXPANDED-PATH-SEARCH keyword of the RUN-FILES-ATTR configuration
record determines whether the directory search sequence will be used (see page 10-27).
When the configuration keyword is set to its default value of NO, the directory search
sequence will not be used. If the value is set to YES, then the entire name, including the
directory path, will be appended to each entry in the directory search sequence in an
attempt to locate the file.
To direct the RM/COBOL compiler to use the directory search sequence, set the
RMPATH synonym. You do this by using the RM/COBOL Configuration utility
(rmconfig.exe), as explained in Appendix G, Utilities. Alternatively, you can right-click
the mouse button on a .cbl file, select the Synonyms Properties tab, and set the RMPATH
synonym with the following syntax (see page 3-29 for a discussion of setting synonyms):
To direct the RM/COBOL runtime system to use the directory search sequence, set the
RUNPATH synonym. To do this, use the RM/COBOL Configuration utility
(rmconfig.exe), as discussed in Appendix G. You may also right-click the mouse button
on a .cob file, select the Synonyms Properties tab, and set the RUNPATH synonym with
the following syntax (see page 3-29 for a discussion of setting synonyms):
In both commands, path indicates the directory that is to be searched for the file, and has
the form:
directory is the location of an existing file, or the location of a file that will
be created.
A:wage\hourly\overtime;B:
A:;B:;C:\
Files made to appear in the current directory by using Novell search directories when the
Novell Search Mode is set to a value other than 2 will not be accessed. If a file to be
accessed resides in a directory other than the current directory, that directory must be
included in the RMPATH or RUNPATH directory list. This requirement also applies to
files located in Novell search directories when the Novell Search Mode is set to a value
other than 2.
The compiler, runtime system, and Indexed File Recovery utility program require access
to other files in order to operate. These include the message files (RMC.MSG,
RUN.MSG, and REC.MSG), dynamic link library files (with an extension of .dll), and,
for the compiler, the compiler overlay file, rmcobol.ovy. RM/COBOL looks for these
files first in the directory containing the executable file, then in the current directory, and
finally in the directories specified in the PATH environment variable. For the dynamic
link library files, the default Windows system directory and then the default Windows
directory will be searched prior to searching the directories specified in the PATH
environment variable.
The compiler and runtime system may be executed from a directory other than the current
directory if a complete pathname is specified in the command line, or if either the search
directory of Novell NetWare or the DOS PATH directory search feature is used. If a
complete pathname is not specified and the compiler or runtime system is not located in
the current directory, the directories specified by PATH are searched.
With RM/COBOL search paths, if any one of the directories in a user’s path does not
have search permission for the user, then the searching sequence stops for all remaining
directories and a security violation is reported. This security violation indicates that the
runtime system has been prevented from examining the directory for a file. If a security
violation occurs, and the file is located in a directory for which the user has permission,
examine the permissions for other directories in the RUNPATH sequence.
• Give the user search permission for all directories in RUNPATH, RMPATH, and the
Novell NetWare search path.
Note This same security violation can occur when creating a new file, even if it is with
OPEN OUTPUT. The RM/COBOL runtime system still searches RUNPATH to locate a
file that needs to be replaced.
To establish synonymity between a file access name specified in your source program and
another name specified when the program is run, use the Synonyms tab of the Properties
dialog box, as illustrated in Figure 3-9. The Synonyms Properties tab is described on
page 3-29.
For example, let us say that you specified a generic file access name for program
input-output and wish to direct it to a specific device or file. A generic file access name is
one that does not specify a directory path or drive letter. Since the format of physical
pathnames, including conventions of specifying drive letters and directory names, varies
from one operating system to another, for maximum portability it is recommended that
source programs specify generic file access names, preferably with eight or fewer letters.
This recommendation only applies when the file access name is hard coded into the
program as a literal.
and no synonym is assigned, RM/COBOL will create a file named report in the current
directory on the current drive.
If, prior to running the program, you set the synonym "report" to a value of LPT1, all
program output written to REPORT-FILE will be written to LPT1.
Whether or not a synonym is used to modify the file access name, if the resulting file
access name does not include either a drive letter or a directory path, RUNPATH will be
used by the runtime system to obtain the fully qualified pathname (see “File Locations
Within Operating System Pathnames” on page 3-10 for additional information).
The resulting file access name should follow the operating system rules for valid
filenames and pathnames.
When the resulting file access name is "PRINTER?" (see 10-19), RM/COBOL displays
the standard Windows Print dialog box when the file is opened. This allows the user to
select the destination Windows printer in a dynamic manner (that is, at execution). Once
the "PRINTER?" device has been opened, the selected printer is remembered by the
runtime, and subsequent opens do not display the standard Windows Print dialog box.
The program may call the P$EnableDialog subprogram (see page E-16) to force a
standard Windows Print dialog box on the next open of "PRINTER?". The user may also
set the Printer Dialog Always registry property to TRUE (see page 3-25) to force the
dialog box on every open of "PRINTER?". The program may also call P$DisplayDialog
(see page E-16) at any time, to force the standard Windows Print dialog box to be
displayed.
In order to send raw escape sequences to a printer, the printer must be opened directly by
using the name “LPT1”. The name “LPTn”, where n is a decimal digit, also can be used.
The DEFINE-DEVICE configuration record may define other file access names that are
to be treated as devices and also change the default treatment of PRINTER and
PRINTERn. See “DEFINE-DEVICE Record” on page 10-16 for additional information
on configuring file access names that are to be treated as devices.
The Windows registry is organized much like a disk drive’s directory structure. All of
RM/COBOL’s configuration information is stored under the “directory” path
“HKEY_LOCAL_MACHINE\SOFTWARE\Liant Software Corporation\RM/COBOL\CurrentVersion”.
Three subdirectories underneath that path (rmcobol, runcobol, and recover1) correspond
with information previously stored in the separate initialization files rmcobol.ini,
runcobol.ini, and recover1.ini.
You are not required to know the inner details of the Windows registry structure in order
to change the properties of your programs. RM/COBOL for Windows includes Windows
shell extensions that allow the manipulation of configuration information for default
values as well as individual program settings without having to navigate through the
Windows registry editor. Configuration information for a specific COBOL program may
be edited by right-clicking a source or object file and choosing Properties. If a source file
is chosen, the properties used when compiling that program can be modified. If an object
file is chosen, the properties used when running that program can be modified. The
configuration options available in the Properties dialog box are described in the following
section “Setting Properties.” Configuration information for programs and generic default
values may also be edited by running the supplied RM/COBOL Configuration utility
(rmconfig.exe), as described on page G-41.
Users may migrate the complete RM/COBOL registry information from one machine to
another by using the regedit.exe utility supplied with Windows. This utility allows entire
sections of the Windows registry to be exported to a .reg text file, which can then be
imported into the Windows registry of another machine. Consult the Microsoft Windows
help documentation for more information on regedit.exe.
Note If you have opened the Properties dialog box by right-clicking the mouse button on
an RM/COBOL source or object file and then selecting Properties, this tab will not be
available. You are only able to configure options for the current file.
• Default Properties. When selected, the Default Properties option enables the other
Properties tabs (Miscellaneous, Synonyms, Colors, Toolbar, Menu Bar, and Pop-up
Menu) to set system defaults for all files.
• Individual File. When selected, the Individual File option enables the other
Properties tabs to change the properties for the selected file.
• Configure for. The three options provided in this area determine the activity for
which the Properties tabs will configure a file.
− Running. If this option is selected, the settings for the .cob file will be shown
and used when running the file.
− Compiling. If this option is selected, the settings for the .cbl file are affected.
− Recovery. If this option is selected, the settings used for recovering a data file
with the Indexed File Recovery utility program (recover1.exe) are affected.
• Browse. Use this button to open a dialog box that allows you to look for a file for
which you want to set properties.
• Use Defaults. The behavior of the Use Defaults button is dependent upon whether
the Default Properties or the Individual File option is in effect.
If the Default Properties option is selected, choosing the Use Defaults button causes
the system defaults to be reset to the values that were in place when the product was
originally installed. Note, however, that any property values set for an individual file
will not be reset.
If the Individual File option is selected, choosing the Use Defaults button causes
property values that have been overridden for the selected file to be reset to use the
system defaults.
• Property. This list box presents an alphabetical listing of the properties that are used
to configure the physical appearance of the RM/COBOL program. (Each of these
properties is discussed below.)
• Use Default Settings. Select this button to use the selected property’s default value.
That default value will be shown in the Value area (described below). See the
Default Properties option on the Select File tab for information on configuring
default values (for more information, see the discussion of “Selecting a File to
Configure” that begins on page 3-17).
• Use Custom Settings. Select this button to override the default value for the
selected property.
• Value. This area displays the value associated with the property selected in the
Property list box and allows you to change it. Note that this area is disabled unless
the Use Custom Settings button is selected.
The Auto Paste property specifies a Boolean value that enables or disables the
Auto Paste function. Setting Auto Paste to TRUE enables the Auto Paste feature and
double-clicking the mouse button transfers the marked data to a pending ACCEPT field.
If Auto Paste is set to FALSE, double-clicking the mouse button marks a word of text.
The default value is TRUE.
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the Auto
Paste property in order to manipulate the graphical user interface.
Auto Scale
The Auto Scale property specifies a Boolean value that determines whether to implement
auto scaling of fonts when the window is resized. Setting Auto Scale to TRUE
automatically changes the font size when the window is resized. Setting Auto Scale to
FALSE turns off this capability. The default value is TRUE. See also the Sizing Priority
property on page 3-27.
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the Auto
Scale property in order to manipulate the graphical user interface.
The Command Line Options property defines a series of command line options to be
passed to the runtime system. Processing of options on the actual command line occurs
last and replaces any options specified using this property.
Enable Close
The Enable Close property specifies a Boolean value that enables or disables the Close
menu item on the Control menu as well as the Close button in the upper-right corner of
the window. Setting Enable Close to TRUE enables the Close menu item and the Close
button. Setting Enable Close to FALSE dims and disables the Close menu item and the
Close button. The default value is TRUE.
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the
Enable Close property in order to manipulate the graphical user interface.
The Enable Properties Dialog property specifies a Boolean value that enables or disables
the Properties menu item on the Control menu. Setting Enable Properties Dialog to
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the
Enable Properties Dialog property in order to manipulate the graphical user interface.
Font
The Font property specifies the typeface to use as well as point size and style. The
typeface must be a fixed-width (or monospaced) font, such as Courier. Clicking the
Select Fonts button opens the Fonts dialog box, which provides a list of available fonts,
styles, and sizes.
The Full OEM To ANSI Conversions property specifies a Boolean value that determines
whether or not to convert a character from OEM to ANSI or from ANSI to OEM. This
property affects titles, menus, and other Windows objects. Because Windows uses the
ANSI character set, the default setting (TRUE) causes all output to be converted from the
OEM character set to the ANSI character set and all input from these controls to be
converted from ANSI to OEM. If, however, the user wants to avoid these conversions,
this property should be set to FALSE in order to suppress the conversion. Setting this
value to FALSE causes the runtime system to behave as it did prior to the RM/COBOL
6.5 release.
Note The European “Latin-1” character set is the same as the Windows native ANSI
character set.
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the Full
OEM to ANSI Conversions property in order to manipulate the graphical user interface.
Icon File
The Icon File property specifies the icon filename from which to load icons for the
toolbar (see the Name option of the Toolbar Properties tab, described beginning on
page 3-32). This property is used only if the Toolbar property is set to TRUE (see
page 3-28). The default value is rmtbar.vrf (see Table 3-3 on page 3-38 for more
information).
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the Icon
File property in order to manipulate the graphical user interface.
The Load Registry On CALL property specifies a Boolean value that enables or
disables additional processing of the Windows registry file. If set to TRUE, the registry
is re-examined whenever a COBOL subprogram is called. The subprogram name is
treated as if it were a filename and causes corresponding registry entries to be processed.
If set to FALSE, the registry is not re-examined. The default value is FALSE.
Note Use caution when setting the value of the Load Registry On CALL property to
TRUE as a system default. Doing so can affect the performance of your application.
This behavior can occur when using RM/Panels because an RM/Panels application uses
many subprogram calls. Alternatively, you can use the C$TBar (see page F-37), C$MBar
(see page F-17), or C$GUICFG (see page F-16) subprograms to manipulate the toolbar
and menu bar instead of using the Windows registry file and the Load Registry on CALL
property.
The Load Registry On RETURN property specifies a Boolean value that enables or
disables additional processing of the Windows registry file. If set to TRUE, the registry is
re-examined whenever a COBOL subprogram is exited. The calling program’s name is
treated as if it were a filename and causes corresponding registry entries to be processed.
If set to FALSE, the registry is not re-examined. The default value is FALSE.
Note Use caution when setting the value of the Load Registry On RETURN property to
TRUE as a system default. Doing so can affect the performance of your application.
This behavior can occur when using RM/Panels because an RM/Panels application uses
many subprogram calls. Alternatively, you can use the C$TBar (see page F-37), C$MBar
(see page F-17), or C$GUICFG (see page F-16) subprograms to manipulate the toolbar
and menu bar instead of using the Windows registry file and the Load Registry on
RETURN property.
Logo Bitmap
The Logo Bitmap property specifies a Boolean value that determines whether a Logo
Bitmap is displayed. If set to TRUE, the file specified by the Logo Bitmap File property
(described below) is displayed. If set to FALSE, it is not displayed. The default value
is TRUE.
The Logo Bitmap File property specifies the bitmap (.bmp) filename that may be
displayed in the COBOL window when an application is started. The bitmap is centered
in the main window until an erase screen operation is encountered (DISPLAY ERASE).
You can build a simple COBOL program that displays a bitmap, responds to keyboard
sequences (such as function keys that could be generated from the menus or toolbar), and
dispatches the appropriate code. The default value is run.bmp, rmc.bmp, or rec.bmp
for the runtime system, compiler, and Indexed File Recovery utility program,
respectively. If the bitmap file is not found, or if Logo Bitmap (described above) is set
to FALSE, this property is ignored.
The Main Window Type property determines the style of the Main window (the window
that is activated when the COBOL application begins execution).
Mark Alphanumeric
The Mark Alphanumeric property specifies a Boolean value that determines the
terminating conditions for selecting a word from the application window. If Mark
Alphanumeric is set to TRUE, double-clicking the mouse button to mark a word selects
characters until a non-alphanumeric character is encountered. If Mark Alphanumeric is
set to FALSE, selection occurs when a blank is encountered. The default value is TRUE.
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the Mark
Alphanumeric property in order to manipulate the graphical user interface.
Offset X
The Offset X property specifies a number that identifies the leftmost location (as a
pixel offset from the left edge of the screen) of the COBOL window. The default
value is 0.
The Offset Y property specifies a number that identifies the uppermost location (as a
pixel offset from the top edge of the screen) of the COBOL window. The default value
is 0.
Panels Controls 3D
The Panels Controls 3D property specifies a Boolean value that causes certain
RM/Panels for Windows controls (date, time, alpha, and numeric fields) to take on a
three-dimensional appearance. This capability was not available in prior versions of
RM/Panels for Windows. The default value, FALSE, causes existing applications to
appear the same as they did under previous versions of RM/COBOL.
The Panels Static Controls Border property specifies a Boolean value that cause the Static
Text Control (a new Panels control type) to have a border. The default value, FALSE,
causes these controls to be drawn without a border.
Paste Termination
The Paste Termination property specifies a Boolean value that affects automatic
termination of fields pasted into a pending ACCEPT statement, using either the Paste (see
page 3-44) or Auto Paste (see page 3-20) function. If Paste Termination is set to TRUE,
data transfer will continue until the data is exhausted, including all tabs and carriage
returns. If Paste Termination is set to FALSE, data transfer stops when a tab or carriage
return is encountered. There is a carriage return at the end of each line of text in the
Windows Clipboard. The default value is TRUE.
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the Paste
Termination property in order to manipulate the graphical user interface.
Persistent
The Persistent property specifies a Boolean value that affects the behavior of the
RM/COBOL window when the COBOL program, compiler, or Indexed File Recovery
utility program terminates. If Persistent is set to TRUE, the window will not close until
dismissed by the user. If Persistent is set to FALSE, the window will close immediately
upon completion. The default value is FALSE.
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the
Persistent property in order to manipulate the graphical user interface.
The Printer Dialog Always property specifies a Boolean value that affects the behavior of
the RM/COBOL runtime when opening the "PRINTER?" (dynamic printer selection)
device (see page 10-19). If Printer Dialog Always is set to TRUE, the standard Windows
Print dialog box will appear when the dynamic printer device is opened. If Printer Dialog
Always is set to FALSE, the dialog box will appear only the first time the dynamic printer
is opened. The P$EnableDialog subprogram (see page E-16) may be called to cause the
dialog to appear on the next open of the dynamic printer). The default value is FALSE.
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the
Printer Dialog Always property.
The Printer Dialog Never property specifies a Boolean value that affects the behavior of
the RM/COBOL runtime when opening the "PRINTER?" (dynamic printer selection)
device (see page 10-19). If Printer Dialog Never is set to TRUE, the standard Windows
Print dialog box will never appear when the dynamic printer device is opened. In this
case, the "PRINTER?" device behaves like the Printer (default) printer device. If Printer
Dialog Never is set to FALSE, the appearance of the dialog box is controlled by the
setting of the Printer Dialog Always property. The default value is FALSE.
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the
Printer Dialog Never property.
Note If the Printer Dialog Never property is set to TRUE, the standard Windows Print
dialog box will never appear, regardless of the state of the Printer Dialog Always
property.
The Printer Enable Escape Sequences property specifies a Boolean value that determines
whether printing will allow embedded RM/COBOL-specific escape sequences. See
“RM/COBOL-Specific Escape Sequences" in Appendix E, Windows Printing, for a more
complete description. If the value is set to TRUE, the RM/COBOL runtime system will
Note Setting the Printer Enable Escape Sequences property to TRUE affects
all Windows printers that the COBOL program uses. To allow embedded
RM/COBOL-specific escape sequences for only specific printers, use the
P$EnableEscapeSequences subprogram (see page E-38).
The Printer Enable Raw Mode property specifies a Boolean value that determines
whether or not Windows printers will be opened in raw mode. If the value is set to
TRUE, the runtime system will open printers in raw mode. This allows certain Windows
NT networked printers to respond to embedded escape sequences. See P$SetRawMode
subprogram on page E-43 for a more complete description of raw mode. Most P$
subprograms are not available if RAW mode is used. If the value is set to FALSE, the
runtime system will treat the printer as a normal Windows printer. The default value is
FALSE.
Note Setting the Printer Enable Raw Mode property to TRUE affects all Windows
printers that the COBOL program uses. To allow raw mode printing for only
specific printers, use the P$SetRawMode subprogram. For more information, refer
to Appendix E.
The Remove Trailing Blanks property defines a Boolean value that specifies whether
trailing blanks will be removed from the Toolbar (see page 3-32) and Menu Bar strings
(see page 3-34) before they are sent to the COBOL program’s ACCEPT statement for
processing. The default value is TRUE.
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the
Remove Trailing Blanks property in order to manipulate the graphical user interface.
The Scroll Buffer Size property specifies a number that affects the virtual size of the
RM/COBOL window. The number of rows initially displayed in the window is
determined by the ROWS keyword in the TERM-ATTR configuration record (see
page 10-39). The Scroll Buffer Size property determines the number of rows that can be
scrolled off the screen using the vertical scroll bar. Setting the Scroll Buffer Size to a
non-zero value overrides the Auto Scale property (described on page 3-20) and
automatically turns on the vertical scroll bar. The default value is 0.
Sizing Priority
The Sizing Priority property specifies whether to make the width or height a priority when
auto scaling fonts. If the user resizes the window and auto scaling is on, the system will
select a font to match the new size of the window. The new size will be based on the
width or height of the window. The default value is WIDTH. (See also the Auto Scale
property on page 3-20.)
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the
Sizing Priority property in order to manipulate the graphical user interface.
Status Bar
The Status Bar property specifies a Boolean value that determines whether the status bar
is initially visible. Setting Status Bar to TRUE turns on the status bar. Setting Status Bar
to FALSE turns off the status bar. The default value is FALSE.
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the
Status Bar property in order to manipulate the graphical user interface.
Title Text
The Title Text property specifies the string of text to be placed in the main window of the
COBOL program that is currently running. The default title is “RM/COBOL” if no
program name is specified on the runcobol command line. Otherwise, it is the initial
program name.
Note The C$Title subprogram (see page F-39) also can be used to specify the text to be
placed in the RM/COBOL window.
Toolbar
The Toolbar property specifies a Boolean value that determines whether the toolbar is
visible initially. Setting Toolbar to TRUE turns on the toolbar. Setting Toolbar to
FALSE turns off the toolbar. The default value is FALSE.
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the
Toolbar property in order to manipulate the graphical user interface.
Update Timeout
The Update Timeout property specifies a number that represents a delay before a screen
refresh occurs. The value of number is specified in milliseconds. A larger number causes
DISPLAY statements to occur less frequently, potentially improving screen display
performance (especially when multiple DISPLAY statements of short records occur in a
short period of time). This property may also be used to force DISPLAY statements to
occur more frequently. The default value is 500 milliseconds (half of a second).
The C$GUICFG subprogram (see page F-16) can be used to temporarily change the
Update Timeout property in order to manipulate the graphical user interface.
The Use Windows Colors property defines a Boolean value that specifies whether the
standard Windows colors, as set in the Windows Control Panel (Display Properties dialog
box, Appearance tab), are used as the RM/COBOL default foreground and background
colors. If Use Windows Colors is set to TRUE, the standard Windows colors will be
used. If Use Windows Colors is set to FALSE, BLACK will be used for the background
and WHITE for the foreground. A value of FALSE allows the same behavior as that
found in versions of RM/COBOL prior to 6.0. The default value is TRUE.
• Name. The value entered in this list box is the name of the synonym to which you
are assigning a value.
• Value. The value in this text box is the value assigned to the synonym selected in the
Name list box.
• Remove. Use this button to clear the value for the currently selected synonym name
and remove it from the list.
• Remove All. Use this button to clear all synonym values for the currently selected
program.
These synonyms override any environment variables established with the DOS SET
command. As a result, these synonyms may be used to establish a connection between the
open name of the file, literal-1 or data-name-1 (see “Input-Output Section” in Chapter 3,
Environment Division, of the RM/COBOL Language Reference Manual for more
information), and the actual file access name.
If either the Load Registry On CALL property or Load Registry On RETURN property
(see page 3-22) is set to TRUE, synonyms will be reprocessed whenever a subprogram is
called or exited. Synonym assignments are cumulative. For example, if a synonym is
assigned for a called subprogram, its value is unchanged when the subprogram exits
unless Load Registry On RETURN is set to TRUE and the synonym is defined for the
calling program.
• Color. Use this list box to select the color you want to change. The first eight colors
in this list box correspond to the color-names for the keywords (FCOLOR and
BCOLOR) allowed in a CONTROL phrase of an ACCEPT or DISPLAY statement
(see page 8-11). These colors are displayed if low intensity is selected. The
remaining eight colors correspond to the same color-names if high intensity is
selected. Note that GRAY is “HIGH BLACK” and YELLOW is “HIGH BROWN.”
The current color setting is displayed to the right of each name.
Note An asterisk (*) after the name indicates that the default color should not be
overridden. If the Change button (see the following item) is used to override the
default, the overriding color is displayed on the right.
• Change. Use this button to display a Color Selection dialog box that allows you to
select a color to override the selected color name.
• Use Default. Use this button to clear the overriding color for the currently selected
color name, thereby using the default color.
The C$TBar subprogram (see page F-37) also can be used to display a toolbar in the
RM/COBOL window.
• Name. The value entered in this text box is the name of the icon stored in the
filename specified by the Icon File property (see page 3-21).
• Prompt. The value entered in this text box is an optional text string that is displayed
whenever the cursor is placed on the toolbar icon that is specified by the icon name.
• String. Although the value entered in this text box is an ASCII text string, it also can
contain special characters for the Return, Tab, Escape, or Function keys. If the first
character is a greater than character (>), the characters that follow are executed as a
command. The special characters are described in Table 3-2. (These characters are
interpreted by the COBOL ACCEPT statement, as described in Table 8-2 beginning
on page 8-6.)
• Remove. Use this button to clear the value for the currently selected toolbar button
name and remove it from the list.
• Remove All. Use this button to clear all toolbar button values for the currently
selected program.
The C$MBar subprogram (see page F-17) also can be used to display a menu bar in the
RM/COBOL window.
• Name. The value entered in this text box is the string that appears in the menu bar.
If the first character is a tilde (~), the name is disabled. An ampersand (&) character
causes the next character to be underlined and used as an accelerator.
• Prompt. The value entered in this text box is an optional text string that is displayed
when the cursor is placed on the menu bar item.
• String. The value entered in this text box defines the items in the pulldown menu
along with the strings that are returned to the COBOL program when an item is
selected. Using the following syntax, it can specify either a value to be returned or
additional sub-menu items:
pulldownname["prompt"]=menu
prompt is an optional text string that is displayed on the status bar when the cursor is
placed on the menu bar item specified by pulldownname.
menu defines the items in the pulldown menu along with the strings that are returned
to the COBOL program when an item is selected. The syntax for menu is shown as
follows:
• Move Up and Move Down. Use these buttons to control the order of the pulldown
menu names shown in the menu bar. This order is determined by the order of the
names in the Name list box. When you choose Move Up, the currently selected name
moves up one position in the list. Choosing the Move Down button moves the
selected name down one position.
• Remove. Use this button to clear the value for the currently selected pulldown menu
name and remove it from the list.
• Remove All. Use this button to clear all pulldown menu values for the currently
selected program.
The C$RBMenu subprogram (see page F-22) also can be used to display a pop-up menu
in the RM/COBOL window when the right mouse button is pressed.
Note If you are using RM/Panels, a pop-up menu defined by RM/Panels will override a
pop-up menu defined by setting mouse menu properties.
• Name. The value entered in this text box is the string that appears in the pop-up
menu. If the first character is a tilde (~), the name is disabled. An ampersand (&)
causes the next character to be underlined and used as an accelerator.
• Prompt. The value entered in this text box is an optional text string that is displayed
when the cursor is placed on the pop-up menu item.
pop-upname["prompt"]=menu
prompt is an optional text string that is displayed on the status bar when the cursor is
placed on the pop-up menu item specified by pop-upname.
menu defines the items in the pop-up menu along with the strings that are returned to
the COBOL program when an item is selected. The syntax for menu is shown as
follows:
• Move Up and Move Down. Use these buttons to control the order of the names
shown in the pop-up menu. This order is determined by the order of the names in the
Name list box. When you choose Move Up, the currently selected name moves up
one position in the list. Choosing the Move Down button moves the selected name
down one position.
• Remove. Use this button to clear the value for the currently selected pop-up menu
name and remove it from the list.
• Remove All. Use this button to clear all pop-up menu values for the currently
selected program.
Toolbar Editor
RM/COBOL provides a default toolbar in the file, rmtbar.vrf. This toolbar is the
default value specified in the Icon File property (see page 3-21). The buttons provided in
the default toolbar are documented in Table 3-3. A bitmap editor (rmtbedit.exe),
provided with your RM/COBOL runtime system, allows you to create or edit the buttons
on the toolbar.
Button Description
A–Z Letters A through Z (useful for menu picks)
1 – 20 Numbers 1 through 20 (useful for menu picks)
AF1 – AF12 Alt Function keys 1 through 12
AP Accounts Payable
AR Accounts Receivable
BREAK Hammer smashing object (Break key)
CF1 – CF12 Control Function keys 1 through 12
COMPANION Two buddies (Companion for RM/COBOL)
DISK Hard disk drive
DISKETTE Floppy disk
DOWN Down Arrow key
END Curtains closing (End key)
ENTER Enter key
ESCAPE Escape key
EXIT Door with exit sign
F1 – F12 Function keys 1 through 12
FILE File cabinet
GL General Ledger
GO GO sign
GRAPH Three-dimensional graph (Grafsman)
GREEN Green traffic light
HELP Question mark
HOME Little house (Home key)
INFO Italic lowercase i
LEFT Left Arrow key
LINELEFT Left Arrow key pointing at margin bar (Tab left)
LINERIGHT Right Arrow key pointing at margin bar (Tab right)
MAIL Bundle of letters
MENU Menu
Button Description
PAGEDOWN Down Arrow key pointing at margin bar
PAGEUP Up Arrow key pointing at margin bar
PHONE Telephone
PR Payroll
PRINTER Printer
RED Red traffic light
REPORT Text on computer paper
RIGHT Right Arrow key
SAFE Archive (Safe)
SEARCH Flashlight
SF1 – SF12 Shift Function keys 1 through 12
STOP Stop sign
TERMINAL Display and keyboard (Data terminal or PC)
UP Up Arrow key
WRITE Pencil writing on paper
YELLOW Yellow traffic light
YIELD Yield sign
When the Resource dialog box is active, a Resource menu is available. You can edit,
delete, copy, and save the bitmap buttons presented in the Resource dialog box. Opening
or creating a bitmap Resource dialog box opens a bitmap editor.
In the bottom portion of the color palette, the center square contains the mouse’s left
button color and the background color is in the mouse’s right button color. For example,
the color palette in Figure 3-17 shows the center square to be black (indicating that the
color stored in the left mouse button is black) and the background is gray (indicating that
the color stored in the right mouse button is gray).
Figure 3-17 Color Palette Showing Right and Left Mouse Colors
Buttons are shown in a pair of frames. The first frame represents the up image of the
button. The second frame in the sequence represents the down image of the button.
You may export a bitmap by choosing the Resource->Export command from the menu
bar. This command opens the Save Bitmap As dialog. Enter the name of the file you
want to export and choose the OK button.
It is not required that the current font contain line draw characters because the runtime
system dynamically creates these characters as required.
Blinking Attribute
The blinking attribute (see page 10-24) is not supported in the Windows environment.
Title bar
Menu bar
Control menu button
Toolbar
Pop-up menu
Status bar Client area
The runtime system screen is a typical Windows operating system window with the
following areas:
• Menu bar. Configurable by the developer. Menu bar can be different for each
program. COBOL programs can also display a menu bar by using the C$MBar
subprogram (see page F-17 for more information).
• Status bar. Displays prompt text when the user moves the mouse in the client area,
through a menu pick or over a toolbar button. It is configurable by the developer.
Status bar can be different for each program. COBOL programs can also display text
in the status bar by using the C$SBar subprogram (see page F-25 for more
information). It can be turned on or off by the user.
• Toolbar. Configurable by the developer. Toolbar can be different for each program.
It can be turned on or off by the user. COBOL programs can also display a toolbar
by using the C$TBar subprogram (see page F-37 for more information).
• Pop-up menu. Configurable by the developer. Pop-up menu can be different for
each program. RM/COBOL programs can also change the contents of a pop-up
menu by using the C$RBMenu subprogram (see page F-22 for more information).
Cursor Types
Under default conditions, there are three types of cursors, each of which indicates a
different edit mode during ACCEPT operations.
à The full-height cursor indicates that you have typed to the end of the field and
that the TAB phrase has been specified in the ACCEPT statement. A backspace
key or field termination key are the only valid keystrokes in this mode.
Copy
Choosing the Copy command from the Control menu copies the text selected in the
client area of the window to the Windows Clipboard. To select text, hold down the
mouse button and drag the mouse to the target area. Double-clicking the mouse button
selects text in the same manner, as described in the Mark Alphanumeric property (see
page 3-23).
Copy table
Choosing the Copy table command from the Control menu copies the text selected in the
client area of the window to the Windows Clipboard, and also replaces multiple spaces
with a tab. This feature is useful in copying a table of numbers to a spreadsheet, since
spreadsheets require that number fields be separated by the tab character.
Paste
Choosing the Paste command from the Control menu copies the text in the Windows
Clipboard to the currently running RM/COBOL program through the COBOL ACCEPT
statement. If more data is pasted than can be accepted by the ACCEPT command, the
data is buffered.
Properties
Choosing the Properties command from the Control menu opens the Properties dialog
box, which is illustrated in Figure 3-11 on page 3-19.
CALL “SYSTEM”
When using the SYSTEM non-COBOL subprogram (CALL “SYSTEM”) with DOS
programs and batch files (see page F-41), you can customize how these programs run by
modifying the MS-DOS Prompt properties. This can be done by right-clicking the mouse
on the MS-DOS Prompt icon and selecting Properties from the pop-up menu.
Performance
For increased file system performance in single-user mode, set the RUN-FILES-ATTR
configuration record option to FORCE-USER-MODE=SINGLE (see page 10-28).
The goal of the rmbtrv32 program is to use the local area network for passing general
requests to other machines and for receiving completed requests back from the other
machines. As a result, significant increases may occur in the performance of the
application program, the cost-effectiveness of the local area network, and the productivity
of the user.
Note See “RM/COBOL versus Btrieve Indexed File Performance” on page 4-8 for a
situation in which the performance of Btrieve index files may not exceed that of
RM/COBOL indexed files.
Indexed Files
The application program can request a specific record of information in an indexed file.
The location of the specified record within the indexed file is determined by means of an
identifier known as a key. Indexed files use a much more efficient method of locating the
record than simply searching through all the records in the file until the requested record
is found. Instead, indexed files build overhead tables into the file that are similar to
indexes in a book. These overhead tables enable the indexed files to quickly look up the
Note In Figure 4-1, Figure 4-2, and Figure 4-3, each line represents a separate event that
happens at a separate time. The lighter lines represent a small transfer of information, and
the heavier lines represent a large transfer.
Computer
When this process happens over a network, the situation is very similar, as shown in
Figure 4-2.
Disk Drive
Computer 1 Computer 2
(Client) (Server)
In Figure 4-2, Computer 2 acts as a conduit, called a server, through which the requests of
Computer 1, called a client, are routed. (The server routes requests for more than one
client computer, which is an advantage of local area networks.) A more effective way to
route requests, however, is shown in Figure 4-3.
Computer 1 Computer 2
(Client) (Server)
Figure 4-3 illustrates the way in which a Btrieve requester (running on the client,
Computer 1) and a Btrieve MicroKernel Database Engine (running on the server,
Computer 2), makes the processing of messages even more efficient. (Note that the
Btrieve MicroKernel Database Engine is a key external component of the rmbtrv32
program.) Although the interactions between Computer 2 and the disk drive are exactly
the same as shown in Figure 4-2, the interactions between Computer 1 and Computer 2
are significantly different. Instead of Computer 1 giving Computer 2 many small
instructions to carry out, Computer 1 now gives Computer 2 a single, general request.
Computer 2 searches the overhead table for the indexed files to locate the desired record
and then returns only the requested record.
There are several advantages to this method, but the following two are the most
significant:
1. The overall operation may be quicker because the number of transfers between the
two computers is reduced.
2. Because there are fewer transfers between the Computer 1 and Computer 2, the local
area network can use the time that it is not performing transfers between the two
computers to make transfers between other computers on the network. It allows the
network to handle more computers, which makes it more cost effective.
• Btrieve MicroKernel Database Engine (MKDE) for NetWare Server, version 6.15
or later
Note NetWare products are available from Novell, Incorporated. Btrieve products
are available from Pervasive Software, Inc. (formerly Btrieve Technologies, Inc.).
Novell NetWare
NetWare is the software that communicates between computers on the local area network.
These NetWare products are responsible for handling the actual hardware connections,
recovering from transmission errors detected by the hardware, and routing the messages
from one program executing on one computer to another program executing on another
computer.
NetWare augments the operating system by providing access to files on file servers.
The NetWare Btrieve MKDE is a record management system similar to the indexed files
built into the RM/COBOL runtime system. Because the NetWare Btrieve MKDE is not
built into the RM/COBOL runtime system, it can run on a separate computer using
NetWare, thus providing access to files in the manner illustrated in Figure 4-3 (see
page 4-3).
The runtime system has been designed so that any existing RM/COBOL application may
be run in many different environments without changes either to the source of the
program or to the actual executable object. Furthermore, any existing RM/COBOL
runtime system that executes on Windows can also use the RM/COBOL-to-Btrieve
Adapter (rmbtrv32) program.
The Btrieve MKDE lets an application program access records stored in indexed files,
and provides the necessary functions for storing, retrieving, and updating the information.
A COBOL application program uses American National Standard COBOL 1985 language
features, such as OPEN, READ, WRITE, REWRITE, and CLOSE, to access indexed
files. The RM/COBOL runtime system contains a file management system that provides
the runtime system with support for these features. The RM/COBOL runtime system
communicates with the file management system by means of requests and responses that
are called messages. These messages are processed outside of the file management
system by any one of a variety of external file access methods.
The rmbtrv32 program, in effect, is one such external file access method for the
RM/COBOL runtime system. rmbtrv32 receives messages from the RM/COBOL file
management system. Then, acting as an application program for the Btrieve MKDE,
rmbtrv32 translates the messages into Btrieve requests, enabling the Btrieve MKDE to
carry out the action originally requested by the COBOL application program. The
Btrieve MKDE performs the action either on the user’s computer system or acts with
NetWare on a remote system using the local area network. (The drive letter in the
pathname of the file indicates the machine on which the file resides.) After the Btrieve
MKDE has completed the requests, rmbtrv32 constructs an appropriate response
message, which is sent to the RM/COBOL file management system, and, finally, back to
the COBOL application program. Figure 4-4 illustrates this process.
See page 4-9 for the RM/COBOL-to-Btrieve Adapter program (rmbtrv32) options.
Similarly, the installation and configuration of server-based Btrieve (for NetWare or for
the Windows NT Server) are fully described in the Btrieve for NetWare Installation and
Operation manual or the Btrieve for Windows NT Server Edition Installation and
Operation manual, whichever is appropriate, that was supplied by Pervasive Software
with your Btrieve system. These manuals also describe the installation and configuration
of the requesters used to communicate with server-based Btrieve. The server-based
Btrieve is the MKDE that is used to access remote files (that is, Btrieve files residing on
the NetWare or Windows NT Server computer). A number of configuration settings for
both the MKDE and the requesters can be modified by using the appropriate Btrieve
Setup utility.
The Btrieve Programmer’s Guide, supplied by Pervasive Software with your Btrieve
Developer Kit, is an excellent source of information for help in setting the Btrieve
configuration options properly. In addition, several books on Btrieve are available
commercially, and the Btrieve Developer’s Journal is published quarterly by
Smithware, Inc.
2. The size necessary for the length of the longest key, times eight.
3. The size of the largest record requested by the application, plus eight times the
number of linked duplicate keys, plus six (for overhead information), plus four if the
file specifies variable-length records (again for overhead information). See
“Variable-Length Records” on page 4-23 for more information.
• Data compression
• Blank truncation
• No page preallocation
To create Btrieve files with characteristics other than those previously listed, use the
Btrieve File Manager utility, the filename, and the Btrieve description-file that contains
the characteristics for the new file. For more information, see the chapter about using the
File Manager utility in the appropriate Btrieve installation and operation manual.
Characteristics established using the Btrieve File Manager utility can have a direct impact
on performance, including the following:
• The page preallocation value can be used to reserve pages for use by the file. This
has the advantage of ensuring, in advance, that the file has the disk space it needs. It
can also improve performance by concentrating the location of the file on the disk
media (assuming that the disk space is not already fragmented).
• The free-space threshold value can be set to 10, 20, or 30 percent to allow for growth
of variable-length records.
• Keys can be created that are binary or have any of the extended key types.
• More keys can be defined than can be used by the COBOL program. These keys
must be defined either at starting locations that are different from the COBOL keys
or after the COBOL key description for the same location. Such keys can have any
Btrieve attribute and can be split.
However, there is a case in which this may not be true. When a COBOL program opens
an indexed file WITH LOCK, the COBOL program then has exclusive access to that file.
This effect is most pronounced when the indexed file is being read sequentially (for
example, producing a report).
Note Typically when configuring the Btrieve MKDE, it is often sufficient to specify
only the “Largest Compressed Record Size” Btrieve configuration option if you are using
compression (see the appropriate Btrieve installation and operation manual for more
details).
This option is obsolete and should not be specified. The “Maximum Page Size” is no
longer a configurable parameter of the Btrieve engine, which always assumes the Btrieve
limit of 4096 bytes. If this value is inadvertently specified as an amount smaller than
4096, rmbtrv32 may create a Btrieve file with variable-length records when such records
would not be needed.
Create Option
The create option, for creating a new file, has the following values:
The create option is the determinant parameter supplied to the rmbtrv32 program,
because it determines the system that will be responsible for creating a new indexed file.
Depending on the value specified in this parameter, the new file can be created by
rmbtrv32, by another external file access method, or by the RM/COBOL file
management system. In order to understand how this process works, it is helpful to know
more about the way in which the RM/COBOL file management system searches for a file.
Before an application program creates a file, the RM/COBOL file management system
first tries to locate an existing file having the same name as the one specified in the
create attempt. The file management system searches the current directory first, and
then all the other directories located in the environment variable, RUNPATH. (See
In addition to the rmbtrv32 program, other external file access methods can be running
on the computer or network at the same time. In searching for a file, the RM/COBOL file
management system also communicates with all other known external file access methods.
The search continues until all pertinent directories have been checked. If a file having the
same name as the one specified in the create attempt is found, it will be opened. If such a
file cannot be found, and the application program wants to create one, then a designated
external file access method can create the file.
The rmbtrv32 program create option value is a yes or no indicator that specifies whether
you want rmbtrv32 to create any new indexed files as Btrieve files. Regardless of the
value specified, any new file is created in the first directory possible, usually the current
directory. Valid values are Yes and No. The default value is Yes.
A value of Yes causes any new indexed files to be created as Btrieve files:
EXTERNAL-ACCESS-METHOD NAME=RMBTRV32 CREATE-FILES=YES
A value of No causes rmbtrv32 not to create the file and enables another external file
access method or the RM/COBOL file management system to create new indexed files:
EXTERNAL-ACCESS-METHOD NAME=RMBTRV32 CREATE-FILES=NO
D (Duplicates Option)
The duplicates option is used to specify whether linked or repeating duplicatable keys are
used for files created by rmbtrv32.
• L Create linked duplicatable keys. Linked duplicates mean that only one copy of
the duplicated key value is stored in index pages. The data records with the
duplicated key value are linked together with pointers in a doubly-linked list.
The default value is L. Refer to the Btrieve Programmer’s Guide for more information.
The following example tells rmbtrv32 to create files with repeating duplicatable keys:
The initial display option is used to specify whether or not rmbtrv32 should display an
initial message box when it is first invoked.
• Y (Yes) Display the message box. The message box shows the rmbtrv32
version number and the OPTIONS parameter string that was passed to it from
the EXTERNAL-ACCESS-METHOD configuration record. The user must
click the OK button to acknowledge and continue. This option is most useful
the first time the user attempts to use rmbtrv32 with RM/COBOL and
Btrieve.
Example
The following example tells rmbtrv32 to display the informative message box:
The lock option is used to specify the manner in which the rmbtrv32 program is to
handle the WITH LOCK phrase on OPEN statements.
• I Ignore the WITH LOCK phrase. Use the Btrieve MKDE open mode indicated
with the M option (see page 4-14).
Examples
The following example tells rmbtrv32 to ignore the WITH LOCK phrase on OPEN
statements:
EXTERNAL-ACCESS-METHOD NAME=RMBTRV32 OPTIONS='L=I'
The following example tells rmbtrv32 to deny the WITH LOCK phrase on OPEN
statements:
EXTERNAL-ACCESS-METHOD NAME=RMBTRV32 OPTIONS='L=D'
The following example tells rmbtrv32 to accept the WITH LOCK phrase on OPEN
statements:
EXTERNAL-ACCESS-METHOD NAME=RMBTRV32 OPTIONS='L=A'
The mode option is used to specify a value to rmbtrv32 at the time a Btrieve file is
opened. The following values are used only if the file is not OPENed WITH LOCK. See
the L (lock) option, described previously. The mode option has the following values:
• N Normal
• A Accelerated
• R Read-only
• V Verify
• E Exclusive
The default value is N.
Note The ability of rmbtrv32 to specify a mode value is dependent on whether the
application program requests the WITH LOCK phrase on OPEN statements. See the lock
option on page 4-13 for more information.
Examples
In normal mode, the Btrieve MKDE behaves as it normally does with its recovery option
enabled, allowing update requests and performing normal writes to the disk drive. The
following example specifies a value of normal when the file is opened:
In accelerated mode, the data recovery capability of the Btrieve MKDE is disabled to
increase the speed at which records are updated. The following example specifies a value
of accelerated when the file is opened:
Verify mode is now disregarded and the MKDE assumes normal mode instead.
In exclusive mode, the user has exclusive access to the file until the user closes it. This is
the same as specifying EXCLUSIVE or WITH LOCK on the OPEN statement in the
COBOL program.
The owner option specifies the “owner” ID (actually a security password) for new files
and open requests for existing files. The value is a string of up to a maximum of eight
characters delimited by a trailing space. The value cannot contain spaces. The following
example specifies an owner ID of YELLOW:
The rmbtrv32 page size option is the default minimum page size for the files created
by rmbtrv32. Btrieve files are physically accessed in fixed-length pieces called pages.
When rmbtrv32 creates a new file, the Btrieve MKDE requires the specification of a
page size. The size of a page is determined from either the page size option or a
computation based on the size of the record. See “Variable-Length Records” on
page 4-23 for more information. A larger page size transfers more data in a single disk
request, requires more time to transfer, and requires more memory to contain the pages.
A smaller page size allows more blocks in memory for a fixed amount of memory, but
requires more time to randomly access a record by increasing the tree depth of each index
for the file.
If specified, the value must be a multiple of 512 in the range of 512 to 4096, inclusive.
When creating a file, the page size used will be the smallest multiple of 512 sufficient to
hold the file overhead, eight keys, the fixed part of the record, or, if specified, the default
page size, whichever is greater.
The following example sets the value of the page size option to 1024:
This option is used to specify the pathname of a file to which rmbtrv32 will write a trace
of open requests. This feature is used when there is a problem with a Btrieve file not
being successfully opened by a COBOL program. It is not to be used in a production
environment, because it degrades performance and the trace file can become quite large,
which might exhaust disk space. To turn on the trace feature, edit the RM/COBOL
configuration file for the COBOL program in question and add a T=trace-file-name
parameter to the OPTIONS keyword in the EXTERNAL-ACCESS-METHOD
configuration record (see page 10-20). For example, the following record writes trace
information to the file c:\test\trace.fil:
Trace Initialized
Begin open, Not indexed
End open, Code=35
Begin open, Not indexed
End open, Code=35
Begin open, Not indexed
End open, Code=35
Begin open, Flags=0x4900 (file must exist)
UFN=INX1
BTRV Open status 0 on file C:\TEST\INX1
End open, Code=0
Begin open, Flags=0xe100 (file must exist)
UFN=INX2
BTRV Open status 12 on file C:\TEST\INX2
End open, Code=35
Begin open, Flags=0xe000
UFN=INX2
BTRV Open status 12 on file C:\TEST\INX2
BTRV Create status 0 on file C:\TEST\INX2
End open, Code=0
When you are finished diagnosing the problem, be sure to edit the configuration file again
and remove the T=trace-file-name parameter from the OPTIONS keyword in the
EXTERNAL-ACCESS-METHOD configuration record.
1. From the BLOCK CONTAINS clause in the program’s file description entry.
2. From the P=<page size> option parameter on the OPTIONS keyword in the
EXTERNAL-ACCESS-METHOD record (see page 10-20).
If none of these three values is present or acceptable, rmbtrv32 uses the computed
minimum value.
Example
The following example represents a typical command line invoking runcobol using
rmbtrv32:
RUN-INDEX-FILES DATA-COMPRESSION=NO
EXTERNAL-ACCESS-METHOD NAME=RMBTRV32
& CREATE-FILES=YES
& OPTIONS='P=1024, D=R, O=XyZzY'
The ampersand (&), which begins the third and fourth lines in this example, is the
configuration file record continuation character. Note that different RM/COBOL
applications can specify different rmbtrv32 option parameters by using different
RM/COBOL configuration files.
EXTERNAL-ACCESS-METHOD NAME=RMBTRV32
The only requirement is that Windows must be able to locate the various executable files
that are required.
The rmbtrv32 program, rmbtrv32.dll, is a dynamic link library (DLL) that can be
loaded by the Windows 95, Windows 98, and Windows NT version of RM/COBOL.
rmbtrv32.dll communicates directly with wbtrv32.dll, which is the Btrieve interface
DLL supplied with your Btrieve system. The wbtrv32.dll file is normally installed, along
with a number of other DLL, EXE, and other Btrieve files, in a separate Btrieve
executable subdirectory.
Since RM/COBOL and Btrieve are separate products supplied by separate vendors, the
executable files required by each are normally installed in the separate directory
structures. Therefore, the recommended way of ensuring that Windows can locate the
files is to place the directory names containing the files into the Windows PATH
environment variable. For RM/COBOL, this is the directory containing rmbtrv32.dll
(and also containing runcobol.exe, and so forth). For Btrieve, this is the directory
containing wbtrv32.dll (and other DLLs and EXEs). Add these two directory names to
your Windows PATH (which is often done in the autoexec.bat file).
Although it is not the recommended method, Windows will find the executable files if
they reside in any combination of the following:
Note Both the Btrieve MKDEs and rmbtrv32.dll have keywords that can be passed to
them when they are started. If no parameters are specified, the programs use default
values.
Note For more information on the RM/COBOL limits and ranges, see Appendix B,
Limits and Ranges.
However, for READ NEXT statements, the behavior of the Btrieve MKDE can vary from
ANSI COBOL 1985. According to ANSI COBOL 1985, the determination of the next
record to be read is not affected by subsequent non-READ operations. As long as the
In a Btrieve shared file environment, rmbtrv32 can become lost when reading records via
a key containing duplicate key values. If the COBOL application program performs a
non-READ operation between a READ and a READ NEXT statement, and an application
program running on the same or another computer deletes the current record and the
records around it (and all these records contain duplicate key values), then rmbtrv32
becomes lost and returns an error message 46,02 to the application program (see
page A-20 for more information).
This position-lost problem can be avoided when the shared Btrieve file is accessed via a
version 6.1 or later Btrieve MKDE. rmbtrv32 sets the new No Currency Change (NCC)
option on Insert and Update operations so that Btrieve will not change the current record
position. In addition, the user can specify the use of repeating duplicatable keys (see the
D (Duplicates Option) on page 4-11 of this guide and the discussion of Linked versus
Repeating Duplicatable keys in the Btrieve Programmer’s Guide). Using both of these
features avoids the position lost problem and retrieves the correct record.
If the COBOL program executes a START LESS THAN statement and there are multiple
records in the file that contain duplicate keys (for example, multiple records having the
same key value that satisfy the START LESS THAN condition), then the file position
indicator will be positioned to the last record in the sequence of duplicate key values.
The same result occurs if you execute a START LESS THAN OR EQUAL statement
where the equal condition is not met.
If no new records containing duplicates for a key value are added to the file, then
rmbtrv32 behaves identically to the RM/COBOL file management system for the
succeeding READ NEXT or READ PREVIOUS statements. The RM/COBOL file
management system does not move the file position indicator from the record originally
The Btrieve MKDE does not allow rmbtrv32 to emulate this behavior if new records are
added that contain duplicates for a key value. rmbtrv32 moves the file position indicator
to the last record added at the time of the succeeding READ NEXT or READ
PREVIOUS statement.
Note Once the READ statement has been executed, the position is known, and the
RM/COBOL file management system and the Btrieve MKDE again behave the same.
rmbtrv32 creates new Btrieve files that are compatible with the COBOL concept of
indexed files. Existing Btrieve files can be used also, providing they have the following
characteristics:
• Alternate keys can be modified, can use either the native or alternate collating
sequence (ACS), can be binary, and can have a null value.
• Keys cannot have the following Btrieve key flags: descending, supplemental, and
any-segment null. Keys must use ACS number zero, if any.
• There can be more keys in the Btrieve file than in the COBOL description and they
can have characteristics that are not legal for COBOL keys. However, they must
either have a starting position that does not match the starting position for any
COBOL key, or they must occur in the Btrieve definition after the COBOL key
description for that position.
• Within the record there should not be any multiple-byte integer data fields.
rmbtrv32 will not reject any files with fields of this type. Because of byte ordering,
however, there are no COBOL data types that can directly manipulate the integer
data in the field.
Variable-Length Records
RM/COBOL will support variable-length records using the Btrieve MKDE’s
variable-length record files. The size of the Btrieve data page will be either the minimum
record length or the maximum Btrieve MKDE page size, whichever is smaller.
For more details, refer to the discussion of variable-length records, logical and physical
record lengths, and page sizes in the Btrieve Programmer’s Guide.
Key Placement
The Btrieve MKDE restricts placement of keys within the first data page of a record. If a
file has variable-length records, the keys must fit within the minimum record length of the
file or the maximum Btrieve MKDE page size, whichever is smaller.
• BINARY data
• COMPUTATIONAL-1 data
• COMPUTATIONAL-4 data
For more information about RM/COBOL internal data formats, refer to Appendix C,
Internal Data Formats.
• Decimal
• Money
• String
All other Btrieve internal data formats can be interpreted by an RM/COBOL program on
a byte-by-byte basis. For more information about Btrieve internal data formats, refer to
“Extended Key Types” in the Btrieve Programmer’s Guide.
Input/Output Errors
Input/output errors that you would expect to occur for an RM/COBOL indexed file may
not occur for a Btrieve file. Because of its file structure and organization, information in
Btrieve files is stored differently than in RM/COBOL indexed files, or it is not recorded
at all. Thus, the RM/COBOL runtime system is unable to check or verify certain values
in these files.
For example, the error message 39,01, which normally occurs if an error is encountered
when the runtime system is trying to open an RM/COBOL indexed file, may not occur if
the file is a Btrieve file. Appendix A, Runtime Messages, provides more information on
this and other specific input/output error codes where this behavior can occur.
doverify
Note 1 If a problem occurs with the display features of the verification suite, make
sure you have properly set and exported the environment variable TERM for your
terminal type. If you have done this and a problem exists, verify that your terminal type
has an entry in the system terminal database (termcap or terminfo) and check the accuracy
of the cursor motion sequence. This can be accomplished by running the system visual
editor (vi).
Note 2 If any of the menu selections within the terminal configuration test work
incorrectly, refer to Chapter 8, RM/COBOL Features, for details on the terminal attributes
required by the runtime system for complete ACCEPT and DISPLAY functionality.
Single-User Tests
Six sets of tests are provided in the verification suite for single-user versions. They are as
follows:
1. Terminal Configuration Test. This consists of individual tests that verify the
functionality of ACCEPT and DISPLAY statements and defaults, screen editing
functions and color functions (for appropriately configured terminals).
2. File System Test. This tests the sequential, relative, and indexed file system. It
reads and writes records to each of the three file types.
6. Pop-Up Window Manager Test. This test ensures that the RM/COBOL
Pop-Up Window Manager feature is installed correctly. The program displays a
self-explanatory menu that allows you to test the various features of the Pop-Up
Window Manager system. If the runtime system has been linked to not include the
Pop-Up Window Manager, the program displays an appropriate message (see
Appendix D, Customizing RM/COBOL for UNIX).
Multiuser Test
An additional verification program is provided with an appropriately licensed, multiuser
version of RM/COBOL. This test ensures that RM/COBOL is interacting correctly with
the file protection mechanisms employed by your system.
The program pacetest needs to be run simultaneously from at least two terminals that use
the RM/COBOL runtime system on the computer. This test creates and uses two indexed
files: pinx and pinxfl. pinx is a file that contains a single control record which contains
the next available record in pinxfl. pinxfl is the working data file.
pacetest reads the control record, saves it, increments the control record, and writes it
back to pinx. The original number read is used as the primary key for the record written
to the growing pinxfl file. This scenario is repeated 100 times for each user running the
test. With two users running, 200 records would be written to pinxfl. The directions for
running pacetest are as follows:
runcobol pacetest
2. At one terminal only, choose function 1 to create the initial files. Wait for this
operation to complete.
3. At each terminal, choose function 2 to do simultaneous write operations. You will be
required to enter a unique station ID (1, 2, and so forth). Then, all stations should try
to press the Enter key simultaneously.
Single-User Tests
Six sets of tests are provided in the verification suite for single-user versions. They are as
follows:
1. Terminal Configuration Test. This consists of individual tests that verify the
functionality of ACCEPT and DISPLAY statements and defaults, screen editing
functions and color functions (for appropriately configured terminals).
2. File System Test. This tests the sequential, relative and indexed file system. It reads
and writes records to each of the three file types.
4. Printer Test. This tests that the printer configuration is correct and that
communication from RM/COBOL to the printer is successful. If no printer is
attached, preserve the test result in the prntst.out file by setting a synonym before
running this test. Using the Synonyms Properties tab (see page 3-29 for more
information), type PRINTER in the Name text box and type prntst.out in the Value
text box.
5. Sort-Merge Test. This tests the sort-merge function of RM/COBOL.
6. The Pop-Up Window Manager Test. This program displays a self-explanatory
menu that allows you to test the various features of the Pop-Up Window Manager.
• Creates object programs for execution with the RM/COBOL runtime system. Liant’s
use of this technique provides compactness and machine-independence.
• Creates program listings, the contents of which are chosen by entering the
appropriate Compile Command options.
Compilation Process
The RM/COBOL compiler is invoked when you enter the Compile Command, rmcobol.
Once invoked, the compiler makes one pass through the specified source file. During this
pass, both object files and listing files are generated. The object file contains the
machine-independent object code, executed at runtime, for the RM/COBOL program.
The listing file contains a source image, which may be printed at the end of each
compilation. Using the available Compile Command options, you can alter, augment, and
suppress portions of the information contained in the listing.
Source Files
RM/COBOL source files contain the RM/COBOL source code. Source lines are made
up of variable-length records. Source text is ASCII, with either a line feed (LF) character
or a carriage return (CR) and line feed (LF) character paired as the line separator.
Embedded tab characters are expanded to one or more spaces, according to the default
tab column position, which is every fourth column, starting with column 8 and
ending with column 72, or according to the value of the TAB-STOPS keyword in the
RUN-SEQ-FILES configuration record (see page 10-35).
Object Files
An object file is created on disk as a purely binary file. Its filename is identical to the
filename of the source file, with the filename extension .cob or .COB (or the extension
specified in the EXTENSION-NAMES configuration record described on page 10-19).
You can direct the object file to a directory other than the one on which the source file
resides. To do this, use the O Compile Command Option. The object file may be
suppressed by the use of the N Option.
Listing Files
The contents of RM/COBOL listings are detailed later in this chapter, beginning on
page 6-18. Listings can be directed to a disk file, the printer, the screen, or any
combination thereof, depending on the options selected in the Compile Command.
Listing files are given the filename of the source program, with the filename extension .lst
or .LST (or the extension specified in the EXTENSION-NAMES configuration record
described on page 10-19). The listing file is a printer file and therefore may be
configured using the PRINT-ATTR configuration record (see page 10-20).
6-2 Compiling
System Files
Libraries
A source file can contain more than one source program. Files containing a sequence of
two or more programs are referred to in this manual as libraries. With libraries, the
generated object file contains a distinct object module for each source program in the
source file, excluding contained programs. The object for a contained program is
considered part of the object of the program that contains it. The listing file contains a
complete listing of each source program in the source file.
Note RM/COBOL versions 1 and 2 did not require END PROGRAM headers to
separate a sequence of source programs. Versions 3 and later support nested programs,
which makes END PROGRAM headers necessary. If you have a source file with a
sequence of programs and no END PROGRAM headers, you can either add the headers
or specify the Z=2 Compile Command Option (described on page 6-14).
Use the Combine Program utility (rmpgmcom), detailed in the discussion that begins on
page G-9, to combine multiple object files into a single library when the source modules
are contained in separate files.
Compile Command
Use the Compile Command (rmcobol) to request program compilation and to specify
options.
Under UNIX, the Compile Command is entered at a shell prompt. After typing the
desired command and options, press Enter to begin compilation.
Under Windows, the Compile Command can be entered in the Command Line text box of
the Shortcut dialog box. See page 3-7 for instructions on creating a Shortcut. Choose the
RMCOBOL icon to begin compilation. Programs also may be executed by dragging the
.cbl source file to the RMCOBOL object or by double-clicking the source file.
filename is the name of the source file to be compiled. It may be any valid operating
system pathname, and may by partially or fully qualified. Specifying an extension is
optional, but that extension must not be the same as the object file extension (.cob or
.COB unless configured otherwise). If you do not enter a filename extension with
the pathname, the compiler begins its search for the source file by looking first for
the file exactly as specified. If it cannot find such a file, it looks for a file with the
supplied name and an extension .cbl. If the file is still not found when running under
UNIX, it looks for a file with an extension of .CBL. For all attempts to open the
source file, if neither a drive designator nor a directory path is specified, the directory
search sequence is used. If a directory path is specified, a directory search sequence
may be used if configured properly. See the discussions that begin on page 2-4 for
UNIX and page 3-11 for Windows, and the EXPANDED-PATH-SEARCH
configuration keyword discussed on page 10-27.
~ (tilde) can be used as a negation character. Its purpose is to negate the presence of
attributes in a COMPILER-OPTIONS configuration record (see page 10-6). Its use
is fully described in Step 2 on page 6-5.
option specifies the RM/COBOL compiler options, described in the next section.
Spaces or commas must separate options. Options may be entered in either
uppercase or lowercase letters. If an option is repeated in a command, the last
occurrence of the option is used. Each option may be preceded by a hyphen. If any
option is preceded by a hyphen, then a leading hyphen must precede all options.
When a value is assigned to an option, the equal sign is optional if leading hyphens
are used.
comment is used to annotate the command. The comment is ignored by the compiler
and has no effect on the compilation. The left parenthesis is always optional. The
right parenthesis is a required separator if comments are entered.
6-4 Compiling
Compile Command
Compile Command Options
Compile Command options can be specified in the following two ways:
Options read from the configuration file are processed before options in the Compile
Command. This means that options specified in a Compile Command will always
override conflicting or contradictory options in a configuration file. The configured
options, together with the options that appear in a Compile Command, apply to every
source program in the source file referred to in that Compile Command.
You can override specific options in a configuration file by negating the option in the
Compile Command. To do this, enter a tilde (~) and the option in the Compile
Command. For example, the following configuration file, possibly named config.cfg:
COMPILER-OPTIONS FLAGGING=HIGH,COM2,OBSOLETE
& OBJECT-VERSION=2
& LISTING-PATHNAME=LISTINGS
directs RM/COBOL to flag HIGH, COM2 and OBSOLETE language elements, to restrict
the object version level to 2, and to write the listing file to the directory named
LISTINGS.
For a particular compilation, you may want to suppress some or all configured options.
For example, to suppress the flagging of COM2 elements and the creation of the listing
file (here, assuming the program name is PAYROLL), enter the following Compile
Command:
rmcobol payroll G=config.cfg F=~COM2 ~L
This negates the flagging of COM2 elements and suppresses the creation of the listing file
(L option) for the compilation. The next time you use this configuration file in a
compilation, the configured options will be in effect again.
To disable all flagging, and to write the listing to the current directory, enter the following
Compile Command:
rmcobol payroll G=config.cfg ~F, L=.
A negated option calls up the default value for that option; that is, it behaves exactly as if
no option were configured.
There are six groups of Compile Command options:
1. Compiler configuration options
2. Data item options
3. File type options
4. Listing options
5. Object program options
6. Source program options
The following sections contain a complete description of the Compile Command options.
The following compiler options designate a file to be used as the complete compiler
configuration or as a supplement to it and allow suppression of the compiler banner
message.
G Use the G Option to designate a file to be used as the compiler configuration. The
G Option has the following format:
G=path
H=path
If no configuration exists (specified with the G Option), the specified file serves as
the complete configuration. See Chapter 10, Configuration.
6-6 Compiling
Compile Command
K Use the K Option to suppress the banner message and the terminal error listing. This
is useful when you are running under batch files or shell scripts.
W Use the W Option to specify the amount of memory (in kilobytes) that the compiler
should use for its internal table storage. The W Option has the following format:
W=n
The following compiler options direct the compiler to assume a certain usage for data
items.
S Use the S Option to direct the compiler to assume a separate sign when the SIGN
clause is not specified for a DISPLAY usage, signed numeric data item (that is, for a
data item whose PICTURE character-string clause begins with S) . The S Option
also allows a BLANK WHEN ZERO clause to be specified in the data description
entry of a signed numeric data item for compatibility with RM/COBOL 2.n. In such
cases, a trailing fixed insertion plus symbol (+) is assumed for the PICTURE
character-string.
Note This option should be used only when compiling existing source programs
written with an earlier version of RM/COBOL, and then only with caution. The use
of this option creates inconsistencies between RM/COBOL and ANSI COBOL 1974
and 1985.
The default is to assume a trailing combined (zoned) sign unless the SIGN clause is
present and to disallow the BLANK WHEN ZERO clause for signed numeric data
items. For more information about trailing combined (zoned) signs, see Table C-1 on
page C-2.
U Use the U Option to direct the compiler to assume an alternative usage for data items
described as COMP or COMPUTATIONAL. The U Option has the following
format:
U[=B|D|P]
The U Option specified alone or as U=B directs the compiler to assume BINARY
usage for data items described as COMP or COMPUTATIONAL. This option
causes COMP data items to be compatible with IBM OS/VS COBOL COMP data
items and may result in improved computational speed at runtime.
The U=P Option directs the compiler to assume PACKED-DECIMAL usage for
items described as COMP or COMPUTATIONAL.
The U[=B] and 2 Options are mutually exclusive; they may not appear in the same
Compile Command.
The default is to assume unpacked decimal format for data items described as COMP
or COMPUTATIONAL.
The following compiler options determine whether a sequential file is declared as a binary
sequential or a line sequential file.
B Use the B Option to define as binary sequential those sequential files not explicitly
declared to be line sequential in their file control entries. (See page 8-40 for a
discussion of file types and structure.)
V Use the V Option to direct that any sequential file not declared to be binary
sequential be considered line sequential.
Note The B and V Options are mutually exclusive; they may not appear in the same
Compile Command. If neither the B nor the V Option is used, the decision on whether
the file is binary sequential or line sequential is deferred to program execution. The
choice is then controlled by the configured DEFAULT-TYPE keyword (see page 10-35).
Listing Options
The following compiler options generate a listing and control the destination and contents
of the listing.
Note The L, P, and T Options direct the listing to different destinations; any or all of
these options may appear in the same Compile Command. If neither the T nor the K
Option is selected, an error-only listing is written to standard output.
6-8 Compiling
Compile Command
A Use the A Option to direct the compiler to generate the allocation map in the listing
(see the discussion that begins on page 6-22).
This is useful during program development for use with the RM/COBOL Interactive
Debugger.
The A Option may not be specified if none of the L, P, T, or Y=3 Options are
specified or configured.
By default, the allocation map is not created as part of the listing or debugging
information in the object file.
C Use the C Option to suppress the inclusion of copied text in the listing.
Copied text is source text brought into the program as a result of encountering a
COPY statement. (The COPY statement is described in more detail in the discussion
that begins on page 8-31 of this user’s guide, and in Chapter 1, Language Structure,
of the RM/COBOL Language Reference Manual.)
The C Option suppresses only the inclusion of the copied text in the listing; the
copied text is always compiled. Even though the C Option is selected, erroneous
lines encountered in the copied text during compilation are written to the listing along
with the associated diagnostic message.
Text to the right of the COPY statement in the source line that contains that statement
appears on a line by itself, immediately following the copied text.
The C Option may not be specified if none of the L, P, T, Y=2, or Y=3 Options are
specified or configured.
By default, copied text is included in the source listing. Copied text immediately
follows the line that contains the COPY statement.
E Use the E Option to suppress the inclusion of the source program component in the
listing. However, if errors are encountered during compilation, the listing will
include the erroneous lines and their associated diagnostic messages.
The E Option may not be specified if none of the L, P, or T Options are specified or
configured. The E Option is ignored if the Y=2 or Y=3 Options are specified.
By default, the source program component is included in the listing.
L Use the L Option to direct that a listing file be written to disk. The L Option has
the following format:
L[=path]
The L Option specified above directs the compiler to write the listing to the
default directory.
The listing file will always have the same name as the source file; its extension will
be the listing file extension (.lst or .LST unless configured otherwise). On those
operating systems that have case-sensitive filenames, the case of the extension will
match the case of the first character of the source file’s extension, or the first
character in the source file’s name if there is no extension. If there is no extension
and the first character of the source filename is not a letter, then the extension .lst
will be used. (See Table 1-1 on page 1-5 for examples of valid filenames.)
The default directory, when path is not specified, depends on whether the source
filename was specified with a drive or directory in its value.
If the source filename was specified with a drive or directory in its value, the default
directory is the one containing the source file.
Otherwise, the default directory is determined by using the compiler directory search
sequence. If an existing file with the same name as the source file and the listing file
extension is found using the compiler directory search sequence (see page 2-4 for
UNIX and page 3-11 for Windows), the default directory is the one in which that file
is found. If such a file is not found using the compiler directory search sequence, the
default directory is the current directory.
If a file already exists with the specified name and extension in the specified or
default directory, it is overwritten.
P Use the P Option to direct the compiler to write a copy of the listing to the printer.
Without a print spooler, the P Option cannot be used when the printer is busy.
By default, a copy of the listing is not written to the printer. See the discussion of the
listing that begins on page 6-18.
R Use the R Option to direct the compiler to generate a sequential number in the first
six columns of source records as they appear on the listing. The source file itself is
not affected.
If selected, this option numbers records beginning with 1 for each source or copy
input file. The number can be helpful when editing the source file. This line number
cannot be used with the RM/COBOL Interactive Debugger.
The default is to print the source record exactly as read, including any commentary
information present in columns 1 through 6.
6-10 Compiling
Compile Command
T Use the T Option to direct the compiler to write a copy of the listing to the standard
output device. Generally, the standard output device is the screen, but this can be
controlled through redirection.
By default, a copy of the listing is not written to the standard output device.
However, the last two lines of the summary listing—as well as all erroneous lines and
associated diagnostic messages—are written to the standard output device regardless
of the T Option. This display can be suppressed with the K Option (see page 6-7).
X Use the X Option to direct the compiler to generate a cross reference map in the
listing. The cross reference map contains an alphabetic list of all user-defined words
that appear in the source program. For each user-defined word, the line number of
each appearance is listed. Each line number is marked to indicate that the word is
being used as a declaration, a source operand or a possible destination operand. (See
Figure 6-10 on page 6-28 for a sample of the cross reference map.)
The X Option may not be specified if none of the L, P, T, or Y=3 Options are
specified or configured.
By default, the cross reference map is not included in the listing or in the debugging
information in the object file.
The following compiler options generate or suppress an object program and control the
destination and features of the object program.
M Use the M Option to direct the compiler to suppress automatic conversions in certain
ACCEPT and DISPLAY statements. In Format 1 and 3 ACCEPT statements, this
option suppresses automatic input conversion for numeric operands and suppresses
right justification for justified operands. For Format 3 DISPLAY statements
(DISPLAY screen-name), this option suppresses automatic output conversion for
numeric fields within the screen description entry.
Note This option must be used if Format 1 ACCEPT statements with numeric
operands are to be treated in compliance with ANSI COBOL 1985 and 1974.
The default is to provide input conversion for numeric operands of Format 1 and 3
ACCEPT statements, right justification for justified operands of Format 1 and 3
ACCEPT statements, and output conversion for numeric fields of Format 3
DISPLAY statements.
The default is to generate object code according to the rules for the O Option,
described in the following section.
O=path
The object file will always have the same name as the source file. Its extension will
be the object file extension (.cob or .COB unless configured otherwise). On those
operating systems that have case-sensitive filenames, the case of the extension will
match the case of the first character of the source file’s extension, or the first
character in the source file’s name if there is no extension. If there is no extension
and the first character of the source filename is not a letter, then the extension .cob
will be used. (See Table 1-1 on page 1-5 for examples of valid filenames.)
The O and N Options may appear together in a single compilation. For example, the
OBJECT-PATHNAME keyword in the COMPILER-OPTIONS configuration record
(see page 10-14) specifies the directory for the object file. Entering the N Option on
the Compile Command suppresses the generation of the object file (and as a result
negates the OBJECT-PATHNAME keyword in the configuration file).
The default directory depends on whether or not the source filename was specified
with a drive or directory in its value.
If the source filename was specified with a drive or directory in its value, the default
directory is the one containing the source file.
Otherwise, the default directory is determined by using the directory search sequence.
If an existing file with the same name as the source file and the object file extension
is found using the compiler directory search sequence, the default directory is the one
in which that file is found. If such a file is not found using the compiler directory
search sequence (see the appropriate installation and systems considerations chapter
in this user’s guide for your specific operating system), the default directory is the
current directory.
If a file already exists with the specified name and extension in the specified or
default directory, it is overwritten.
6-12 Compiling
Compile Command
Q Use the Q Option to direct the compiler to eliminate debugging information from
generated object programs. Programs compiled with this option will appear invisible
to the Interactive Debugger and Instrumentation. A statement address consisting of
an optional segment number and segment offset will be substituted for line numbers
in Normal Termination, Error Termination and Traceback runtime system messages.
A segment number and segment offset replace line number references when this
option is selected.
Note This option may be used to both reduce the memory requirements and increase
the execution speed of most programs.
Y Use the Y Option to direct the compiler to output debugging information in the
object file. The Y Option has the following variations:
Option Action
Y=0 or ~Y Omits the symbol and debug line table from the object program
file. This is also the default behavior if Y is not specified.
Y=1 or Y Places the symbol table but not the debug line table in the object
file. When the symbol table is included in the object program
file, the source program data-names and index-names may be
used in Debug commands during execution (see Chapter 9,
Debugging).
Y=2 Places both the symbol table and the debug line table in the
object file. The line table is used by CodeWatch to display the
source program.
Y=3 Same as Y=2, except that the debug line table also includes
allocation map and cross-reference information if the A and/or X
option are also specified. This information can then be viewed
within CodeWatch, but may lead to large object program files.
Object program files created with Y=2 and Y=3 are fully compatible with all
versions of the RM/COBOL runtime (note that previous versions will ignore these
tables). This option does increase the size of the object program files, but has no
effect on runtime performance or memory requirements.
Note A new option in the rmpgmcom utility (see Appendix G, Utilities), STRIP,
may be used to remove symbol table and debug line table information from object
files that were created with Y=1 or Y=2. For source code security, object program
files that contain line table information should be reduced in size with this option or
recompiled without the Y option before they are redistributed.
Z=version
Statements that require a higher object version level than the value specified will
be flagged in error (see page 6-33 and the description of the COMPUTATIONAL-
VERSION keyword for the COMPILER-OPTIONS configuration record that begins
on page 10-10). This option forces the generation of code accepted by earlier
versions of the RM/COBOL runtime system.
For source programs created with versions 1 or 2 that contain a sequence of programs
without an END PROGRAM header, this option can prevent the compiler from
treating the second or subsequent programs as contained programs. Since version 3
is the first version supporting nested source programs, setting Z=1 or Z=2 forces the
compiler to treat the source file as a sequence of programs even in the absence of an
END PROGRAM header.
7 Use the 7 Option to specify the semantic rules under which the program is to be
compiled.
7 specifies that the source program is to be compiled with ANSI COBOL 1974
semantics. ANSI COBOL 1974 semantics affect the I-O status values,
PERFORM . . . VARYING statements, ALPHABETIC class conditions, and
alphabetic-edited data items. A more specific discussion of these semantic
differences can be obtained by contacting Liant technical support services.
The default is to compile the source program using ANSI COBOL 1985 semantics.
6-14 Compiling
Compile Command
Source Program Options
The following compiler options affect the analysis of the source program and cause
flagging of certain source features.
D Use the D Option to direct RM/COBOL to compile all source programs as if the
WITH DEBUGGING MODE clause appeared in each compiled program. This
option causes all source lines with the letter D in the indicator area to be compiled as
if they had a space in the indicator area.
The default is to treat source lines with the letter D in the indicator area as
commentary information unless the WITH DEBUGGING MODE clause is specified
in the source program.
F Use the F Option to direct the compiler to flag occurrences of these language
elements:
COM1 INTERMEDIATE
COM2 OBSOLETE
EXTENSION SEG1
HIGH SEG2
F=(keyword −list)
F=keyword
The names of elements can be abbreviated, as long as they remain unique. If the
abbreviation is not unique, the keyword that occurs first alphabetically is chosen. For
example, C, CO and COM are valid abbreviations of COM1 but not of COM2.
Certain keywords cause more than one element of the language to be flagged:
1. Selecting INTERMEDIATE flags both HIGH and INTERMEDIATE elements.
2. Selecting COM1 flags both COM1 and COM2 elements.
3. Selecting SEG1 flags both SEG1 and SEG2 elements.
2 Use the 2 Option to direct the compiler to accept source programs created for the
RM/COBOL (74) 2.n compiler.
If the programs were compiled (or designed to be compiled) without the RM/COBOL
(74)2.n compiler ANSI Option, the separate sign (S) and line sequential (V) Options
(described on pages 6-7 and 6-8, respectively) may also need to be selected.
The 2 Option removes certain words from the list of RM/COBOL reserved words.
The removed words are those that are RM/COBOL additions to RM/COBOL (74)
2.n; thus, all words used in the earlier version as user-defined words are still valid.
Note carefully that if RM/COBOL language features are added to the program, the 2
Option can no longer be used, and the program must be changed accordingly. There
is also a technique for removing individual words from the list of reserved words.
See the discussion of the COMPILER-OPTIONS configuration record on page 10-6.
The 2 Option directs that COMP-3 data items always be signed, irrespective of the
presence or absence of an S in the associated PICTURE character-string.
The 2 Option directs that COMP-1 data items behave as in RM/COBOL (74) 2.n.
This causes the number of digits in the PICTURE character-string describing a
COMP-1 item to be ignored in three situations: when the item is the receiving item
in a MOVE statement, in an arithmetic statement that specifies ON SIZE ERROR,
and in an ACCEPT statement that specifies, explicitly or implicitly, input conversion.
In these situations, the COMP-1 item may contain any value in the range –32768
through 32767.
The 2 Option directs that OPEN EXTEND create a new file when the file is not
present, even when OPTIONAL was not specified in the file control entry.
The 2 Option directs that equality and inequality relation conditions, where the
subject and object are similar signed packed-decimal (COMP-3 or PACKED-
DECIMAL usage) or signed unpacked-decimal (COMP usage) operands, should not
be optimized to use string comparison operations. The string comparison
optimization prevents detection of equality when the only difference between the
subject and object of the relation results from the change in positive sign convention
for such items.
The 2 Option directs that the size of index data items be two bytes in length.
The 2 Option directs that the implied EXIT PROGRAM required by ANSI COBOL
1985 at the end of the Procedure Division be omitted. RM/COBOL (74) 2.n had
only an implied STOP RUN at the end of the Procedure Division.
6-16 Compiling
Compile Command
The 2 and U[=B] Options are mutually exclusive; they may not appear in the same
Compile Command.
The default is to recognize all RM/COBOL reserved words, treat COMP-3 data
items without an S in their PICTURE character-string as unsigned data items, treat
COMP-1 data items the same as two-byte COMP-4 data items, return a file not
present error for OPEN EXTEND of a nonexistent file not described with the
OPTIONAL phrase in its file control entry, use the string comparison optimization
for conditional relations of similar signed COMP-3 and COMP data items, use a size
of four bytes for index data items, and include the implied EXIT PROGRAM at the
end of the Procedure Division.
This command compiles the program named payroll.con; it directs the listing to the
system printer (the P Option); declares all sequential files not defined as binary sequential
in the source program to be line sequential files (the V Option); and sequentially numbers
the printed listing, starting with 1 for each copy level, in the first six columns of the listing
(the R Option).
This command compiles the program demo.prg; the program is compiled as if the WITH
DEBUGGING clause were present (the D Option); the listing is written to the directory
named COBOL (the L Option); a separate sign is assumed in the absence of a SIGN
clause (the S Option); and the cross reference map is generated (the X Option). A
comment—3RD COMPILE—is reproduced in the listing header, but is ignored by the
compiler.
Note Under UNIX, the parenthesis must be preceded with a backslash (\) character in
order to be protected from the shell.
Here, the extension to the filename (.cob) is illegal, since .cob is the default extension for
the object file. The B and V Options are entered together: B treats all sequential files not
specified as either binary sequential or line sequential in the file control entry as binary
sequential, but V treats all such files as line sequential.
Listing
Depending on the options specified in the Compile Command, the compiler generates a
detailed listing. The T Option (see page 6-11) directs the listing to standard output. The
listing can be directed to the printer with the P Option (see page 6-10) and to a file with
the L Option (see page 6-9). All three of these options—or any combination thereof—
may be specified. However, keep in mind that in certain circumstances the listing may
contain lines as long as 118 characters. If the device to which the listing is sent cannot
accommodate lines of that width, characters at the right end of the long lines will be
truncated.
Note Error lines are always listed to standard output unless suppressed by the K Option
(see page 6-7).
2. Allocation map, which defines and locates each identifier used in the program.
3. Called program summary, which lists the names of all programs called or canceled
by the program being compiled.
4. Cross reference listing, which lists the names of all identifiers used in the program,
along with the source line numbers at which they are declared and used.
When the listing is written to a printer (either because the P Option is selected or because
a disk file that was generated as a result of the L Option is printed), each component starts
a new page.
6-18 Compiling
Listing
Program Listing
At the top of each page of the program listing, a header appears, a sample of which
appears in Figure 6-1.
Note The date and time formats are configurable (see the discussion of the
COMPILER-OPTIONS configuration record that begins on page 10-6).
Each page of the program listing also contains a subheader, illustrated in Figure 6-2.
This subheader sets a scale against which material on each page can be measured. The
column of numbers under the “LINE” heading contains sequential line numbers assigned
by the compiler to each line read from the source file or from a copy file; these line
numbers are used in the cross reference listing and in Debug. The numbers under the
“DEBUG” heading are used with the Interactive Debugger or for interpreting error
messages when the compiler Q Option is used; this column is used only when listing the
Procedure Division. The remaining headings locate the regions of the source line images:
the internal six-column line number field, area A, area B, the main body of the source
image (subdivided into ten-column subregions) and the eight-column identification field.
If the R Option was present in the Compile Command, the program listing contains a
compiler-generated line number in the PG/LN column.
The subheading is sometimes useful in determining when the text of a source line has
inadvertently extended beyond column 72, and is therefore not seen by the compiler.
The program listing itself contains the sequential line number, statement address, copy
level indicator (described in the next paragraph) and the source record. If errors were
detected during compilation, the appropriate error message diagnostic appears. The error
message marker and diagnostics are detailed on page 6-31.
+ n +
n is a decimal digit in the range 1 through 9. The copy level indicator appears
between the sentence address (DEBUG heading) and source record in the listing
whenever the source record has been copied at level n.
Statement addresses are listed in decimal notation. For overlay segments, the segment
number is printed as part of the statement address. A slash separates the segment number
from the offset within the segment. For example:
50/000100
refers to location 100 within segment 50. Segment numbers and the slash are suppressed
for the fixed permanent segment.
The generation of the program listing may be suppressed by specifying the E Option
(page 6-9) in the Compile Command. Copied source text can be suppressed with the C
Option (page 6-9). Error messages (if any) and their associated undermarks and source
text are not suppressed, even when the C or E Option has been selected.
6-20 Compiling
Listing
Figure 6-3 Sample Program Listing
z 12 IDENTIFICATION DIVISION.
PROGRAM-ID. ALLOCMAP. z
3 ENVIRONMENT DIVISION.
O 4 CONFIGURATION SECTION. O
z 5
6
SOURCE-COMPUTER. IBM-PC-XT.
OBJECT-COMPUTER. IBM-PC-XT, z
7 PROGRAM COLLATING SEQUENCE EBCDIC-CODE.
O 8 SPECIAL-NAMES. O
z 9
10
SWITCH-1 IS REPORT-MODE,
ON STATUS IS REPORT-LIST, z
11 OFF STATUS IS REPORT-NOLIST;
O 12 SWITCH-3 IS DISPLAY-MODE, O
z 13
14
ON STATUS IS DISPLAY-LIST,
OFF STATUS IS DISPLAY-NOLIST; z
15 CO1 IS TOP-OF-FORM;
O 16 CO5 IS AMOUNT-LINE; O
z 17
18
CONSOLE IS PC-DISPLAY;
SYSIN IS STANDARD-IN; z
19 SYSIN IS STANDARD-OUT;
O 20 ALPHABET ASCII-1 IS STANDARD-1; O
z 21
22
ALPHABET ASCII-2 IS STANDARD-2;
ALPHABET NATIVE-1 IS NATIVE; z
23 ALPHABET EBCDIC-CODE IS EBCDIC;
O 24 ALPHABET BACKWARDS IS "ZYXWVUTSRQPONMLKJIHGFEDCBA"; O
z 25
26
SYMBOLIC CHARACTERS QUESTION-MARK, ASTERISK ARE 64, 43;
CLASS PUNCTUATION IS ";", ",", ".", "!", "?". z
27 INPUT-OUTPUT SECTION.
O 28 FILE-CONTROL. O
z 29
30
SELECT REPORT-FILE1 ASSIGN TO PRINTER;
ORGANIZATION IS SEQUENTIAL; z
31 ACCESS IS SEQUENTIAL.
O 32 SELECT LOOKUP-FILE1 ASSIGN TO DISC; O
z 33
34
ORGANIZATION IS RELATIVE;
ACCESS IS SEQUENTIAL. z
.
O . O
z 151 .
PROCEDURE DIVISION USING ARG1-GROUP, ARG2-GROUP. z
152 000002 A.
O 153 000005 CALL "CHRRTN" USING NW5-MDATE, NW5-MTIME. O
z 154
155
000016 CALL MATHRTN USING NBS-1, NBU-1, NCS-1, NCU-1,
NLC-1, NPS-1. z
156 000035 STOP RUN.
O 157 END PROGRAM ALLOCMAP. O
4. Name, which is the actual user-defined word declared with the indicated attributes or
the figurative constant LOW-VALUE or HIGH-VALUE. These particular figurative
constants are listed since their value depends on the program collating sequence
declared in the source program.
6-22 Compiling
Listing
Figure 6-4 Allocation Map (Part 1 of 5)
z Special-Names
Association Status Type Name z
X"00" Figurative constant LOW-VALUE
O X"FF" Figurative constant HIGH-VALUE O
z SWITCH-1
SWITCH-1 On
Switch-name
Condition-name
REPORT-MODE
REPORT-LIST z
SWITCH-1 Off Condition-name REPORT-NOLIST
O SWITCH-3 Switch-name REPORT-MODE O
z SWITCH-3
SWITCH-3
On
Off
Condition-name
Condition-name
REPORT-LIST
REPORT-NOLIST z
C01 Channel-name TOP-OF-FORM
O C05 Channel-name AMOUNT-LINE O
z CONSOLE
SYSIN
Low-volume-I-O-name
Low-volume-I-O-name
PC-DISPLAY
STANDARD-IN z
SYSOUT Low-volume-I-O-name STANDARD-OUT
O STANDARD-1 Alphabet-name ASCII-1 O
z STANDARD-2
NATIVE
Alphabet-name
Alphabet-name
ASCII-2
NATIVE-1 z
EBCDIC PCS Alphabet-name EBCDIC-CODE
O Literal Alphabet-name BACKWARDS O
z X"3F" = "?"
X"2A" = "*"
Symbolic-character
Symbolic-character
QUESTION-MARK
ASTERISK z
Class-name PUNCTUATION
O O
alphabet-names, symbolic-characters, mnemonic-names, and class-names
User-defined words declared in the Data Division, other than index-names, are listed in
the allocation map with the following information:
1. Address, which is the decimal address for data-names. The “Address” column is
blank for file-names, cd-names and condition-names.
For data items declared with the external attribute in the File Section or
Working-Storage Section, the compiler-generated external number is printed on
a line preceding the file or level 01 item description.
For data-names declared in the Linkage Section, each level 01 or 77 item is preceded
by an indication of how it is addressable:
• If it is listed in the USING phrase of the Procedure Division header, “Un:” and
“Using argument n” are printed to indicate the formal argument umber is n
within the USING argument list.
• If it is a based linkage record and is not a formal argument, “Bn:” and “Based
linkage record n” are printed to indicate that the compiler assigned based linkage
record number is n.
2. Size, which is the decimal number of character positions required to store the value
of a data-name, or the maximum block size—in characters or records—for a file-
name declared with a non-zero block size. The “Size” column is blank for cd-names
and condition-names.
Note These first three columns (Address, Size, and Debug) are used with the
Interactive Debugger to display and modify the values of data-names. See
Chapter 9, Debugging.
6-24 Compiling
Listing
4. Order, which indicates the number of subscripts required when referencing the
data-name or condition-name. The “Order” column is blank for data-names not
requiring subscripting and also for file-names and cd-names. When one or more
subscripts are required, the order is indicated with a decimal number enclosed in
parentheses.
5. Type, which is a brief description of the item associated with the user-defined word.
For files, the organization and access are listed, in that order, separated by a slash.
6. Name, which is the actual user-defined word declared with the listed attributes. The
name is indented one column to the right for each increase in level-number.
User-defined words declared as index-names in the Data Division are listed in the
allocation map with the following information:
2. Span, which is the decimal number of character positions of the table entry
associated with the index-name. This value is needed in order to convert index-name
values to occurrence number values and vice versa.
Note These first three columns (Address, Span, and Debug) are used with the
Interactive Debugger to display and modify the values of index-names. See
Chapter 9, Debugging.
4. Type, which is a description of the item associated with the user-defined word. It is
Index-name for all index-names.
z Index-names
Address
for program ALLOCMAP
Span Debug Type Name z
0 5 IXN Index-name G2-I1
O 4 5 IXN Index-name G2-I2 O
z 8
12
13
13
IXN
IXN
Index-name
Index-name
NW3-I1
NW3-I2 z
index-names
6-26 Compiling
Listing
Constant-Names
User-defined words declared as constant-names in the Data Division are listed in the
allocation map with the following information:
1. Constant Value, which is the value associated with the constant-name. If the
constant-name value was specified with a constant-expression, then the result value is
shown. Otherwise, the literal associated with the constant-name is shown.
2. Type, which is a brief description of the type of the value associated with the
constant-name. If the constant-name value was specified with a constant-expression,
then the type is always Numeric unsigned. Otherwise, the type is the type of the
literal specified as the value for the constant-name.
The program-name appears without quotation marks for dynamic (identifier) references
and inside quotation marks for static (literal) references. The “Using count” field
lists the maximum number of arguments used in any CALL reference to the listed literal
or identifier.
Note The method used to mark possible destination references with surrounding
asterisks errs on the conservative side, particularly in arithmetic statements. The compiler
marks the second operand of an arithmetic statement as a possible destination even
though it may be followed by the GIVING phrase, which causes the second operand to be
only a sending item. The operands in the USING phrase of a CALL statement are always
considered to be possible destination references unless they are subject to a BY
CONTENT phrase.
z Cross
A
reference
/0152/
/Declaration/ *Destination*
z
ABSE-1 /0082/
O ABSR-1 /0083/ O
z ABS-1
AMOUNT-LINE
/0081/
/0016/ z
ANSE-1 /0085
O ANSR-1 /0086/ O
z ANS-1
ARG1-AREA
/0084/
/0113/ z
ARG1-COUNT /0112/
O ARG1-GROUP /0111/ 0151 O
z ARG2-AREA
ARG2-COUNT
/0116/
/0115/ z
ARG2-GROUP /0114/ 0151
O ARG3-AREA /0119/ O
z ARG3-COUNT
ARG3-GROUP
/0118/
/0117/ z
ASCII-1 /0020/
O ASCII-2 /0021/ O
z ASTERISK
BACKWARDS
/0025/
/0024/ z
DB1-DATA /0070/
O DB1-KEY 0047 /0069/ O
6-28 Compiling
Listing
Summary Listing
The summary listing shows the sizes of the regions of the generated object program.
Figure 6-11 illustrates this listing.
The line labeled “Read only size” lists the size of that region of the object program that
contains values that do not change during program execution. It consists primarily of the
instructions generated for the resident (or fixed) portion of the Procedure Division,
representations of the literals mentioned in the Procedure Division, and descriptors of the
operands referred to in the Procedure Division.
The line labeled “Read/write size” lists the size of that region of the object program that
contains values that might change during the course of execution. It consists primarily of
a current record area and a control block for each of the files specified, an area for the
Working-Storage Section and other internal control information.
The line labeled “Overlayable segment size” lists the size of the region of the object
program that is reserved for the independent and fixed overlayable segments of the
Procedure Division. Its length is the length of the longest independent or fixed
overlayable segment. All such segments are loaded into this common region on an
as-needed basis.
The line labeled “Total generated object size” lists the sum of the preceding values, and is
therefore the amount of memory needed to load the object program. It is not the total size
needed to execute that program. To execute the program there must be memory available
to accommodate not only the total size (as shown on the fourth line) but the operating
system, the runtime system, any external data items and the I/O buffers as well. Although
you have no control over the size of the operating system or runtime system, you can
exercise some control over the memory requirement for the I/O buffers by use of the
The line labeled “Maximum EXTERNAL size” indicates the size of the single largest
record area with the external attribute declared in the source program. This number is
useful because the maximum allowed value varies depending on the environment in which
the program is run. See the section “Memory Available for a COBOL Run Unit” on
page 2-7 for these limitations.
The line labeled “Total EXTERNAL size” indicates the sum of the sizes of all record
areas with the external attribute declared in the source program. This number provides
information needed in estimating the runtime system memory requirements of the
program, but is not a direct measure since the memory requirements depend on the use of
matching external records in other programs of the run unit.
Note The two lines regarding EXTERNAL size are omitted in the listing file when the
program does not specify the EXTERNAL clause for any item.
The line labeled "Source program used ... of 65534 available identifiers ..." indicates the
amount of the identifier table limit consumed. Identifiers are the individual items
(classes, symbolic-characters, data items, conditions, and so forth) declared in the
program. Each data item and condition defined in the program requires its own identifier
entry even if the data-name or condition-name for the data item or condition is the same,
since qualification can be used to distinguish between the data items or conditions. The
T1C in the message refers to the compiler limit listed in Table 6-1 beginning on
page 6-36.
The line labeled "Source program used ... of 588800 available user-defined word space
..." indicates the amount of the user-defined word space consumed. User-defined words
are the unique spellings of words used as alphabet-names, cd-names, class-names,
condition-names, data-names, file-names, index-names, key-names, mnemonic-names,
paragraph-names, section-names, and symbolic-characters in the source program. Any
particular spelling consumes space only once in the user-defined word table. The T2B in
the message refers to the compiler limit listed in Table 6-1 beginning on page 6-36. The
limit of 98133 shown in that table assumes 30-character names, which use six words each
in the user-defined word space. If names averaged 24-characters in length (5 words
average use of word space), the limit would be 117760 names.
The line labeled "Maximum compilation memory ..." indicates the amount of memory
required to compile the source program. Setting the workspace size for the compiler to a
value at least this size or slightly larger results in the best compilation speed with the
minimum amount of memory consumption. The workspace size can be set using the W
command line option or the WORKSPACE-SIZE keyword of the COMPILER-OPTIONS
configuration record (see page 10-6). The number of presses indicates how many times
the compiler attempted to recover unused memory. Minimizing the number of presses by
6-30 Compiling
Listing
increasing the workspace size provides improved compilation speed. If the number of
presses is zero, then the compilation speed cannot be improved by increasing the
workspace size. The number of increases indicates the number of times the compiler had
to request more memory because the original workspace size was too small.
The lines labeled “Errors: . . .” and “Previous diagnostic message . . .” summarize the
number of diagnostic messages issued during compilation and the location of the last
diagnostic message, respectively.
The line labeled “Object version level” indicates the object version level of the object
program associated with the program being compiled. See Appendix H, Object Versions,
for complete information on the object version levels accepted by RM/COBOL.
The line labeled “Options in effect” and the lines that follow list the options selected for
the compilation. The listed options may have been specified in the Compile Command or
be part of a configuration file (see the discussion of the COMPILER-OPTIONS record
that begins on page 10-6). Those options that have no direct affect on the compilation
(such as list directing options) are not listed; if no options were specified, these lines will
not appear.
z 1
2
IDENTIFICATION DIVISION.
PROGRAM-ID. ALLOCMAP. z
3 ENVIRONMENT DIVISION
O 4 CONFIGURATION SECTION. O
z *****
$
1) 0319: E Period space separator expected. z
5 SOURCE-COMPUTER. RMCOBOL.
O 6 OBJECT-COMPUTER. same. O
z *****
$
1) 0382: E Computer-name must be user-defined word instead of z
reserved word. (scan suppressed).
O *****Previous diagnostic message occurred at line 4. O
z 7 PROGRAM COLLATING SEQUENCE EBCDIC-CODE.
$ z
***** 1) 0005: I Scan resumed.
O *****Previous diagnostic message occurred at line 6. O
z 8
9
SPECIAL-NAMES.
SWITCH-1 IS REPORT-MODE, z
The first number on the line following the line with the undermark refers to the undermark
number. Multiple errors on the same line are numbered in ascending order, reading left to
right. The next number is the error number. This corresponds to the appropriate message
Following the error number is a single letter that indicates the severity of the error. There
are three classes:
3. W indicates a warning.
Error Recovery
The RM/COBOL compiler may display a recovery message along with the error
diagnostic. This recovery message is generated if—as often happens—a compilation
error interrupts scanning. In this case, the source text is ignored until the compiler finds a
recovery point. This minimizes the amount of code you need to examine if an error
occurs. See Figure 6-13 for an illustration.
z 10
11
ON STATUS IS REPORT-LIST,
OFF STATUS IS REPORT-NOLIST; z
12 C21 IS TOP-OF-FORM;
O $ O
z ***** 1) 0088: E Wrong code-name in ALPHABET clause. (scan suppressed).
*****Previous diagnostic message occurred at line 7. z
13 CONSOLE IS CRT-DISPLAY;
O 14 PROCEDURE DIVISION. O
z $
***** 1) 0005: I Scan resumed. z
The undermark indicates that the compiler did not recognize the alphabet code-name
given.
When the compiler encounters an error, it first attempts to make an assumption about
what was actually meant. When it can do so, it continues compiling from the point of
error, without displaying the “(scan suppressed)” portion of the message.
If it cannot do so, the compiler suppresses scanning until it finds a point where it can
begin again. In this case, an undermark indicates where it restarted scanning, and the
informational “Scan resumed” message is written. No source text between the undermark
associated with the “(scan suppressed)” message and the “Scan resumed” message is
compiled. This may result in data-names being undefined if the message occurs in the
Data Division.
6-32 Compiling
Listing
The diagnostic information described previously is always contained in the listing
regardless of the setting of the compiler options. If the L, P, and T Options are all absent
(meaning that the listing is not being written to any device), the diagnostic information is
written to the standard output device.
Error Threading
RM/COBOL provides error-threading facilities. By reading the “Previous diagnostic
message occurred at line” message, you can trace back through every error encountered
during compilation. This message may also appear after the summary listing, to point to
the last error in the program.
Compilation always proceeds to the end of the program regardless of the number of errors
found, unless an error causes abnormal termination. Global errors, such as undefined
paragraph names and illegal control transfers, are listed at the end of the listing file
allocation map.
The third line of the compiler banner appears only when options have been specified in a
configuration file or in the Compile Command. Options displayed as a single character
appear first. If flagging is configured, the configured keywords appear next; long
keywords are abbreviated. If an object pathname or a listing pathname is configured, it
appears in the form O=pathname or L=pathname. If the object version level number is
configured, it appears in the form Z=nnnn (where nnnn is a four-digit decimal number).
6-34 Compiling
Compiler Status Messages
The other messages appear under specific circumstances. They are listed in Appendix B,
Compiler Messages, of the RM/COBOL Language Reference Manual.
During initialization, the compiler locates and reads its message file. If it cannot find its
message file or the message file is corrupt, one of the following messages appears:
The compiler compares its version number and product code with those in the message
file. If they do not match, one or both of the following messages appears:
When any of the above messages appear, the compilation terminates with the following
message:
The compiler message file may have the wrong name or be in the wrong directory. The
compiler message file must have the name rmc.msg (RMC.MSG under UNIX). The
compiler attempts to find the message file in the directory that contains the rmcobol
executable file, the current directory, or through the PATH directory search sequence (see
page 2-4 for UNIX or page 3-11 for Windows).
Error
Number Message Text
1 Compiler limit exceeded, Tnn message.
The program has exceeded an internal compiler limit. This can be remedied by dividing
the program into a main program with multiple subprograms. The table number and
table usage are included in the message to provide additional information to help keep
the program in conformance with compiler limits. If this error continues to occur even
in a small program, it suggests an internal compiler malfunction. Provide a source copy
and the table number as it appears in this message to Liant technical support services.
The values of nn are listed as table numbers, and the values for message are listed as
table usage in the following table. Limits are provided only where meaningful; all
compiler tables are listed since error number 2 also displays this information.
Table
Number Table Usage Limit
T00 Source (input source records, contiguous comments) 28000
T01 AliasID (aliased identifiers) 65534
T02 Alter (ALTER statements) 65534
T03 BackPatchPsect (object back patches)
T04 Cfd (COBOL file definers) 65534
T05 Code (object code buffer)
T06 Condition (condition-names) 65534
T07 Corresponding (CORRESPONDING items for MOVE,
ADD, or SUBTRACT)
T08 CrossRef (cross reference entries) 290000
T09 DataParameter (forward data references, for example, FILE 65534
STATUS)
T0A DataRecord (DATA RECORDS clause references)
T0B DeclarativeRefError (declarative reference errors)
T0C DeferredScript (deferred subscripting in Screen Section) 65534
T0D DimensionTemp (table dimensions in subscripting)
T0E Dsect (data descriptions for data references) 65534
T0F ErrorID (identifier errors discovered after the definition)
T10 ErrorMessage (diagnostic messages for current line)
T11 ErrorProcedure (procedure errors)
T12 Error (diagnostic message entries)
T13 ErrorTemp (diagnostic message temporaries)
6-36 Compiling
Compiler Status Messages
Table 6-1 Abnormal Termination Messages (Cont.)
Error
Number Message Text
Table
Number Table Usage Limit
T14 Exit (stacked internal exit locations)
T15 External (external data items or files)
T16 Fail (stacked recovery information for parsing errors)
T17 FileArea (file areas for SAME [RECORD] AREA clauses) 65534
T18 FileAreaTemp (file area temporaries)
T19 Fsect (file references) 65534
T1A Global (global data items or files) 65534
T1B Group (group data items stack for a record)
T1C ID (identifier definitions) 65534
T1D IndexTempHold (held index temporaries)
T1E IndexTemp (index temporaries)
T1F InspectTempHold (held INSPECT temporaries)
T20 InspectTemp (INSPECT temporaries)
T21 IntegerConstant (integer constants) 65534
T22 Jsect (procedure references) 65534
T23 Label (made intra-statement labels) 65534
T24 LiteralCharacter (literal characters) 65534
T25 LiteralRef (literal references) 65534
T26 Literal (literal descriptors) 65534
T27 LiteralTemp (literal temporaries)
T28 LiteralValue (literal values) 65534
T29 LocalSymbol (local symbol information for object symbol
table)
T2A NameLink (user-defined word links) 98133
T2B Name (user-defined words) 98133
T2C NextSentenceLabel (NEXT SENTENCE labels)
T2D NumericTemp (numeric temporaries) 65534
T2E Operand (statement operands)
T2F PackTemp (character packing temporaries)
Error
Number Message Text
Table
Number Table Usage Limit
T30 ParameterText (diagnostic message parameter text)
T31 Partial (partial segments) 65534
T32 Perform (PERFORM statements) 65534
T33 PictureTemp (PICTURE character-string temporaries)
T34 PointerTemp (pointer temporaries stack)
T35 PointerTempHold (pointer temporaries save)
T36 Polish (expression evaluation Polish)
T37 PolishTemp (expression evaluation Polish temporary)
T38 PrecomputeRef (precomputed subscripting or reference 65534
modification)
T39 Preset (initial VALUE clause values)
T3A ProcedureRef (procedure references) 65534
T3B Procedure (procedure definitions) 65534
T3C ProgramName (program-names)
T3D ProgramNest (contained programs)
T3E Program (programs referenced by CALL statements) 65534
T3F Qualifier (qualifiers in identifiers)
T40 QualifierTemp (qualifier temporaries)
T41 RecordKey (record keys) 65534
T42 RecordKeyTemp (record key temporaries)
T43 RefMod (reference modifiers) 65534
T44 ReplaceKey (REPLACE statement keys) 65534
T45 ReplaceText (REPLACE statement text) 65534
T46 ReplacingKey (REPLACING phrase keys in COPY 65534
statements)
T47 ReplacingText (REPLACING phrase text in COPY 65534
statements)
T48 SameSortArea (SAME SORT AREA list)
T49 ScreenAttributes (Screen Section data item attributes) 65534
T4A ScreenGroup (Screen Section groups)
6-38 Compiling
Compiler Status Messages
Table 6-1 Abnormal Termination Messages (Cont.)
Error
Number Message Text
Table
Number Table Usage Limit
T4B ScriptPlex (subscripted reference entries) 65534
T4C ScriptRef (subscripted references) 65534
T4D ScriptTemp (subscript temporaries)
T4E Segment (Procedure Division segments) 65534
T4F SortMergeBlock (SORT and MERGE statements)
T50 SourceTemp (input source character temporaries)
T51 SpecialRegister (special register references) 65534
T52 Symbol (user-defined word temporaries)
T53 SystemNames (implementor-names) 65534
T54 TableIndex (INDEXED BY phrases of OCCURS clauses)
T55 TableKey (KEY phrases of OCCURS clauses) 65534
T56 Table (OCCURS clauses) 65534
T57 UndefinedProcedure (undefined procedure references)
T58 UsingID (Procedure Division header USING list) 256
T59 Work (compiler data stack) 65534
2 Table memory overflow, Tnn message.
The program has exceeded the available workspace when adding information to
the indicated compiler table. Increase the amount of user space available to the
compiler with the W Option, reduce the program size by dividing the program into
a main program with multiple subprograms or by using segmentation, or use shorter
data-names.
The values of nn are listed as table numbers, and the values for message are listed as
table usage in the table provided above for error number 1. Note that the table listed is
not necessarily one of the tables causing the problem; it may simply be the table being
increased in size when the operating system refuses to provide more memory to the
compiler.
3 Program data or code overflow.
The program exceeded an internal compiler limit. The listing file shows whether a data
or procedure overflow occurred.
One of the object sections has run out of space. Segmenting the program or dividing it
into a main program with multiple subprograms may solve a procedure overflow.
Reducing the size of data items described in the Data Division may solve a data
overflow condition.
Error
Number Message Text
4 Internal logic error, <error location information>
An internal compiler error has been encountered. If this problem arises, call Liant
technical support services for assistance. The <error location information> included in
this message may help determine the cause of this malfunction and should be recorded
for reference.
5 Fatal syntax error.
The compiler has encountered a syntax error from which it cannot recover. Fix the
syntax error in the source program and then compile the program again.
6 Object file overflow.
The object file has become too large for the compiler to produce a correct object file.
Break the program into two or more smaller programs that communicate using the
CALL statement.
7 Internal logic error, <error location information>
An internal compiler error has been encountered: an invalid compiler table number
(roll) has been referenced. If this problem arises, call Liant technical support services
for assistance. The <error location information> included in this message may help
determine the cause of this malfunction and should be recorded for reference.
8 Internal logic error, <error location information>
An internal compiler error has been encountered: an erroneous compiler table entry
number (group) has been referenced. If this problem arises, call Liant technical support
services for assistance. The <error location information> included in this message may
help determine the cause of this malfunction and should be recorded for reference.
9 Internal logic error, <error location information>
An internal compiler error has been encountered: an erroneous compiler table entry
offset (rung) has been referenced. If this problem arises, call Liant technical support
services for assistance. The <error location information> included in this message may
help determine the cause of this malfunction and should be recorded for reference.
n Unknown error number.
The value of n was not 1 through 9, inclusive. If this occurs, call Liant technical
support services for assistance.
6-40 Compiling
Compiler Status Messages
In the unnumbered error messages described below, pathname may be one of the
following: a valid pathname, PRINTER if the P Option is used, or the standard output
device if the T Option is used.
This message may occur for overlay files, program listings or object files. There are a
number of reasons this message may appear:
• A file exists, but RM/COBOL could not locate it because the directory search
sequence was not specified or was specified incorrectly.
• The system has reached its limit for the number of files that can be open at one time.
If the open error occurs on the compiler overlay file, the file may have the wrong name or
be in the wrong directory. The compiler overlay file must have the name rmcobol.ovy.
The compiler attempts to find the overlay file in the current directory and then in the same
directory as the compiler executable file. If unable to find the file there, the compiler
finds the overlay file through the PATH directory search sequence (see page 2-4 for
UNIX or page 3-11 for Windows).
This message can occur for both listing and object files. Generally, it means space is not
available to perform the write operation.
This message can occur for source, overlay, and object files. Generally, it indicates a
corrupted file. The error will also occur on source files that contain a NULL character.
Restore the file from its backup copy, or, for object files, restart the compilation.
This message can occur only for overlay files. It indicates that the overlay file is not the
same version as the resident compiler which loaded it. The overlay file may be corrupted,
in which case the problem can be corrected by restoring it from its backup. The problem
can also be caused by multiple versions of the compiler existing on the disk and an
incorrect establishment of the search sequence for overlay files. Such cases can be
corrected either by deleting the undesired version of the compiler or by resetting the
PATH environment variable such that the overlays associated with the resident compiler
will be found.
code is the compiler configuration error number listed in Table 6-2 (see also the
“Configuration Errors” section that begins on page A-37), or it is an input/output
error (see the “Input/Output Errors” section beginning on page A-11).
number is the logical record in the configuration file where the error occurred. When
using number to determine which record is in error, count lines combined with their
continuation lines as one record, and do not count comment lines or blank lines.
6-42 Compiling
Compiler Configuration Errors
The format with the record number and filename appears if an error is detected during the
processing of a configuration record. The text of the configuration record in error follows
the message. The other format is used if an error is detected after all configuration
records have been processed or if an error is detected without an associated record.
Code Description
E002 An invalid delimiter was found.
E004 A keyword has not been provided where one was expected or the
keyword is invalid.
E007 Syntax error.
E009 A value has not been provided where one was expected or the value is
invalid.
E00B A logical configuration record exceeds the maximum length.
E00C Token requested to dereserve was not found.
This error generally occurs because a buffer pool has been configured that is too large to
be allocated. See the BUFFER-POOL-SIZE keyword of the RUN-FILES-ATTR
configuration record (page 10-26) for instructions on changing the buffer pool size.
Under UNIX, the exit code can be interrogated from the shell. See shell (sh) in your
UNIX documentation for details.
Under Windows, a non-zero exit code is displayed in a message box titled “Return Code”.
Selecting the OK button closes the compiler window. The message box also will contain
the COBOL error code, if one occurred. Display of the Return Code message box may be
disabled by setting the RM/COBOL Windows registry value “Show Return Code Dialog”
to FALSE. For more information, see the section “Setting Miscellaneous Properties” in
Chapter 3, Installation and System Considerations for Microsoft Windows.
If the compiler was invoked from a COBOL program using the SYSTEM non-COBOL
subprogram (CALL “SYSTEM”), the exit code can be retrieved by passing an exit code
variable in the USING list. See page F-41 for more information on the SYSTEM
subprogram.
Table 6-3 Compiler Exit Codes
Code Description
0 Normal termination.
249 Warnings in program.
250 System initialization error.
251 Incorrect Compile Command.
252 Errors in program.
253 Reserved.
254 Compilation canceled (by pressing the CTRL and BREAK keys or the
system Interrupt key).
255 Compiler error.
6-44 Compiling
Compiler Exit Codes
Chapter 7: Running
One of the immediate results of compilation is the creation of the object file. Object files
contain the object version of the program that can be executed with the runtime command.
To execute the object program, use the RM/COBOL Runtime Command described in the
following section.
If your program uses segmentation, the segments are loaded and executed—as they are
referenced—by the RM/COBOL runtime system. The runtime system also allocates
memory for file buffers, external data items, and called RM/COBOL and non-COBOL
subprograms.
This chapter contains information on the RM/COBOL Runtime Command, runcobol, and
its options, examples of valid and invalid runtime commands, runtime messages, and
program exit codes.
Runtime Command
The RM/COBOL Runtime Command (runcobol) loads and executes RM/COBOL
programs.
Under UNIX, the Runtime Command is entered at a shell prompt. After typing the
desired command and options, press Enter to begin execution.
Under Windows, the Runtime Command can be entered in the Command Line text box of
the Shortcut dialog box. See page 3-7 for instructions on creating a Shortcut. Choose the
RUNCOBOL icon to begin execution. Programs also may be executed by dragging the
.cob object file to the RUNCOBOL object or by double-clicking on the object file.
filename is the name of the main program of the run unit. If the L Option (described
in the next paragraph) is not specified, filename must be a valid pathname. If a
filename extension is not specified, RM/COBOL uses first .cob, and then .COB
unless configured otherwise.
1. If the main program is not in a library, you must enter the appropriately qualified
pathname for filename.
2. If the main program is in a library, you must enter the L Option and the library
name containing the main program. The main program name specified by
filename must have been specified in the PROGRAM-ID paragraph of the
program.
In addition, the RM/COBOL runtime system also supports three OLE server registration
commands, which do not follow the command format described earlier in this section:
runcobol /regserver
runcobol /unregserver
runcobol /showserver
These options are described in the topic “Registering the RM/COBOLRuntime" in Chapter 3,
Installation and System Considerations for Microsoft Windows.
1. Configuration options
3. Environment options
4. Program options
7-2 Running
Runtime Command
The following sections contain a complete description of the Runtime Command options.
Configuration Options
The following options designate a file to be used as the complete runtime configuration or
as a supplement to it and allow suppression of the banner and STOP RUN messages.
C Use the C Option to designate a file to be used as the runtime configuration. The
specified file replaces any attached configuration for the run of the program only.
The C Option has the following format:
C=pathname
The default is to use the default configuration options described in Chapter 10,
Configuration.
K Use the K Option to suppress the banner message and the STOP RUN message. This
option is most useful when running under batch command files or shell scripts.
X=pathname
The following options invoke the RM/COBOL Interactive Debugger and collect program
instrumentation data.
D Use the D Option to invoke the RM/COBOL Interactive Debugger (called Debug).
Complete details on program debugging are contained in Chapter 9, Debugging.
The maximum buffer size is 65280 characters. The default size is 264
characters.
See page 2-23 for information about ACCEPT and DISPLAY buffers.
M Use the M Option to direct that level 2 ANSI semantics are to be used for Format 1
ACCEPT and DISPLAY statements.
The default is to use level 1 ANSI semantics in these situations (see the discussion
that begins on page 2-24).
S Use the S Option to set (or reset) the initial value of switches in the RM/COBOL
program. The S Option has the following format:
S=n ... n
Switches are numbered left to right from 1 to 8, without trailing zeroes. Each n
indicates a switch value: 0 indicates OFF and 1 indicates ON.
The default is to initialize all switches to OFF at the start of the run unit.
T Use the T Option to specify the amount of memory (n bytes) to be used for a sort
operation. The T Option has the following format:
T=n
There are a number of reasons to use the T Option in association with a sort
operation:
• To increase the amount of memory available for the sort operation, thereby
increasing the efficiency of the sort operation.
• To reduce the default memory allocation. This provides more room for loading
other data or called subprograms into memory during an input procedure.
If no SORT or MERGE statement is used in the run unit, using a value of 0 will
allow the runtime system to allocate the memory generally used to contain the
sort-merge logic for other purposes.
The default is 256000 bytes. The maximum allowed value is 2147483647 bytes.
7-4 Running
Runtime Command
Program Options
The following options define an argument to be passed to the main program and the
object libraries to be used for the run unit.
A Use the A Option to pass an argument to the main program. The A Option has the
following format:
A=[delim]string[delim]
string is an alphanumeric series of characters.
The delimiter character specified for delim may be either ' or ".
The delimiter character chosen as the opening delimiter must be used as the closing
delimiter as well. The closing delimiter must be followed by a space or comma if
another option follows the A Option. The delimiter character used cannot appear as
part of string.
If string contains no spaces, delimiter characters are not required.
Under UNIX, it is safer to delimit string using single quotation marks '. . .' because
characters in the argument might otherwise be meaningful to the shell (sh) command
interpreter.
To use the string assigned to the A option, you must have a Linkage Section for the
main program with the following form:
01 MAIN-PARAMETER.
02 PARAMETER-LENGTH PIC S9(4) BINARY (2).
02 PARAMETER-TEXT.
03 PARAMETER-CHAR PIC X OCCURS 0 TO 100 TIMES
DEPENDING ON PARAMETER-LENGTH.
L=pathname
These libraries allow more than one program to be contained within a file.
RM/COBOL imposes no limitation on the number of times the L Option may appear
in a single Runtime Command. (See the discussion of libraries that begins on
page 6-3.)
7-6 Running
Sample Runtime Commands
runcobol FIRSTPRG L=lib1\library.cob,D
This command executes the program FIRSTPRG contained in the RM/COBOL library
named lib1\library.cob.
It informs the runtime system of the name of the library (the L Option) that contains the
programs available, and invokes the Interactive Debugger (the D Option).
Here, the A Option is invalid, since the opening and closing delimiters are not identical.
runcobol lib1\library D T
In this example, the library used in the valid example cannot be executed by this
command, assuming the library contains more than one program. Also, the T Option is
specified without an associated value.
Runtime Messages
Messages of different classes may appear on the screen during program execution. The
message types are defined in the following paragraphs.
Diagnostic Messages
Diagnostic messages indicate either that an internal RM/COBOL error occurred or that an
I/O error occurred that was not handled by an appropriate USE procedure (see the
description of the USE statement in Chapter 5, Procedure Division, of the RM/COBOL
Language Reference Manual). If the D Option (see page 7-3) was entered in the Runtime
Command and one of these errors occurs, the Interactive Debugger will be entered to
allow examination of program data values. Otherwise, control will return to the operating
system.
Execution Messages
Execution messages report the status of the runtime system, or problems within the
RM/COBOL program that prevent successful execution.
These messages result from normal program termination, the presence of a STOP literal
statement, or an incorrectly entered option.
Diagnostic and execution error messages are detailed in Appendix A, Runtime Messages.
Under UNIX, the exit code can be interrogated from the shell. See shell (sh) in your
UNIX documentation for details.
Under Windows, a non-zero exit code is displayed in a message box titled “Return Code”.
Choosing the OK button closes the runtime window. The message box also will contain
the COBOL error code, if one occurred. Display of the Return Code message box may be
disabled by setting the RM/COBOL Windows registry value “Show Return Code Dialog”
to FALSE. For more information, see the section “Setting Miscellaneous Properties” in
Chapter 3, Installation and System Considerations for Microsoft Windows.
If the runtime system was invoked from a COBOL program using the SYSTEM
non-COBOL subprogram (CALL “SYSTEM”), the exit code can be retrieved by
passing an exit code variable in the USING list. See page F-41 for more information on
the SYSTEM subprogram.
Code Description
0 Normal termination.
249 Internal library subprogram called with incorrect parameters.
250 System initialization error.
251 Incorrect Runtime Command.
252 Program load failure.
253 Program error.
254 Run unit canceled (by pressing the Ctrl and Break keys or the system
Interrupt key).
255 I/O error.
7-8 Running
Program Exit Codes
Chapter 8: RM/COBOL Features
This chapter offers operating system-specific information on the use of RM/COBOL
statements and on RM/COBOL file types and structure. It is assumed the reader is
familiar with RM/COBOL statements.
• Redirection and piping of standard input and standard output (for more information,
see Chapter 2, Installation and System Considerations for UNIX).
• Unchanged but treated as if the field contained all spaces. This is the
default if neither the PROMPT nor UPDATE phrase is specified, and if the
ACCEPT-FIELD-FROM-SCREEN keyword of the RUN-ATTR record is not
specified or is set to NO in the configuration file (as described on page 10-23).
• Unchanged if neither the PROMPT nor UPDATE phrase is specified and the
ACCEPT-FIELD-FROM-SCREEN keyword of the RUN-ATTR record is set to YES
in the configuration file (see page 10-23).
• Filled with prompt characters if the PROMPT phrase is specified in the ACCEPT
statement.
• Filled with the current value of the associated ACCEPT operand if the UPDATE
phrase is specified in the ACCEPT statement.
You can then modify the contents of the screen field. Except for literal characters
specified with the MASK keyword of the CONTROL phrase, all positions of that field
can be modified until a field termination key is pressed. This modification of displayed
data is called field editing.
Defined Keys
The following sections list and explain the specially defined screen field editing keys and
the keys that generate field termination key codes.
Before these keys can function as described under UNIX, you must associate them with
the definition in the termcap or terminfo database (described on page 2-9, and detailed in
Chapter 10, Configuration). For example, the Left Arrow key might be associated with
the k1 termcap attribute.
Table 8-1 describes the keys used to manipulate the cursor during field editing.
CONTROL
Key Phrase Action
Left Arrow Default Moves the cursor left one character without affecting
any input characters. If the cursor is already at the
leftmost character in the screen field, a beep sounds.
MASK Same as above; however, the cursor skips over literal
characters that were specified in the mask.
Right Arrow Default Moves the cursor right one character without affecting
any input characters. If the cursor is already at the
rightmost character in the screen field, a beep sounds.
MASK Same as above; however, the cursor skips over literal
characters that were specified in the mask.
Backspace Default Moves the cursor left one character, and deletes the
input character in that position. All characters to the
right of the deleted characters are shifted to the left. The
prompt character (or a space if the PROMPT phrase was
not specified) is used to pad the screen field on the right.
If the cursor is already at the leftmost character in the
screen field, a beep sounds.
MASK Same as above; however, if the character to the left of
the cursor is a literal character, the cursor is moved left
until another input character is encountered, and that
character is deleted without altering any subsequent
input characters.
Delete Character Default Deletes the input character at the cursor position. All
screen field characters to the right of the cursor are
shifted to the left. The cursor remains stationary. The
prompt character (either as specified in the PROMPT
phrase, or spaces if the PROMPT phrase was not
specified) is used to pad the screen field on the right. If
the cursor is positioned at the right margin when this
key is pressed, and no characters are deleted, a beep
sounds.
MASK Same as above; however, only input characters up to the
next literal character to the right are shifted to the left.
CONTROL
Key Phrase Action
Erase Entire Default Places the cursor at the leftmost field position, and fills
all input positions with the prompt character, or spaces
if the PROMPT phrase was not specified. Note that the
Erase Entire key is not a field terminator.
MASK Same as above; however, literal characters in the mask
are not overwritten.
Erase Default Without moving the cursor, fills all input positions from
Remainder the current cursor position to the rightmost position of
the screen field with the prompt character, or spaces if
the PROMPT phrase was not specified. Note that the
Erase Remainder key is also a field termination key.
MASK Same as above; however, literal characters in the mask
are not overwritten.
Insert Character Default Initializes insert mode. Subsequent keystrokes insert
characters at the cursor position. Screen field characters
to the right of the cursor are shifted further to the right
to accommodate the inserted characters. If an attempt is
made to shift any character except for a space or a
prompt character (if the PROMPT phrase was specified)
beyond the rightmost input position of the screen field, a
beep sounds.
Insert mode is canceled when you press a field
termination key or any screen field editing key other
than Insert Character.
MASK Same as above; however, an attempt to shift an input
character past a literal character specified in the mask is
rejected and results in a beep.
Table 8-2 lists the keys that generate field termination codes and the corresponding codes.
The table lists the default termination codes that the runtime system returns for the
indicated PC keyboard keys and for the input sequences from the terminfo and termcap
interfaces. The keys may be configured to perform different actions and return different
codes (see page 10-49 for information on the TERM-INTERFACE configuration
specifications).
Note Any key not covered by footnote 1 in Table 8-2 causes the ON EXCEPTION
imperative sequence.
The generic key name is described in the “EXCEPTION and NOT EXCEPTION
Phrases” section of the ACCEPT statement in Chapter 6, Procedure Division Statements,
of the RM/COBOL Language Reference Manual. See also Table 10-5 on page 10-48 of
this guide for more information.
CONTROL Phrase
Some of the system dependencies that apply to the CONTROL phrase value concern
color-capable terminals. Systems with monochrome terminals ignore color information
contained in the CONTROL phrase value. (See the appropriate manufacturer's manual
for information on configuring your system with color capability.)
Under UNIX, color requests are processed only if the terminal does not require an
attribute byte and if one of the following conditions is met:
2. A configuration record is present to force the use of ISO Set Graphics Rendition
(SGR) sequences when the terminfo information is not available.
1. FCOLOR = color-name
See the discussion of the HIGH, LOW and OFF phrases in the following section for
information concerning high-intensity colors.
Note Under Windows, the default colors are determined by the Use Windows
Colors property as described on page 3-29.
2. BCOLOR = color-name
Table 8-4 contains a list of all the possible names for color-name. The left column
contains the valid color name. The right column shows the color that appears when
high intensity is specified (the default intensity).
Note Under Windows, the default colors are determined by the Use Windows
Colors property as described on page 3-29.
_____________________
1
These keywords are supported only under RM/COBOL for UNIX.
3. GRAPHICS
If the requested line draw characters are not available, the runtime system uses the
best available characters. If double-line characters are requested and only single-line
characters are available, they are used. If no line draw characters are available, then
plus-characters, vertical bars, and dashes are used.
IDENTIFICATION DIVISION.
PROGRAM-ID. GRAPHXMP.
PROCEDURE DIVISION.
GRAPHXMP.
DISPLAY " ", LINE 5 POSITION 1 ERASE.
* Single-line graphics
DISPLAY "lqqqqwqqqqk", CONTROL "HIGH, GRAPHICS".
DISPLAY "x x x", CONTROL "HIGH, GRAPHICS".
DISPLAY "tqqqqnqqqqu", CONTROL "HIGH, GRAPHICS".
DISPLAY "x x x", CONTROL "HIGH, GRAPHICS".
DISPLAY "mqqqqvqqqqj", CONTROL "HIGH, GRAPHICS".
DISPLAY " ".
* Double-line graphics
DISPLAY "LQQQQWQQQQK", CONTROL "HIGH, GRAPHICS".
DISPLAY "X X X", CONTROL "HIGH, GRAPHICS".
DISPLAY "TQQQQNQQQQU", CONTROL "HIGH, GRAPHICS".
DISPLAY "X X X", CONTROL "HIGH, GRAPHICS".
DISPLAY "MQQQQVQQQQJ", CONTROL "HIGH, GRAPHICS".
END PROGRAM GRAPHXMP.
4. MASK
A new keyword, MASK, has been added to the CONTROL phrase in ACCEPT and
DISPLAY statements. Use the following format:
MASK = mask
Note The MASK keyword is ignored when standard input or standard output is
redirected. This keyword is supported only under UNIX.
The MASK keyword in the CONTROL phrase causes a literal mask to be edited into
the ACCEPT or DISPLAY screen field. Literal mask characters are inserted into the
operand as it is transferred to the screen field if UPDATE is specified, or overlaid
onto the screen field if ACCEPT-FIELD-FROM-SCREEN is in effect.
In all cases, the size of the mask determines the size of the actual ACCEPT or
DISPLAY screen field. The optional SIZE phrase, or the size of the actual operand,
is used only to limit the number of data characters that may be edited and entered into
the ACCEPT screen field, or edited into the DISPLAY screen field prior to the
screen operation.
Table 8-6 lists the characters and character sequences that have special meanings in
the MASK keyword in a CONTROL phrase string. All other characters are treated
as literal characters.
Table 8-6 Characters Used with the MASK Keyword of a CONTROL Phrase
Character Meaning
X Specifies an input/output position. Characters will be accepted
wherever an uppercase "X" appears in the mask. DBCS characters can
be entered only into two, adjacent input positions.
_ Specifies a literal space.
\ Forces the following character to be treated as a literal character. The
backslash character is the escape character.
\X Specifies a literal "X".
\_ Specifies a literal underscore.
\, Specifies a literal comma.
\= Specifies a literal equal sign.
\\ Specifies a literal backslash.
Note 1 The preceding characters are case-sensitive. For example, “x” is not the
same as “X”.
a. If the operation is ACCEPT with UPDATE, characters from the operand are
copied (from left to right) into mask input positions. Mask literal characters are
skipped. If the operand is exhausted while there are still remaining input
positions, such positions are changed to literal spaces. If the mask is exhausted
before the operand, the remainder of the operand is ignored. The SIZE phrase,
if specified, limits the size of the operand, not the size of the mask.
If PROMPT is also specified, trailing input positions that are initialized with
spaces are replaced with the prompt character.
When the ACCEPT is terminated, the input field is scanned from left to right.
Characters appearing in input positions only are copied into the ACCEPT operand.
The operand is then processed by the CONVERT and UPPER phrases as if a regular
ACCEPT operation had been performed.
Table 8-7 lists keywords and phrases that, when specified in ACCEPT and/or
DISPLAY statements, have an effect on masked input processing.
5. PASS-THRU
The ability to write escape sequences (such as pass-through printing) to the terminal
with DISPLAY statements requires an additional keyword in the CONTROL phrase.
The keyword, PASS-THRU, indicates that all data specified in the corresponding
DISPLAY statement is to be written directly to the unit and not recorded in the
in-memory image of the screen. Thus, if the DISPLAY statement causes the screen
to change, the runtime system will have no knowledge of the change, and subsequent
DISPLAY statements may cause confusion for the terminal operator.
The PROMPT keyword causes ACCEPT statements to accept data with fill
characters in positions from which data is to be accepted. Optionally, the PROMPT
keyword may specify prompt-char, which causes the ACCEPT operation to use a
prompt character different from the system default. prompt-char must be a single,
literal character. For example:
7. REPAINT-SCREEN
The REPAINT-SCREEN keyword causes the entire screen to be refreshed from the
runtime system’s in-memory screen image. Any characters that were written directly
to the screen, such as from C routines or DISPLAY statements with the PASS-THRU
keyword (which are not recorded in the in-memory screen image), are replaced by the
last value written to that location by regular DISPLAY statements. This provides the
ability to clean up the screen without manually having to redraw the entire display.
REPAINT-SCREEN may be used in both ACCEPT and DISPLAY statements. It is
also callable from linked C routines (see page D-23 in Appendix D, Customizing
RM/COBOL for UNIX).
8. SCREEN-COLUMNS = screen-width
The SCREEN-COLUMNS keyword instructs the runtime system to change the
current display state of the user’s terminal to accommodate the requested screen size.
Screen-width values of 80 and 132 are currently supported.
Changing the terminal state produces a new, blank screen of the requested screen
width. All characters and windows on the original display are erased. In order to
maintain valid user-defined window control blocks, programs using pop-up windows
must close all pop-up windows before changing the screen size.
Most terminals support varying screen dimensions through normal and wide terminfo
and termcap entries. These normally correspond to 80 and 132 columns,
respectively. When a screen dimension change is requested, the runtime system
switches the TERM environment variable to the appropriate value and then sends
reset or initialization strings that change the terminal’s state. For terminfo, the strings
are defined with the capabilities rs1, rs2, and rs3. For termcap, the strings are
defined with the capabilities r1, r2, and r3. If these termcap capabilities are not
defined, the runtime system attempts to use the capability is. If these strings are not
set correctly, the terminal may be changed to an unpredictable state.
ERASE Phrase
All valid ERASE options (that is, ERASE, ERASE EOL, and ERASE EOS) erase the
screen with the specified background color, if possible. Under UNIX, if the
back_color_erase termcap or terminfo capability is set to false, or the appropriate termcap
or terminfo capability to perform the specified ERASE operation is not available, blanks
will be used to perform the operation.
HIGH Phrase
HIGH specifies that the foreground color be the corresponding high-intensity color listed
in Table 8-4 on page 8-13.
Under UNIX, when the HIGH phrase is present, the termcap capabilities used to set the
attributes of the terminal are nM, nB, nR or nS. The terminfo capabilities are sgr0,
blink, rev or sgr. The capability used is determined by the BLINK and REVERSE
phrases, and by the definition of termcap or terminfo capabilities in the terminal database.
When used with a color monitor under UNIX, the HIGH phrase specifies that the
foreground color be the high-intensity color from Table 8-4 that corresponds to the
foreground color name. If the REVERSE phrase is also present in the statement, it takes
precedence over the HIGH phrase. That is, any reversal of colors takes place before the
intensity is determined.
LOW Phrase
LOW specifies that the foreground color be the default foreground color unless
overridden with the FCOLOR keyword.
When the LOW phrase is present under UNIX, the termcap capabilities used to set the
attributes of the terminal are aL, aB, aR, or aS. The terminfo capabilities are dim or sgr.
The capability used is determined by the BLINK and REVERSE phrases, and by the
If the REVERSE phrase is also present in the statement, it takes precedence over the
LOW phrase, that is, any reversal of colors takes place before the intensity is determined.
OFF Phrase
OFF specifies that the background color be used for the foreground color. During field
editing for ACCEPT operations, the cursor is moved as specified, but without character
echoing.
If the REVERSE phrase is also present in the statement, it takes precedence over the OFF
phrase; that is, any reversal of colors takes place before the background color is
determined.
REVERSE Phrase
When the REVERSE phrase is present, the specified (or default) foreground color is used
as the background color, and the background color is used as the foreground color. The
REVERSE phrase is processed before the HIGH, LOW, and OFF phrases.
SIZE Phrase
The SIZE phrase is used to specify the size of an ACCEPT or DISPLAY field. The
runtime system imposes the following restrictions and limitations on the value of the SIZE
phrase:
1. The size of an ACCEPT or DISPLAY field must not exceed the number of characters
that can appear on the screen at one time, minus the column of the first character of
the data item.
2. The ACCEPT or DISPLAY field must not exceed the size of the associated buffer:
the default is 264 (see the discussion of the B Runtime Command Option on
page 7-4).
3. Fields that extend beyond the physical right margin of the screen wrap around to
the next line.
4. Fields that extend beyond the last line of the screen cause the screen to scroll
one line.
The BEFORE TIME phrase is used to “time-out” the execution of a pending ACCEPT
statement. The value of literal-8 or identifier-8 in the BEFORE TIME phrase represents
the time-out value in hundredths of seconds. The time-out value is limited to 23 hours, 59
minutes, 59.99 seconds (or 8,639,999). A value greater than 8,639,999 and less than or
equal to 4,294,967,295 (2**32 – 1) is set to 8,639,999.
A time-out value of 0 indicates that the ACCEPT operation should terminate immediately
if there is no character waiting. A time-out value greater than 4,294,967,295
(a PIC 9(10) data item set to a value of 9999999999 is recommended) indicates that
the BEFORE TIME phrase is being overridden and the ACCEPT statement will behave
as if the BEFORE TIME phrase were not specified.
When the ACCEPT statement is executed, a target time is calculated as the sum of the
current time and the time-out value. The time-out operation runs until the target time is
reached or a key is pressed. Once a key has been pressed, the time-out function is
disabled.
If the target time is reached before a key has been pressed, the ACCEPT statement is
terminated. A termination code of 99 is returned in identifier-9 if the ON EXCEPTION
phrase is specified.
The BEFORE TIME phrase is intended for terminal input and it is not available if input is
redirected.
Pop-Up Windows
A COBOL program can create one or more pop-up windows on the terminal output
device. A pop-up window (referred to hereinafter as a window) is a temporary subscreen
within the terminal screen to which all terminal output is directed. The rules concerning
placement of data and default video attributes that apply to full screen input/output also
apply to the window (including wrapping and scrolling). Thus the window performs just
like a full screen, except that a window is usually smaller.
A window is used for terminal input/output from the time it is created until the window is
removed by the COBOL program or another window is created. When a window is
Note Only information written to the screen by the RM/COBOL runtime system can be
restored to the screen in the event that it is covered by a window that is later removed.
For examples on using the RM/COBOL Pop-Up Window Manager, see your installation
directory and examine the following programs:
• wintest.cbl • winreltv.cbl
• winattrb.cbl • winstat.cbl
• winbordr.cbl • wintitle.cbl
• wincolor.cbl
Note The format shown is a subset of the Format 2 DISPLAY Terminal I-O statement
because some options of the complete statement are not applicable to window creation.
identifier-1 specifies the window control block for the window creation. See pages 8-24
and 8-27 for more information.
BEEP Phrase
The presence of the BEEP phrase in the DISPLAY statement causes the audio alarm
signal to occur at the creation of the window. If the BEEP phrase is omitted, no signal is
given.
BLINK Phrase
The presence of the BLINK phrase causes the border, title, and fill characters of the
window to appear in a blinking mode. If the BLINK phrase is not specified, the border,
title, and fill characters appear in a nonblinking mode.
The FCOLOR and BCOLOR keywords can be used to set the colors of the border
characters, title characters, and fill characters of the window being created. FCOLOR
specifies the foreground color of each character, and BCOLOR defines the background
color. FCOLOR and BCOLOR also establish the initial default colors for ACCEPT and
DISPLAY statements performed while the window is active. See Table 8-4 on page 8-13
for valid color names. If FCOLOR and BCOLOR are not specified when creating a
window, the default colors (if any) in effect when the window creation is requested are
carried over to the new window.
Additional keywords that may be specified in the CONTROL phrase and that affect the
creation of the window include: HIGH, LOW, BLINK, NO BLINK, REVERSE, NO
REVERSE, ERASE, NO ERASE, BEEP, and NO BEEP. The meanings of these
keywords when they appear in the value of the CONTROL phrase operand are the same
as the corresponding phrases that may be written as static options of the DISPLAY
statement, with the addition of the negative forms to allow suppression of statically
declared options. The window creation effects of the static phrases and the corresponding
CONTROL phrase keywords are described in the following paragraphs.
ERASE Phrase
The presence of the ERASE phrase causes the window area to be erased upon creation of
the window.
Note Using the EOS or EOL reserved words with ERASE causes the ERASE phrase to
be ignored.
The presence of the HIGH or LOW phrase causes the border, title, and fill characters of
the window to be painted at the specified intensity. When HIGH or LOW is not
specified, the default intensity is HIGH.
Note Under Windows, the HIGH and LOW phrases do not affect the border or the title
of the window.
The window is painted on the screen with LINE 1 and POSITION 1 of the window
positioned at the LINE and POSITION specified in the DISPLAY statement creating the
window. See “Defining the Location of the Pop-Up Window” on page 8-28 for further
discussion of the placement of the window. LINE 1, POSITION 1 of the window is
limited to the boundaries of the screen.
If requested, the border occupies the lines immediately above and below the window, and
the columns immediately to the right and to the left of the window. If a title is requested,
it will be painted within the top or bottom border. If a title is requested and a border is
not requested, the title will occupy the line either immediately above or immediately
below the window.
If the LINE or POSITION phrase is omitted from the DISPLAY statement, the line and
position values for the window are determined in the same manner as the line and position
values in a non-window Format 2 DISPLAY statement, except that the ERASE phrase
and the window dimensions are not considered (see the section “Determining Line and
Position” for the DISPLAY statement in Chapter 6, Procedure Division Statements, of
the RM/COBOL Language Reference Manual).
REVERSE Phrase
The presence of the REVERSE phrase causes the border, title, and fill characters of the
window to appear in a reverse video mode. If the REVERSE phrase is not specified, the
border, title, and fill characters appear in the normal video mode.
Note Under Windows, the REVERSE phrase does not affect the border or the title of
the window.
The UNIT phrase, if specified, must be written first. The other phrases may be written in
any order. If not running under UNIX, the value of identifier-2 or literal-2 in the UNIT
phrase is ignored. Under UNIX, the value of identifier-2 or literal-2 specifies the
terminal upon which the window is to be created. If the UNIT phrase is omitted, the
terminal that started the run unit is used.
Note The format shown is a subset of the Format 2 DISPLAY statement because some
options of the complete statement are not applicable to window removal.
identifier-1 specifies the window control block for the window creation. See pages 8-23
and 8-27 for more information.
CONTROL Phrase
UNIT Phrase
The UNIT phrase, if specified, must be written first. The other phrases may be written in
any order. If not running under UNIX, the value of identifier-2 or literal-2 in the UNIT
phrase is ignored. Under UNIX, the value of identifier-2 or literal-2 specifies the
terminal upon which the window is to be created. If the UNIT phrase is omitted, the
terminal that started the run unit is used.
01 WINDOW-CONTROL-BLOCK.
03 WCB-HANDLE PIC 999 BINARY(2)
VALUE 0.
03 WCB-NUM-ROWS PIC 999 BINARY(2).
03 WCB-NUM-COLS PIC 999 BINARY(2).
03 WCB-LOCATION-REFERENCE PIC X.
88 WCB-SCREEN-RELATIVE VALUE "S".
88 WCB-WINDOW-RELATIVE VALUE "W".
03 WCB-BORDER-SWITCH PIC X.
88 WCB-BORDER-ON VALUE "Y" FALSE "N".
03 WCB-BORDER-TYPE PIC 9.
88 WCB-BORDER-WCB-CHAR VALUE 0.
88 WCB-BORDER-PLUS-MINUS-BAR VALUE 1.
88 WCB-BORDER-LINE-DRAW VALUE 2.
88 WCB-BORDER-DBL-LINE-DRAW VALUE 3.
03 WCB-BORDER-CHAR PIC X.
03 WCB-FILL-SWITCH PIC X.
88 WCB-FILL-ON VALUE "Y" FALSE "N".
03 WCB-FILL-CHAR PIC X.
03 WCB-TITLE-LOCATION PIC X.
88 WCB-TITLE-TOP VALUE "T".
88 WCB-TITLE-BOTTOM VALUE "B".
03 WCB-TITLE-JUSTIFICATION PIC X.
88 WCB-TITLE-CENTER VALUE "C".
88 WCB-TITLE-LEFT VALUE "L".
88 WCB-TITLE-RIGHT VALUE "R".
03 WCB-TITLE-LENGTH PIC 999 BINARY(2).
88 WCB-TITLE-LENGTH-COMPUTE VALUE 0.
03 WCB-TITLE PIC X(40).
Note The use of zero is allowed for compatibility with previous versions of the Pop-Up
Window Manager, but it is strongly discouraged.
The created window is limited to the boundaries of the screen, not to the boundaries of
the active window.
WCB-FILL-SWITCH determines whether the window should be filled with the character
defined by WCB-FILL-CHAR when it is created. If the window is not filled, then the
contents in the defined window area remain untouched until modified by a subsequent
ACCEPT or DISPLAY statement in the window. A value of Y indicates that the window
area be filled with the defined character. A value of Y will also cause an ERASE phrase
to be ignored. A value of N indicates that the window area is to be left unchanged.
The parameter WCB-FILL-CHAR determines the character to be used to fill the window
area. This field is ignored unless WCB-FILL-SWITCH has a value of Y.
The length of the title is defined by the value of the WCB-TITLE-LENGTH parameter.
If the value of this field is non-zero, WCB-TITLE-LENGTH indicates the number of
characters, beginning with the first character of the WCB-TITLE field, that are to be used
as the title of the window. If the value of this field is zero, the title string is made up of all
characters between the first character of the WCB-TITLE field to the last non-blank
character in the field.
The WCB-TITLE parameter defines the text to be placed in the title of the window. This
field may be any length sufficient to contain the desired title, and must be the last data
item in the window control block. The length of 40 specified in the example is an
arbitrary value.
Code Description
0 Operation successfully completed.
1
301 Window border or title does not fit on screen.
1
302 Title is too long for window or specified title length is longer than the
title field in the window control block.
3031 Requested window will not fit on screen.
304 No windows are active.
305 Window manager is not available.
306 Out of memory.
307 Too many windows.
308 Buffer I/O error.
309 Requested REMOVE-WINDOW for inactive WCB.
310 CREATE-WINDOW requested with active WCB.
311 Invalid parameter in WCB.
1
These error codes are reported differently under Windows than under UNIX, or they are not
reported.
COPY Statement
Use the COPY statement to copy RM/COBOL source text from a specified file into the
source program. The text copied may have been created outside RM/COBOL, either
through a text editor or through some other process. The file is copied at the point at
which the COPY statement appears in the program; the file logically replaces the COPY
statement.
A copied file may in turn contain COPY statements, up to the limits of either five (the
typical case) or nine (if the last statement in the copy file is a COPY statement).
See the discussion of the COPY statement in Chapter 1, Language Structure, of the
RM/COBOL Language Reference Manual, for a description of the syntax and field
definitions.
If you do not enter a filename extension with the filename, the compiler assumes an
extension of .cbl. If it cannot find such a file, it then looks for a file with the supplied
name with the extension .CBL. The assumed extension can be changed with the
EXTENSION-NAMES configuration record (see page 10-19). For all attempts to open
the copied file, if a directory path or a drive letter is not specified, the directory search
sequence is used to try to locate the file (see the discussion of search sequences that
begins on either page 2-4 for UNIX or page 3-11 for Windows).
IDENTIFICATION DIVISION.
COPY STDID.
The preceding COPY statement copies the file stdid.cbl from the path specified by
RMPATH.
ENVIRONMENT DIVISION.
COPY "cobol".
The preceding COPY statement copies the file cobol.cbl from the path specified by
RMPATH (see the discussion of RMPATH in the appropriate installation and system
considerations chapter in this user's guide for your specific operating system).
The preceding COPY statement copies the file lib1/data1.cbl relative to the
current directory.
At the start of the run unit, the RETURN-CODE special register is initialized to zero.
The program may change the RETURN-CODE special register value by using it as the
destination of a MOVE statement or arithmetic verb, or by using the “STOP RUN
numeric” form of the STOP RUN statement. Certain program exit codes (as described on
page 7-8) are used by the runtime system to indicate error conditions. Use of these values
should be avoided in the program.
CALL Statement
The CALL statement transfers control to a contained RM/COBOL subprogram, to an
external RM/COBOL subprogram, or to a non-COBOL subprogram. Called subprograms
may themselves call other subprograms during the course of execution.
There are certain regulations that must be observed before RM/COBOL subprograms or
non-COBOL subprograms can be called:
2. Under UNIX, the non-COBOL subprogram must have been compiled and linked with
the runtime system and must conform with the rules set forth in Appendix D,
Customizing RM/COBOL for UNIX. Under Windows, the non-COBOL subprogram
must be contained in a dynamic link library (DLL) and the non-COBOL subprogram
must conform with the rules set forth in the “Alternate Method of Preparing
Non-COBOL Subprograms Under Windows” appendix in the CodeBridge manual.
3. The name specified in the CALL statement must be complete enough to search for
and locate the program.
A called subprogram is loaded and is in its initial state in the following instances: the first
time it is called in the run unit; the first time it is called after execution of a CANCEL
statement identifying the program that directly or indirectly contains the subprogram;
every time the subprogram is called if it possesses the initial attribute; and the first time
the subprogram is called after the execution of a CALL statement identifying a program
that possesses the initial attribute and that directly or indirectly contains the subprogram.
Subprogram Loading
When a CALL statement is executed, the program name (the value of identifier-1 or
literal-1 as defined in the discussion of the CALL statement in Chapter 1, Language
Structure, of the RM/COBOL Language Reference Manual) determines the subprogram
to which control is transferred. This is done in the following order:
2. If a program has been loaded and not canceled, and is called again by the same
program name, control is transferred to that program.
3. If the program name matches the value of program-name or literal (see the
RM/COBOL Language Reference Manual) as specified in the PROGRAM-ID
paragraph of a program in an RM/COBOL program library, the program is
loaded and control transferred to it. Remember, at the point of loading, the program
is in its initial state. In the same manner, if the program name matches a called name
literal in a non-COBOL subprogram library (see Appendix D in this user’s guide or
the “Alternate Method of Preparing Non-COBOL Subprograms Under Windows”
appendix in the CodeBridge manual), control transfers to the subprogram associated
with the called name literal.
7. If the program name does not specify a filename extension, or if the program
name specifies a filename extension other than .dll (under Windows), the program
name is used to search for a valid RM/COBOL program file. If such a file exists, and
contains only one object program, the program is loaded and control is transferred to
it, regardless of the name in its PROGRAM-ID paragraph.
Steps 5 through 7 search the environment for a match with the name used in each step. If
an environment variable name matches the name in one of those steps, the value of the
environment variable replaces that name in that step for the purpose of locating the file.
Steps 5 through 7 also use the RUNPATH directory search sequence as described on
either page 2-4 for UNIX or page 3-11 for Windows. RM/COBOL for Windows searches
for dynamic link libraries (DLLs) specified without a drive or path specification in the
following order:
1. The directory from which the application executable was loaded; for example, the
directory containing runcobol.exe.
2. The directory from which the COM server DLL was loaded; for example, the
directory containing rmcblrun.dll.
The use of contained programs and program libraries eliminates Steps 5 through 7. In the
case of RM/COBOL program libraries, the I/O overhead of searching for the program file
is minimized.
External Objects
A source program may use the EXTERNAL clause to declare three types of external
objects:
See the discussion of the EXTERNAL clause in Chapter 4, Data Division, of the
RM/COBOL Language Reference Manual for more details.
During execution of a run unit, the runtime system maintains a list of external objects.
The list is established as being empty when the run unit begins. When an object program
is loaded, the names of external objects it declares are checked for a match—of both
name and type—against the list of external objects. If both name and type match, the
declared external objects and existing external objects are considered references to the
same object. The declared object is then checked to determine whether it matches the
description of the external object. A mismatch in the description terminates execution
and displays an error message. If either name or type does not match, the declared
external object is allocated and added to the list. If there is not enough memory to load
the object, execution ends and an error message appears.
1. Data Records. The record-name for both objects must be described with the same
number of character positions.
2. File Connectors. The file-name for both objects must be described as follows:
− If the organization is relative, both objects must declare the same external
data item as the relative key data item, or must omit specification of a
relative key data item.
− If the organization is indexed, both objects must declare the same number of
record keys at the same positions in the record, and must agree on the
presence or absence of a COLLATING SEQUENCE clause. Both objects
must have the same COLLATING SEQUENCE clause, if the clause is
present. In addition, if split keys are present, both objects must have the
same split key clauses.
• The access mode specified in the ACCESS MODE clause must be the same.
• The presence or absence of the OPTIONAL phrase in the SELECT clause of the
file control entry must be the same.
• The number of input-output areas specified in the RESERVE clause must be the
same.
• The alphabet specified in the CODE-SET clause of the file control entry or the
file description entry (RM/COBOL allows the CODE-SET clause in either entry)
must be the same.
• The BLOCK CONTAINS clause in the file description entry must specify the
same minimum and maximum values, and must agree on whether these are
expressed in CHARACTERS or RECORDS.
• The RECORD clause in the file description entry must specify the same
minimum and maximum record size.
• The LABEL RECORDS clause in the file description entry must specify the
same property of OMITTED or STANDARD.
Note It is recommended that source programs use COPY statements to copy a common
definition of an external object in order to avoid mismatched external object descriptions.
File Sharing
RM/COBOL supports shared environments1, which allow files to be shared by two
or more users. This includes allowing two or more users to have a file open
simultaneously and apply updates to that file. The FORCE-USER-MODE keyword
of the RUN-FILES-ATTR configuration record (see page 10-28) can force files not to
be shared.
The WITH LOCK phrase may be used on the OPEN statement to restrict the use of a file
by other users during the period the file is open. When used on an OPEN I-O, OUTPUT
or EXTEND statement, the WITH LOCK phrase prevents other RM/COBOL users from
opening the file. When used on an OPEN INPUT statement, the WITH LOCK phrase
prevents other RM/COBOL users from opening the file I-O, OUTPUT or EXTEND.
When the WITH LOCK phrase is used, file performance is improved by eliminating the
overhead of locking records and permitting the buffering of file data in program memory.
Note On UNIX systems in which record locking is implemented through the fcntl()
system call, the file must be available with read/write access to enforce file locking. If the
file is not available with read/write access, the file is opened but file locking is not
enforced.
When the WITH LOCK phrase is absent, file access permits sharing by other users. The
WITH LOCK phrase is ignored in single-user configurations. Table 8-9 illustrates the
sharing permitted between applications in shared environments.
In a shared environment, a sequential file is considered shared if the WITH LOCK phrase
is omitted, even for OPEN OUTPUT and OPEN EXTEND. This permits other users to
OPEN EXTEND the same file and write records at the end of file.
Input/
Output
Output
Extend
1
Input
1
I-O
Output
Extend
Open granted.
Sequential and relative files must be opened WITH LOCK in order to make use of more
than one buffer from the buffer pool.
The amount of memory in the buffer pool can be controlled by use of the BUFFER-
POOL-SIZE keyword on the RUN-FILES-ATTR configuration record (see page 10-26).
Increasing the default may improve the performance of the I/O of the application file.
Decreasing the default value can increase the amount of program memory available.
The minimum size of the buffer pool must be adequate for the block sizes of the files
opened by the application. See the description of the BLOCK CONTAINS clause for
indexed files on page 8-53 for more information.
1. Sequential files
2. Relative files
3. Indexed files
1. Line Sequential Files. Line sequential files should contain only ASCII text data.
(In other words, they are equivalent to standard source files.) Each logical record
within line sequential files is variable in length and ends with a line feed or carriage
return/line feed pair.
If the ASCII control codes, that is, carriage return (CR), line feed (LF), form feed
(FF) or SUB, are present in a record, the record cannot be written. When reading a
file under UNIX, the LF, CR, FF, LF CR, CR LF, and FF CR sequences terminate a
record. Under Windows, the CR LF sequence terminates a record and leading and
trailing LF and FF sequences are ignored. SUB terminates the file and tab (HT)
causes one or more spaces to be inserted according to the default tab column
positions, which are every four columns, starting with column 8 and ending with
column 72.
The device-name in the ASSIGN clause of the file control entry determines the
treatment of spaces in a line sequential record. If the device-name is DISC, DISK,
or RANDOM, trailing spaces are preserved when a line sequential record is
written. The record length returned when the record is read is the length of the
record when it was written. If the device-name is CASSETTE, INPUT-OUTPUT,
MAGNETIC-TAPE, OUTPUT, PRINT or PRINTER, all trailing spaces are
removed when a record is written to the file. If the device-name is CARD-READER,
CARD-PUNCH, CASSETTE, INPUT, INPUT-OUTPUT or MAGNETIC-TAPE,
records read are padded with spaces to the maximum record length, and the record
length returned is always the maximum record length.
A file that is assigned to either of the device-names PRINT or PRINTER, for which
the LINAGE clause is used, or for which the ADVANCING phrase of the WRITE
statement is used, is always treated as a line sequential file. In this case, ASCII
control codes are allowed.
Each logical record within line sequential files has a maximum record length of
65280 bytes.
A fixed-length binary sequential file is one for which only one record description
exists or all record descriptions describe the same number of characters, and for
which no record description contains the OCCURS . . . DEPENDING ON clause, or
for which the RECORD clause specifies fixed-length records. Such files may have a
maximum record length of 65280 characters. Fixed-length binary sequential files are
recorded by RM/COBOL without any additional structure; the byte count implied by
the record length provides data transparency.
A variable-length binary sequential file does not satisfy the record length
requirements for fixed length. The data is encapsulated in an eight-byte overhead to
provide data transparency. The maximum record size for variable-length binary
sequential files is 65280 characters.
Note The compiler listing allocation map indicates in the “Debug” column whether
a file has been described with fixed- or variable-length records. This is described on
page 6-24 and illustrated in Figure 6-6.
The RECORD clause specifies the minimum and maximum lengths of records in a
sequential file. The minimum and maximum record lengths are not recorded with the file;
however, a READ statement encountering a record whose length is less than the minimum
record length receives an error. Also, an OPEN EXTEND for a fixed-length binary
sequential file succeeds only if the total file size at the time of the OPEN is a multiple of
the maximum record length of the file.
In a single-user environment, sequential disk files are physically read and written in fixed
length pieces called blocks. In a shared environment, sequential files are read and written
in blocks only when the WITH LOCK phrase is specified. When the WITH LOCK
phrase is omitted, the records of the file are read or written individually (without
blocking) from the operating system.
The file block size is not considered a fixed attribute of a sequential file; different
programs may specify different block sizes for the same file.
The runtime system uses the following algorithm to determine the block size when
opening a sequential disk file:
1. If no BLOCK CONTAINS clause is present, the block size is 4096 characters. The
default block size may be changed with a RUN-SEQ-FILES configuration record
(see page 10-34).
2. If a BLOCK CONTAINS nnn CHARACTERS clause is present, the block size is the
specified number of characters.
3. If a BLOCK CONTAINS nnn RECORDS clause is present, the block size is the
specified number of records multiplied by the sum of the maximum record length and
the record overhead.
When a file described with the LINAGE clause is opened for output, it is assumed the
output device is already positioned to the first line of the first logical page body. This is
the operator's responsibility. The program should be written to allow the operator an
opportunity to adjust the forms in the printer (or any other output device) as required.
The logical pages of a file described with the LINAGE clause are normally
written contiguously with no additional spacing provided between pages. The
LINAGE-PAGES-PER-PHYSICAL-PAGE keyword in the PRINT-ATTR configuration
record may be used to cause physical page breaks, such as form feed characters, to be
written to the file. The LINAGE-PAGES-PER-PHYSICAL-PAGE keyword is further
described on page 10-22.
The RESERVE clause is ignored. Buffer memory is automatically managed based on the
amount of activity of a particular file. See “File Buffering” on page 8-40.
The CODE-SET clause determines the character set used to represent the sequential file.
For example, if the CODE-SET is EBCDIC, all records written to the file are translated
from ASCII to EBCDIC. The CODE-SET is not considered a fixed attribute of the
sequential file. Different programs may specify different character sets for the same file.
If a READ statement without the WITH NO LOCK phrase fails because the record is
locked, the contents of the record area are undefined and the file position indicator is
unchanged. A subsequent READ behaves as if the failing READ statement had never
been issued.
A READ statement with the WITH NO LOCK phrase may be used to read a record
without regard to the lock status of the record. If an OPEN INPUT statement opened the
file, the WITH NO LOCK phrase is assumed on all READ statements on the file.
If the file control entry does not contain a FILE STATUS clause or there is no USE
declarative procedure defined for a file, record lock status is not reported to the program.
Instead, the runtime system waits for the record to become unlocked. By using the
FATAL-RECORD-LOCK-TIMEOUT keyword in the RUN-FILES-ATTR configuration
record (see page 10-27), the runtime system can be made to return a fatal error instead of
waiting indefinitely. If the record is locked using a different file descriptor in the same
run unit, then the runtime system never waits. Instead, to prevent a deadlock situation, it
returns an error indicating that the record is locked.
If the file control entry does contain a FILE STATUS clause and there is a USE
declarative procedure defined for a file, the record lock status is normally reported to the
program immediately by calling the USE procedure. By using the USE-PROCEDURE-
RECORD-LOCK-TIMEOUT keyword in the RUN-FILES-ATTR configuration record
(see page 10-30), the runtime system can be told how long to wait before calling the USE
procedure. If the record is unlocked during this time, the USE procedure is not called.
The REEL and UNIT phrases are not supported. If specified, they are ignored.
A print file is released to the operating system at run unit termination or when a CLOSE
statement (without the WITH NO REWIND phrase) is issued.
The WITH NO REWIND phrase may be used to prevent the release of a print file to the
operating system. This feature may be used to prevent undesirable side effects such as
banner pages and form feeds provided by the operating system when the print file is
released.
A subsequent OPEN statement (typically, OPEN EXTEND) must be issued before the
print file can again be successfully accessed by the program.
A print file is a line sequential file that has any or all of the following RM/COBOL source
program features:
1. ASSIGN TO PRINT or ASSIGN TO PRINTER clause in the file control entry for
the file.
For all other file types, the WITH NO REWIND phrase is ignored.
Files that are opened on devices are treated as read-only (INPUT) or write-only
(OUTPUT or EXTEND) sequential files. A program may open the same device more
than once within the same run unit. Those devices that are opened with the same mode
(read-only or write-only) share the same file handle and the same buffer. Those devices
that are opened with different modes use different file handles and have different buffers.
At most, two buffers are allocated to each device; one when opened for read-only and one
when opened for write-only. These buffers are dedicated to the device and do not come
from the buffer pool.
Because of the non-portability of applying locks to devices, locks are never applied to
device files. Thus, files opened on devices WITH LOCK do not guarantee exclusive
access to the file.
Printer Support
Under UNIX, printer support is provided either through the lp or the lpr spooler. Under
Windows, RM/COBOL provides printer support using the Windows printer devices.
Under UNIX, the RM/COBOL runtime system creates a write-only pipe to the print
spooler and sends all print records to it. The pipe is closed and the output is allowed to
print only when the RM/COBOL program issues a CLOSE statement to the file (except
for CLOSE WITH NO REWIND, as explained previously).
Under Windows, when a file is opened with the name PRINTER, the output is sent to the
default system printer configured under the Windows operating system. When a file is
opened with the name PRINTERx, where x is a single-digit number, output is sent to the
device connected to LPTx.
The device is opened for writing only and is closed only when the RM/COBOL program
issues a CLOSE statement to the file (except for CLOSE WITH NO REWIND, as
explained previously).
The destination for files named PRINTER can be changed by assigning an environment
variable PRINTER (see the discussion of file access names that begins either on page 2-5
for UNIX or page 3-13 for Windows), by defining a synonym in the Windows registry
(see page 3-29), or by configuring a keyword in the DEFINE-DEVICE record (see
page 10-16).
Under UNIX, RM/COBOL provides tape support through direct access to the tape
devices. When a file is opened with the name TAPE, the RM/COBOL runtime system
opens the tape device and writes or reads to it as directed by the RM/COBOL program.
The tape device is closed when the RM/COBOL program issues a close to the file except
for CLOSE WITH NO REWIND. Since the operating system does not provide a
mechanism to write a tape mark to a tape without closing the device (which may rewind
it), the RM/COBOL runtime system only simulates the close as it does for the printer
device.
Most systems allow multiple files to be placed on a tape by specifying that the tape is not
to be rewound on OPEN and CLOSE. This must be specified at the OPEN of the file by
using the correct name for the operation. For example, rtpyy may mean rewind on OPEN
and CLOSE while rtpyn may mean rewind on OPEN but not on CLOSE. (Actual names
vary between implementations. Consult your system administrator for the actual names.)
If it is desired to place multiple files on a single tape, it will be necessary to use
DEFINE-DEVICE configuration records to name the different options desired and use
the names within the RM/COBOL program appropriately.
All sequential record formats are supported on the tape: line, binary fixed, and binary
variable-length records. For transfer of information to other RM/COBOL programs, any
method may be used. For transferring information to other programs executing on other
equipment, fixed-length binary records are most compatible.
The destination for files named TAPE can be changed either by assigning an environment
variable TAPE as explained in the discussion of file access names that begins on
page 2-5, or by using a DEFINE-DEVICE configuration record as explained in the
discussion that begins on page 10-16.
Under UNIX, named pipes are treated as sequential devices. They are allowed to be
opened as INPUT, OUTPUT or EXTEND, but never I-O. Also, as with the other
devices, OPEN WITH LOCK does not guarantee exclusive access to the pipe.
Relative Files
Relative files are ordered collections of records, each of which is directly addressable by
use of a relative record number; this number is a non-zero integer corresponding to the
ordinal position of a record within the file. A record within a relative file acquires its
record number when it is written to the file with a WRITE statement.
Record numbers do not necessarily correspond to actual records in a file. For instance, a
record number may never have been given a corresponding data record, or some numbers
may correspond to data records that have been deleted.
Relative files must be assigned to a disk device, since the records can be accessed
randomly.
The maximum record length is 65280 bytes. Records can be variable length. No
restrictions are placed on the value of individual bytes within the record.
Records in a relative file are written to disk in a fixed-length area four bytes longer than
the length of the longest record declared for the file. Estimate the total disk space
requirement by multiplying the maximum record length plus four by the anticipated
number of records.
The RECORD clause specifies the minimum and maximum record lengths of records in a
relative file. The maximum record length is a fixed attribute of the file, and is validated
against the file size during an OPEN statement.
The minimum record length is not recorded with the file; however, a READ statement
encountering a record whose length is less than the minimum record length will receive an
error. A REWRITE statement may change the record length of a record in a
relative file.
In a single-user environment, relative files are physically read and written in fixed-length
pieces called blocks. In a shared environment, relative files are read and written in blocks
only when the WITH LOCK phrase is specified. When the WITH LOCK phrase is
omitted, the records of the file are read or written individually (without blocking) from
the operating system.
The file block size is not considered a fixed attribute of a relative file. Different programs
may specify different block sizes for the same file.
The runtime system uses the following algorithm to determine the block size when
opening a relative file:
2. If a BLOCK CONTAINS nnn CHARACTERS clause is present, the block size is the
specified number of characters.
3. If a BLOCK CONTAINS nnn RECORDS clause is present, the block size is the
specified number of records multiplied by the sum of the maximum record size, plus
four. The maximum allowed block size on most systems is 65489 characters.
The CODE-SET clause determines the character set used to represent the relative file
on disk. For example, if the CODE-SET is EBCDIC, all records written to the file will be
translated from ASCII to EBCDIC. The CODE-SET is not considered a fixed attribute of
the relative file. Different programs may specify different character sets for the same file.
A READ statement with the NEXT phrase and without the WITH NO LOCK phrase that
fails because the record to which the file position indicator points is locked, does not
modify the file position indicator and the contents of the record area are undefined. The
record is not read and the program should not depend on the contents of the record area
being unchanged. A subsequent READ statement behaves as if the failing READ
statement had never been issued.
If the file control entry does not contain a FILE STATUS clause or there is no USE
declarative procedure defined for a file, record lock status is not reported to the program.
Instead, the runtime system waits for the record to become unlocked. By using the
FATAL-RECORD-LOCK-TIMEOUT keyword in the RUN-FILES-ATTR configuration
record (see page 10-27), the runtime system can be made to return a fatal error instead of
waiting indefinitely. If the record is locked using a different file descriptor in the same
run unit, then the runtime system never waits. Instead, to prevent a deadlock situation, it
returns an error indicating that the record is locked.
If the file control entry does contain a FILE STATUS clause and there is a USE
declarative procedure defined for a file, the record lock status is normally reported to the
program immediately by calling the USE procedure. By using the USE-PROCEDURE-
RECORD-LOCK-TIMEOUT keyword in the RUN-FILES-ATTR configuration record
(see page 10-30), the runtime system can be told how long to wait before calling the USE
procedure. If the record is unlocked during this time, the USE procedure is not called.
Indexed Files
Indexed organization files contain data and one or more indexes or keys. These indexes
are used to locate data in the file by identifying the key value and the location in the file
of the corresponding record.
Every record in an indexed file contains a prime record key and may contain a number of
alternate record keys.
Data Compression
Each record of the file may be represented in a compressed or uncompressed data format.
Data record compression replaces multiple occurrences of space, zero and null or
repeated characters with a single compression character. Uncompressed data records
contain the data written by the program, with no compression characters. Data record
compression almost always improves the performance of indexed files by reducing the
file size and allowing more information to be read in a single physical transfer. When an
indexed file is created by the runtime system, data record compression is enabled. This
default may be changed as described on page 10-31. Whether data record compression is
enabled for a particular file may be established with the Define Indexed File utility
(rmdefinx), described in the discussion that begins on page G-19.
Data Recoverability
RM/COBOL provides a choice of data recovery strategies for indexed files. A data
recovery strategy is a tradeoff between deferring the writing of data to disk in order to
improve the performance of file modification operations, and forcing the writing of data
to disk in order to guarantee that the data is available for recovery if there is a system
failure. The data recovery strategy for a particular indexed file is determined when the
file is first opened OUTPUT or when the file is predefined. The file may be predefined
using the Define Indexed File utility (rmdefinx) described on page G-19. If the file is not
predefined, the default recovery strategy is used by the runtime system. This default
strategy may be configured as described in the discussion of the RUN-INDEX-FILES
configuration record beginning on page 10-31. Unlike other attributes associated with an
indexed file, the recovery strategy for a file may be changed, thus allowing optimal
performance when a file is being built and switching to a higher level of data integrity
when a file is updated. Use the Define Indexed File utility (rmdefinx) to change the
recovery strategy for a file.
The following four options are available to provide the various levels of data recovery
strategy:
1. Force File Closed (FORCE-CLOSED keyword). The indexed file header contains
a count of the number of concurrent run units that have the file open for modification.
If the system fails while this count is non-zero, the file index structure must be rebuilt
using the Indexed File Recovery utility (recover1). (See the discussion of the
“Indexed File Recovery Utility (recover1)” that begins on page G-23.) Selecting this
option causes the runtime system to increment this count before each DELETE,
REWRITE or WRITE operation and decrement the count at the end of each
operation. Otherwise, the count will be incremented when the OPEN statement is
executed and decremented when the CLOSE statement is executed.
Selecting this option causes two additional disk transfers for each modify operation,
but gives a high probability that a file rebuild will not be required if a system failure
occurs.
Selecting this option causes the runtime system to act as if the following three options
are also set.
Selecting this option causes the runtime system to attempt to force the operating
system to actually write its buffer to disk.
3. Force Data (FORCE-DATA keyword). Selecting this option causes the runtime
system to issue a write request to the operating system when a block containing a data
record is modified. Otherwise, such blocks remain in the block buffer pool
maintained by the runtime system for the file, and the write request to the operating
system is not made until the buffer containing the block is needed for a different
block.
This option is available only when a file is in single-user mode, that is, when the
runtime system is in single-user mode or the file is opened WITH LOCK. This
option is always selected for files in a shared environment.
4. Force Index (FORCE-INDEX keyword). Selecting this option causes the runtime
system to issue a write request to the operating system when a block containing index
information is modified. Otherwise, such requests are issued only as buffer
availability in the block buffer pool maintained by the runtime system dictates. This
option is always selected for files in a shared environment.
The RECORD clause specifies the minimum and maximum length of records in an
indexed file. These record lengths are considered fixed attributes of the file. Any
program using an indexed file must specify the minimum and maximum length specified
in the program that created the file.
The following algorithm computes the maximum disk space required to represent a
record:
1. Assume the record representation disk space is the maximum record size of the file.
2. If data record compression is enabled, increase the record representation space by the
ceiling of the maximum record size divided by 127.
3. Increase the record representation space by four times the number of alternate keys
that allow duplicates.
RM/COBOL indexed files are physically read and written in fixed-length pieces called
blocks. The size of a block is determined by the BLOCK CONTAINS clause in the
RM/COBOL program, or with the Define Indexed File utility (rmdefinx) (see
page G-19). A larger block size transfers more data in a single request, requires more
time to effect the data transfer, and requires more memory from the buffer pool. A
smaller block size allows more blocks in memory for a fixed amount of memory, but
requires more time to randomly access a record by increasing the depth of each index.
The file block size is considered a fixed attribute of the file. The BLOCK CONTAINS
clause in a program that uses a file must be identical to the BLOCK CONTAINS clause in
the program that created the file.
To access a block of an indexed file, the runtime system must use a piece of the buffer
pool memory that is at least as large as the file block size. The indexed file algorithms
require that a minimum of three pieces of buffer pool memory be available. If the file
block size exceeds 32768, the buffer pool must be at least as large as the sum of 131072
and the block size. If the file block size exceeds 16384, the buffer pool must be at least as
large as the sum of 65536 and the block size.
The algorithm used to determine the block size of an indexed file is outlined in the
following paragraphs. The algorithm distinguishes specified block size from actual block
size. Specified block size is defined by the BLOCK CONTAINS clause, and may be a
function of the maximum disk space required to represent a record, defined previously in
the RECORD clause description. Actual block size is defined as a function of the
specified block size. When the term block size is used by itself elsewhere in this
document in reference to an indexed file, it means the computed actual block size.
1. If no BLOCK CONTAINS clause is present, and the file already exists, the current
block size is used as the block size.
2. If no BLOCK CONTAINS clause is present, and the file does not already
exist, assume the block size is 512. This default may be changed with a
RUN-INDEX-FILES configuration record (see page 10-31).
3. If a BLOCK CONTAINS nnn CHARACTERS clause is present, the specified block
size is the number of characters.
The RESERVE clause is ignored. Buffer memory is automatically managed based on the
amount of activity of a particular file. See “File Buffering” on page 8-40.
The CODE-SET clause determines the character set used to represent the indexed file on
disk. For example, if the CODE-SET is EBCDIC, all records written to the file will be
translated from ASCII to EBCDIC. The CODE-SET specified when an indexed file is
created is a permanent attribute of the file, and will be used whenever the file is accessed
by a program not specifying a CODE-SET. However, a program may specify a different
A READ statement with the NEXT phrase and without the WITH NO LOCK phrase that
fails because the record is locked does not modify the file position indicator and the
contents of the record area are undefined. The record is not read and the program should
not depend on the contents of the record area being unchanged. A subsequent READ
statement will behave as if the failing READ statement had never been issued.
A READ statement with the WITH NO LOCK phrase may be used to read a record
without regard to the lock status of the record. If an OPEN INPUT statement opened the
file, the WITH NO LOCK phrase is assumed on all READ statements on the file.
If the file control entry does not contain a FILE STATUS clause or there is no USE
declarative procedure defined for a file, record lock status is not reported to the program.
Instead, the runtime system waits for the record to become unlocked. By using the
FATAL-RECORD-LOCK-TIMEOUT keyword in the RUN-FILES-ATTR configuration
record (see page 10-27), the runtime system can be made to return a fatal error instead of
waiting indefinitely. If the record is locked using a different file descriptor in the same
run unit, then the runtime system never waits. Instead, to prevent a deadlock situation, it
returns an error indicating that the record is locked.
If the file control entry does contain a FILE STATUS clause and there is a USE
declarative procedure defined for a file, the record lock status is normally
reported to the program immediately by calling the USE procedure. By using the
USE-PROCEDURE-RECORD-LOCK-TIMEOUT keyword in the RUN-FILES-ATTR
configuration record (see page 10-30), the runtime system can be told how long to wait
before calling the USE procedure. If the record is unlocked during this time, the USE
procedure is not called.
As an indexed file grows in size, the runtime system allocates additional blocks to the file.
The number of blocks allocated is determined by the allocation increment. The default
allocation increment is eight blocks; a different allocation increment may be set with the
Define Indexed File utility (rmdefinx). A larger allocation increment may improve
performance when writing records to the file, by reducing the number of operating system
allocation requests. A smaller allocation increment may yield less wasted space.
Unused blocks in an indexed file are kept on the empty block list. The format of this list
is determined by the file version number. Beginning with file version number 2, a new
list format and algorithm are used to maintain the empty block list in order to increase
performance when adding records to the file. This new algorithm keeps track of the first
unused empty block in the file, which is followed only by other unused empty blocks, and
avoids reading those blocks from the disk when they are used. New files are created with
a version number of 2, although this default can be changed with the DEFAULT-FILE-
VERSION-NUMBER configuration keyword (see page 10-31). The version number can
also be changed on existing files or set when creating new files with the Define Indexed
File utility, rmdefinx (see page G-19).
When a file version number is set to 2, the minimum write version number of the file is
also set to 2 in order to prevent previous versions of RM/COBOL from attempting to
modify the empty block list. The minimum read version number of the file is not
changed. Files with a version number of 2 can be read but not modified by versions of
RM/COBOL prior to version 6. If an OPEN OUTPUT is performed on a file with
version number of 2 by a runtime system prior to version 6, the file version number and
minimum write version number will be reset to 0, and the previous style of the empty
block list will be used.
Subtotals - H = 1
H = H + 2 if code-set is enumerated
H = H + 1 if collating sequence is enumerated
Subtotals - H = 1
MaxD = ceiling(2000÷(floor((512-8)÷(100+
4+(4*0)+ceiling(100÷127)))))
= 500
MinD = ceiling(2000÷(floor((512-8)÷
(ceiling(100÷65)+4+4(4*0)))))
= 24
TO0 = 4
TO0 = 4+2
= 6
MaxTE0 = floor((512-10)÷6)
= 83
MinTE0 = floor((512-10)÷(2*(6+15)))
= 11
MaxLE0 = floor((512-10)÷(6+1))
= 71
MinLE0 = floor((512-10)÷(2*(6+15+1)))
= 11
MaxLB0 = ceiling(2000÷11)
= 182
MinLB0 = ceiling(2000÷71)
= 29
MaxTH0 = ceiling(Log10(182)÷Log10(11))
= 3
MinTH0 = ceiling(Log10(29)÷Log10(83))
= 1
MaxW0 = ceiling(182÷(11**(3-1)))
= 2
MinW0 = floor(29÷(83**(1-1)))
= 29
MaxTB0 = 1+2*(((11**
(3-1))-1)÷(11-1))
= 25
MinTB0 = 1+29*((83**
(1-1))-1)÷(83-1)
= 1
This file will require between 28672 and 364544 bytes, depending on the contents of the
records and the order in which the records are written. Since, in most cases, the key and
data compression will save much less than all the bytes in the keys and records, the actual
file size will probably be nearer to the maximum size than to the minimum size.
Temporary Files
The sort-merge facility of RM/COBOL makes use of temporary files for its intermediate
sort files. These files are given unique names and are placed in the current directory and
the current disk drive.
The choice of the directory in which to place the temporary files under Windows may be
changed by use of the environment variables TMP or TEMP. If both variables are set, the
value of TMP is used. Assign the environment variable a value before executing the
RM/COBOL program. Under Windows, a synonym may be set in the registry database.
Under UNIX, the TMPDIR environment variable is used.
The index tree manipulation algorithms are designed to keep each index node at least half
full of entries. When records are written in ascending order by key, the algorithms can
completely fill each index node with entries, reducing both the tree height and the size of
the file. This improves performance by reducing both the number of disk operations and
the required arm movement for the operations performed. If a file is infrequently
modified, it should be built in ascending order by the key most frequently used to access
the records.
In-Memory Buffering
Disk operations can be reduced by keeping file fragments in memory as long as possible.
Subsequent accesses to the same information use the copy in memory instead of rereading
the information from disk. This technique of in-memory buffering of data is the single
most effective method of improving performance.
RM/COBOL files offer two levels of in-memory buffering of data: buffering by the
operating system and buffering by the runtime system. A combination of the two seems
to yield the best performance. Both UNIX and Windows provide buffering automatically.
Additional memory may be dedicated to the buffering of disk data by further increasing
the number of operating system buffers, or by increasing the size of the memory pool that
the runtime system uses for disk buffers. The size of the memory pool may be increased
through use of the BUFFER-POOL-SIZE keyword on the RUN-FILES-ATTR
configuration record (see page 10-26).
Runtime system disk buffers, like the operating system buffers, are shared among all files
opened by an application. Runtime system buffering is especially useful in a network
environment. When a file is shared over a network, the operating system is unable to
perform any buffering. Every WRITE operation must be sent to the remote machine and
every READ operation must receive the data from the remote machine. With runtime
system buffering of index files, at the beginning of each operation the runtime system
determines which buffers still contain valid data and which contain data that may have
been modified by an application on another machine. This significantly reduces the
Providing sufficient space in the buffer memory pool can supply the runtime system with
enough buffers to work efficiently.
The optimal number of buffers for a particular file depends on the operations being
performed and the height of each index tree. The height of the index trees for a particular
indexed file may be obtained with the Map Indexed File utility (rmmapinx), described on
page G-14. If a file is being read randomly by only a single key, the minimal number of
buffers that will improve performance is the height of the particular key’s index tree, plus
one. Fewer buffers than this number require that all index nodes be read for each
operation. Increasing the number of buffers above this minimum increases the probability
that needed nodes already will be in memory. WRITE operations require that every key
be updated. It is desirable that the number of buffers available be greater than the sum of
the heights of all trees. Short of this number, buffers equal to the height of the tallest tree
plus one should be available. Again, increasing the number of buffers above the
minimum increases the probability that required nodes will already be in memory.
Once the desired number of buffers is known, the amount of space to allocate in the buffer
pool can be computed by using the following calculations:
If more than one file is expected to be active at the same time, the computed Pool Size
(PSz) for the files usually can be added together, especially if the files have the same
buffer size. (In fact, if the files have the same buffer size, it is best to add the number of
desired buffers together and make the calculation using that number.) However, if the
files have different buffer sizes and the difference between the buffer size and the block
size of the file having the larger buffer size is greater than the buffer size of another active
file, the amount of space required will be less than the sum of the separate buffer pool size
calculations for the two files. (Recall that the buffer size is computed from the block size
rounded to the next power of two. Not all that space, however, is in use by the buffer;
only the block size rounded up to the next multiple of 512. The remainder is available for
use by other buffers.)
_____________________
1
The size of the buffer (Bsz) is computed by rounding the block size up to the next power of two. If this is
less than 512, use 512 instead.
Record length affects indexed file performance by placing a lower limit on the block size,
perhaps forcing the block size to be larger than one sector, increasing the transfer time
and reducing the number of buffers that will fit in available memory. Large record
lengths also affect indexed file performance by increasing the disk space required by the
file. RM/COBOL indexed files support variable-length records, using only sufficient disk
space to contain the actual record data. Converting fixed-length records to variable-
length records, however, is not necessary to improve performance. With data record
compression enabled, fixed-length records with trailing space filled fields are almost as
small as variable-length records. Of course, larger data records require more disk space.
This can reduce the effectiveness of the disk buffers by reducing the percentage of the file
that can be kept in memory and thus the probability that a desired file block will already
be in memory.
Some applications may be written to delete and write a record when the record contents
are changed, instead of using a REWRITE statement. A REWRITE statement always
yields better performance than the DELETE and WRITE statements. This is because
there is always at least one key whose value has not been changed, the prime record key.
The index trees for unchanged keys need not be updated and, except for the prime record
key, need not even be accessed.
To change the version level of an existing file, use the Define Indexed File utility
(rmdefinx). If the version level is changed to or from level 0, the Indexed File
Recovery utility (recover1) must be run on the file. (See Appendix G, Utilities, for
more information.)
To change the version level of an existing file, or to change the lock limit stored in the
header, use the Define Indexed File utility (rmdefinx). If the version level is changed to
or from level 0, the Indexed File Recovery utility (recover1) must be run on the file. (See
Appendix G, Utilities, for more information.)
Note An MCS interface is not provided by the runtime system in the Windows
environment.
This data structure is defined in C and contains only pointers (addresses). The size of the
structure (in bytes) depends on the size of pointers for a given system. The structure is
aligned so that pointers may be referenced directly. The CcdAreaAddress contains the
address of the CCD.
The CdRecordAddress contains a pointer to the record area implicitly associated with
the CD.
The array of ten McsPointers is reserved for use by the MCS function.
OSMCSINITIALIZE()
and
OSMCS (McsFunction, McsPtrArea)
long McsFunction;
char *McsPtrArea;
Upon exit, the MCS must return a completion code as defined in Table 8-10.
Code Description
0 Function processed. No error.
1 RECEIVE . . . NO DATA processed. No data.
2–1499 Error. Terminate run unit with MCS error. The displayed error code
will be the value plus 350.
The MCS is notified when a program containing one or more CCDs is terminated due to
the execution of a CANCEL statement or to run unit termination. In this case, upon
entry to the MCS, McsFunction will be 7 and McsArea will point to a CCD. The MCS
must then determine the action to be taken for the CCD solely from the CD Type (byte
offset 2) field and the area reserved for the MCS. The MCS will be called once for each
communications description defined in the program being terminated.
The MCS is explicitly notified of run unit termination after all CCDs have been
terminated. When this happens, upon entry to the MCS, McsFunction will be 8.
No error codes are anticipated or processed when the MCS is called with
McsFunction 7 or 8.
BYTE
OFFSET
0 Reserved - do not modify
1
2 CD Type
3 Options
4 Destination Table Occurrences
5
6 Reserved - do not modify
.
.
.
11
12 Reserved for use by MCS
.
.
.
19
20 Message Area Length
21
22 Reserved - do not modify
23 Message Indicator
24 Advancing Flags
25 Reserved - do not modify
26 Advancing Count
27
28 Reserved for use by MCS
.
.
.
79
Message Area Length contains the length, as a short integer of the message area for a
SEND or RECEIVE operation, and of the key (password) for an ENABLE or DISABLE
operation. Zero indicates no message area (no FROM phrase in a SEND statement), or
no key value (no KEY phrase in a DISABLE or ENABLE statement).
Message Indicator contains the binary value of the message indicator specified by the
WITH phrase of the SEND statement. 0=no indicator, 1=ESI, 2=EMI and 3=EGI. The
value is incremented by 16 if the REPLACING LINE phrase was specified in the SEND
statement.
Advancing Flags contains information about the ADVANCING phrase of the SEND
statement. Bit 7 (0x80) is set if the BEFORE phrase was specified, and is cleared if the
AFTER phrase was specified. Bit 6 (0x40) is set if mnemonic-name was specified. Bits
0-3 (0x0F) contain the channel number associated with mnemonic-name in this case. If
bit 6 is clear, bit 3 (0x08) is set to indicate the page phrase was specified, or bit 0 (0x01)
is set to indicate the LINE(S) phrase was specified.
Advancing Count contains the binary values stored as a short integer of the literal or
identifier specified in the LINE(S) clause of the ADVANCING phrase of the SEND
statement.
The remaining area is set to zero by the RM/COBOL compiler, and may be used by the
MCS, as required.
• Debug references
• Screen positions
• Regaining control
• Debug commands
Any program within the run unit that was compiled with the Q Compile Command Option
will not contain any debugging information and will, therefore, appear “invisible” to the
Interactive Debugger.
Command Function
Address Stop (A) Sets a breakpoint and resumes program execution (see
page 9-20).
Breakpoint (B) Sets a breakpoint or displays all active breakpoints (see
page 9-21).
Clear (C) Clears breakpoints (see page 9-22).
Display (D) Displays the value of a specified data item (see page 9-23).
End (E) Ends debugging and resumes standard program execution (see
page 9-27).
Line (L) Specifies the line on which Debug displays will appear (see
page 9-28).
Modify (M) Modifies the value of a specified data item (see page 9-28).
Quit (Q) Terminates program execution and returns control to the
operating system (see page 9-33).
Resume (R) Resumes program execution at a specified location (see
page 9-34).
Step (S) Executes the program to the start of the next statement,
paragraph or section, or trace execution (see page 9-35).
Trap (T) Sets a data trap or displays all active data traps (see page 9-36).
Untrap (U) Clears data traps (see page 9-40).
Statements
Debug considers section names, paragraph names and procedural statements to be
statements for the purpose of setting breakpoints, stepping, execution counts or program
area references (see page 9-5). Procedural statements are those RM/COBOL statements
that begin with a Procedure Division verb (for example, IF, ADD, MOVE, READ,
PERFORM, GO, STOP, and so forth).
9-2 Debugging
General Debug Concepts
Breakpoints
Breakpoints can be set for any statement. When the RM/COBOL runtime system
encounters a breakpoint, it stops before it executes the statement at which the breakpoint
is set. At this point, using the appropriate Debug commands, you can examine and
modify the value of data within the program. Note that line numbers are used to indicate
breakpoints. Breakpoints may be set for lines that have no statement (such as comment
lines), but this does not cause a stop in response to the breakpoint. Any number of
breakpoints can be set.
Traps
Traps are used to compare the current value of a data item to its last known value, to see
if a change has occurred. Whereas breakpoints stop program execution before the
statement at which the breakpoint was set, traps wait until the statement has completed,
then compare for a change in value. If such a change occurs, program execution is
suspended and the current value of the data item appears. Any number of traps can be set.
Stepping
When you step through the program, you direct that execution halt before the next
statement, paragraph, or section is executed.
Execution Counts
You can specify the number of times a breakpoint is to be ignored before Debug halts the
program. For example, if you set a breakpoint at line 100 and specify an execution count
of 15, upon resumption of execution the statement at line 100 will be executed 14 times.
When the statement is encountered the 15th time, Debug will halt the program before
executing that statement. If the statement is not executed the specified number of times
before execution ends, execution will not stop in response to the breakpoint.
There are three procedural statements here: the first—MOVE A TO B—is referenced
only by the line number 150. The second statement in the line—MOVE B TO C—is
Debug Values
All numeric values used by Debug (for instance, to specify an address) are entered and
displayed as decimal numbers (see the section “Data Address Development” that begins
on page 9-6 for more information).
Data Types
Certain Debug commands allow (and in some cases require) you to enter a value for type.
type indicates the type of data item. This makes Debug aware of the internal
representation of the data item specified. The value of type is generally the value shown
for the data item in the Debug column of the allocation map. However, other values may
be specified for type if you want the data item decoded according to a different
representation.
9-4 Debugging
General Debug Concepts
Debug References
There are a number of ways to refer to specific lines of code or to specific data items
within an RM/COBOL program.
Screen Positions
You can request that Debug screen displays appear on a particular line. This feature is
useful when you are debugging interactive programs (those that accept and display
information on the screen) because it minimizes the risk of overwriting a program display
with Debug commands or messages. For instance, if your screen display uses lines 10
through 25, you can direct that Debug commands and messages appear on line 6.
1. Identifier format
2. Address-size format
3. Alias format
All three methods can be used during a single Debug session if the conditions required for
their use are satisfied. Only one method can be used for an individual Debug command.
Identifier Format
The identifier format is similar to the source format for identifier specification. This
method requires that you specify (or configure) the Y Compile Command Option (see
page 6-13), which outputs the symbol table to the object file for use by Debug. If the
symbol table is absent from the object file, this format cannot be used.
name-1 [ { IN | OF } n a m e - 2 ] … [ script ] [ r e f m o d ]
[ , { type | { * | & } [ type ] } ] [ # alias ]
9-6 Debugging
Data Address Development
script is required if the data item referenced by name-1 is a table element. If it is not,
do not specify script. The format for script is as follows:
( integer-1 [ [ , ] integer-2 ] … )
( offset : [ length ] )
offset is a string of decimal digits whose value ranges from 1 to the length of the
data item referenced by name-1. The parentheses and the colon following offset
are required.
length is a string of decimal digits whose value ranges from 1 to the remaining
length of the data item referenced by name-1, after offset has been applied.
Failure to specify length requests the maximum length from offset to the end of
the data item referenced by name-1.
type specifies the type of data item referenced. If this parameter is omitted, type
defaults to the type of the named data item except when a type modifier is specified.
(See the list of valid data types in Table 9-2.) The type value IXN may only be used
with index-names and, when the named data item is an index-name, the only
permissible type value is IXN. The type value PTR may only be used with pointer
data items and, when the named data item is a pointer data item, the only permissible
type value is PTR, except when a type modifier is specified. The type modifiers
* and & have the following effect:
• The * type modifier indicates an indirect reference, that is, a reference to the
data item referenced by a pointer data item value. The data item specified in the
command must be a pointer data item (data type PTR). In this case, type, if
specified, indicates the type of the data item referenced by the pointer data item
value. If type is not specified, the default is hexadecimal. If refmod is not
specified, the command refers to the entire effective memory area specified by
• The & type modifier indicates that the address of the data item specified is
the data item referenced by the command. In this case, the type of the operand
will always be a pointer and, if type is specified, type must be PTR. The
D (Display) Command may use the & type modifier for any data item type
except index-names (data type IXN). The & type modifier may not be used with
a constant-name since a constant-name does not name a data item. The & type
modifier may be used in the M (Modify), T (Trap), and U (Untrap) Commands
only if the referenced data item is a based linkage record because, otherwise, the
address is not modifiable.
alias is a name you enter to serve as another name for the data operand specification
that precedes it. If present, alias must follow a pound sign (#). The characters
that follow the # must form a valid COBOL word. Only the first three characters
of this word are significant. Once specified, alias can be used in later Debug
commands that use the alias format. (See the discussion of this format that begins
on page 9-11.) The three-character alias must be unique. If you assign the same alias
to a different data operand, it will no longer refer to the earlier operand. When a
command defines an alias and specifies the * (indirect through pointer) type
modifier, the indirection is resolved at the time the alias is defined. In this case, the
alias continues to refer to the data item that that the pointer data item referenced
when the alias was defined even if the pointer data item value has subsequently been
changed. When a command defines an alias and specifies the & (address of data
item) type modifier, the address of the data item is resolved each time the alias is
specified using an alias format command.
9-8 Debugging
Data Address Development
Address-Size Format
This method requires that you specify the A Compile Command Option (see page 6-9) to
produce an allocation map in the listing file. This map provides the information that must
be entered in a Debug command employing this method.
base specifies the base item for formal arguments, based linkage items, and external
items as follows:
• For a USING formal argument, base is specified as U arg-num, where arg-num
specifies the ordinal position of the argument in the USING list of the Procedure
Division header provided in the allocation map of the program listing.
• For an external item, base is specified as X ext-num, where ext-num specifies the
compiler assigned external number provided in the allocation map of the
program listing.
Note A Linkage Section data item, which is neither a formal argument item nor a
based linkage item, is shown as "Not addressable:" in the allocation map of the
program listing. Since such items have not been used in the source program, the
compiler does not allocate a base pointer item for them and the Interactive Debugger
cannot access them.
address specifies the decimal data address of the data item to be displayed, modified
or monitored. The value is obtained from the data allocation map in the compiler
listing.
occur-size specifies the size of data items that contain OCCURS clauses in their
definitions. If occur-size is present, the plus sign (+)must appear as well. When a
referenced data item contains an OCCURS clause in its definition, occur-size is equal
to the value of size (defined in this section).
+occur-size*occur-num
Look at the program listing and associated data allocation map in Figure 9-1. Then look
at Figure 9-2, which shows a developed reference to GRP-2(3).
The effect of this reference is the creation of a developed data address of 946, which
appears as the address on the first line of the data display. Subsequent references to
GRP-2(3) may appear as 946, 471 instead of 4 + 471*3, 471.
Note This developed data address is not the algebraic equivalent of the formula
4 + 471*3. It is the algebraic equivalent of 4 + (471*(3-1)) = 4 + (471*2) = 946.
z 8
9 DATA DIVISION. z
10 WORKING-STORAGE SECTION.
O 11 01 GRP-1. O
z 13
14
02 GRP-2
03 FILLER
OCCURS 20.
PIC X(6). z
15 03 GRP-3 OCCURS 15.
O 16 04 FILLER PIC X(5). O
z 17
18
04 THE-ITEM
04 FILLER
PIC 9V9 OCCURS 12.
PIC X(2). z
O Working-Storage Section for program ALLOCMAP O
z Address Size Debug Order Type Name z
4 9420 GRP 0 Group GRP-1
O 4 471 GRP 1 Group GRP-2 O
z 10
15
31
2
GRP
NSU
2
3
Group
Numeric unsigned
GRP-3
THE-ITEM z
9-10 Debugging
Data Address Development
Figure 9-2 Developed Data Address
4 + 471 * 3 , 471
The size of the data item to be inspected.
Alias Format
The alias format allows you to reference a data item or index that had been assigned an
alternate name. Once assigned, the alias applies to that data item until you use it to name
another data item or you end the Debug session.
# alias
# is required.
alias must be a valid COBOL word, only the first three characters of which are used.
The alias must be previously defined in an identifier or address-size format
specification.
Regaining Control
Debug regains control under the following conditions:
• Breakpoint
• Runtime system error
• Step through a statement, paragraph or section
• Execution of a STOP RUN statement
• Trap
condition is the name of a condition that has stopped program execution. It may be
one or more of the following:
• BP, which indicates a breakpoint is present.
• DT, which indicates a data trap has occurred.
• ER, which indicates a runtime system error has occurred.
• SR, which indicates the program has executed a STOP RUN statement.
• ST, which indicates program stepping is active.
line is the line on which the next statement to be executed begins. The string “Line?”
appears if the line number is not known.
intraline indicates the next statement to be executed when line contains more than
one statement.
name is the name of the currently executing program.
C?_ is the prompt and cursor.
Any Debug command may be entered when the prompt appears on the screen. If the last
Debug command was an S (Step) Command, you can repeat it by pressing Enter in
response to the prompt.
9-12 Debugging
Debug Command Prompt
Debug Error Messages
This section lists and defines the error messages that may be generated during debugging.
Command Error
Indicates that you entered an invalid command character, or a command with inconsistent
or invalid parameter values. The Debug command prompt appears again.
This message appears if any errors occur in scanning a reference in address-size format.
Further, this message appears after any of the following specific errors are diagnosed.
Indicates that the address value specified for a data item in a Debug address-size format is
not correct.
This means that the end of the data item, calculated by summing the address of the data
item, including any subscript calculations, and the length of the data item less one,
exceeds the size of the region containing the data item. If the item resides in the program,
the end of the data item must not exceed the sum of the lengths of the File Section and the
Working-Storage Section. If the item is a Linkage Section item that is, or is subordinate
to, a formal argument, the end of the data item must not exceed the length of the
corresponding actual argument item. If the item is a Linkage Section item that is, or is
subordinate to, a based linkage item, the end of the data item must not exceed the length
of the area of memory addressed by the pointer value used to set the base address of the
based linkage item. If the item is external, the end of the data item must not exceed the
length of the highest level containing external item.
Indicates that the colon is misplaced or omitted in the reference modification specified
with a data item address in a Debug identifier format.
Indicates that the address specified for an index-name (Debug type IXN) is not a multiple
of four.
Extraneous characters
Indicates that the command entered to Debug contains characters that are not expected
past the data item specification or modification value.
The D (Display) and T Trap Commands accept an alias identifier of a data item or a data
item specification with an optional alias definition. The M (Modify) Command accepts
the same parameters as a D (Display) Command followed by a modification value. The U
(Untrap) Command accepts the data item specification or alias identifier of a data item
with which a trap is currently associated. No additional characters are accepted.
Identifier expected
Indicates that the first character of what should be an identifier is not alphabetic, numeric,
or hyphen.
Indicates that the symbolic identifier specified is a user-defined word in the COBOL
source, but is not a data item.
The Debug commands, D (Display), M (Modify), and T (Trap), allow access to program
data items. The state of user-defined words, such as condition-names or switch-names,
which are not data items, cannot be examined. Examine the source or the allocation map
to determine the data item that contains the field to be accessed.
This error message also occurs if a symbolic identifier specifies a Linkage Section data
item that is neither a formal argument (USING or GIVING) nor a based linkage item.
Since such items have not been used in the source program, the compiler does not allocate
a base pointer item for them and the Interactive Debugger cannot access them.
9-14 Debugging
Debug Error Messages
Identifier refers to constant
Indicates that in a command other than the D (Display) Command, the symbolic identifier
specified refers to a constant-name or is the constant address (& type modifier specified)
for a data item that is not a based linkage data item. Constant-names and constant
addresses may not be specified in the M (Modify), T (Trap), or U (Untrap) Commands.
IN or OF expected
Indicates that the symbolic identifier in a Debug identifier format specification of a data
item is followed by something other than a qualification specification.
If a symbolic name is not followed by the special characters left parenthesis, comma, or
pound sign, it must be followed by IN or OF and the symbolic name of a higher level data
item.
Indicates that too few subscripts are provided with a data item in a Debug
identifier format.
Index Error
Indicates that you requested the display of an index-name (Debug type IXN) and Debug
discovered an inconsistency in the internal representation of the index-name.
This message generally indicates that the address or size value of the index-name was
entered incorrectly.
Indicates that the symbolic identifier conflicts with the type value specified in the
command. One of the following conflicts has occurred:
• The symbolic identifier refers to an index-name, but a type value other than IXN was
specified. Index-names may not use a type value other than IXN.
• The symbolic identifier does not refer to an index-name, but the type value IXN was
specified. Only index-names may be specified with the type value IXN.
• The symbolic identifier refers to an index-name and a refmod field was specified.
Reference modification of an index-name is not allowed.
• The type modifier & (address of data item) was specified with a symbolic identifier
that refers to an index-name (data type IXN). The type modifier & may not be
specified for an index-name.
Indicates that the data item in a Debug identifier format refers to a table element and no
subscript identifying a particular element is entered.
Indicates that the sum of the starting position value and the length, specified in the
reference modification of a data item in a Debug identifier format, exceeds the declared
length of the data item.
9-16 Debugging
Debug Error Messages
Name undefined
The name appears undefined when debugging a contained program if the name is defined
in a containing program but is not described with the GLOBAL attribute. When
debugging a containing program, names in contained programs appear undefined. This
message also appears if a name provided as a qualifier is not defined anywhere in the
separately compiled program.
Indicates that you specified a based linkage item number for a data item in the Debug
address-size format incorrectly. This means that the integer between the letter B and the
following colon does not correspond to a based linkage item.
No such external
Indicates that you specified an external number for a data item in the Debug address-size
format incorrectly. This means that the integer between the letter X and the following
colon does not correspond to an external group item.
No such parameter
Indicates that a USING argument value for a data item in the Debug address-size format
is specified incorrectly.
This means that the integer between the letter U and the following colon does not
correspond to a Linkage Section data item included in the USING list of the Procedure
Division or that the calling program did not pass a value in the corresponding position of
its CALL statement.
Debug allocates memory to remember names associated with an alias and to contain the
symbol table of the current program.
Indicates that the starting position value entered in a reference modification, specified
with a data item address in a Debug identifier format, exceeds the declared length of the
data item.
Pointer inconsistency
Indicates that the symbolic identifier conflicts with the type value specified in the
command. One of the following conflicts has occurred:
• The symbolic identifier refers to a pointer data item, but a type value other than PTR
was specified without a type modifier. Pointer data items may not use a type value
other than PTR.
• The symbolic identifier does not refer to a pointer data item, but the type value PTR
was specified. Only pointer data items may be specified with the type value PTR.
• The symbolic identifier refers to a pointer data item without the type modifier *
(indirect through pointer) and a refmod field was specified. Reference modification
of a pointer data item is not allowed.
• The type modifier * (indirect through pointer) was specified with a symbolic
identifier that is not a pointer data item. The type modifier * may only be used with
pointer data items.
• The type modifier & (address of data item) was specified with a type value other than
PTR. The type modifier & always results in a pointer value and thus cannot specify
a type value other than PTR.
• The type modifier & (address of data item ) was specified with a symbolic identifier
that refers to a constant-name. The type modifier & may not be specified with a
constant-name.
• For the M (Modify) Command, the = value modifier was followed by a symbolic
identifier that does not refer to a pointer data item or reference modification was
specified for the pointer.
9-18 Debugging
Debug Error Messages
Pointer memory access violation
Indicates that the * (indirect through pointer) type modifier was specified with a pointer
data item that has a null value or a value that points to memory that cannot be read by the
program. For the M (Modify) Command, this may mean that the program cannot write to
the memory area referenced by the pointer value.
Qualifier undefined
Indicates that an alias identifier is undefined or that the symbolic qualifier provided after
an IN or OF in a Debug item address in an identifier format is not a higher level data item
of the preceding identifier.
Check the qualification specification with the program source or the allocation map of the
compilation listing.
Qualification ambiguous
Indicates that the symbolic qualifiers provided after an IN or OF in a Debug item address
in an identifier format do not uniquely identify a data item.
Qualification allows unique specification of data items with the same name. The
qualification identifiers must be the names of lower numbered group items or the name of
the COBOL filename if the data item is in the File Section. Check the qualification
specification with the program source or the allocation map of the compilation listing.
Reenter the command with additional qualification items to uniquely identify the desired
data item.
Indicates that a subscript or reference modification field, specified with a data item
address in a Debug identifier format, is missing its closing right parenthesis or that too
many subscripts are provided.
Indicates that a subscript exceeds 65535 or that the offset corresponding to the specified
subscripts exceeds 232.
line indicates the line number containing the statement at which the breakpoint is to
be set. line always refers to the first statement of the line. If this parameter is
omitted, no breakpoint is set before execution is resumed.
intraline refers to a specific statement within the program line. For example, 1
indicates the first intraline statement (or the second actual statement), 2 indicates the
second intraline statement, and so forth. If this parameter is omitted, the first
statement on the line is assumed.
prog-name provides for explicit program qualification during debugging. The value
of prog-name must be a program name from the PROGRAM-ID paragraph of the
Identification Division. If this parameter is omitted, it is assumed the reference is to
the currently executing program. If this parameter is omitted and count is specified,
there must be two commas before count.
count is an execution count. Debug allows the statement to execute a number of
times equal to count minus one, then honors and clears the breakpoint immediately
before the next execution (which now equals count) of the statement. Debug then
regains control. The maximum value for count is 65535. If this parameter is
omitted, count defaults to 1.
When you use the A Command, keep in mind that the specified breakpoint remains in
effect until it is honored. In other words, if execution halts and Debug regains control
at a statement other than that specified in the A Command, the breakpoint set by the
A Command remains in effect. It can be cleared by the C Command and displayed by
the B Command.
9-20 Debugging
A (Address Stop) Command
B (Breakpoint) Command
Use the B Command to display all currently set breakpoints or to set breakpoints at
specific procedural statements. Note that—unlike the A Command—a breakpoint set by
this command is not cleared once the conditions have been satisfied. To clear breakpoints
set with a B Command, you must enter a C Command.
The command syntax is nearly identical to that used with the A Command:
line indicates the line number containing the statement at which the breakpoint is to
be set. line always refers to the first statement of the line. If this parameter is
omitted, no breakpoint is set. Instead, all currently set breakpoints are displayed.
intraline refers to a specific statement within the program line. For example, 1
indicates the first intraline statement (or the second actual statement), 2 indicates the
second intraline statement, and so forth. If this parameter is omitted, the first
statement on the line is assumed.
prog-name provides for explicit program qualification during debugging. The value
of prog-name must be a program name from the PROGRAM-ID paragraph of the
Identification Division. If this parameter is omitted, it is assumed the reference is to
the currently executing program. If this parameter is omitted and count is specified,
there must be two commas before count.
count is an execution count. Debug allows the statement to execute a number of
times equal to count minus one, then honors and clears the breakpoint immediately
before the next execution (which now equals count) of the statement. Debug then
regains control. The maximum value for count is 65535. If this parameter is
omitted, count defaults to 1. Because the B Command does not clear breakpoints
after responding to them (as does the A Command), it remains in effect for all
subsequent occurrences.
For example, entering:
B 150+2, PAY-TAX, 5
sets a breakpoint at the third statement (second intraline statement) at line 150 in the
program PAY-TAX. When execution resumes, the breakpoint is ignored four times and
honored the fifth time. Program control then returns to Debug.
line [ + intraline ] p r o g - n a m e c o u n t
C (Clear) Command
Use the C Command to clear any breakpoints that have been set with the A or B
Commands.
line is the line number containing the statement at which the breakpoint to be cleared
is set. If no line number is specified, all currently active breakpoints are removed.
intraline refers to a specific statement within the program line. For example, 1
indicates the first intraline statement (or the second actual statement), 2 indicates the
second intraline statement, and so forth. If this parameter is omitted, the first
statement on the line is assumed.
prog-name provides for explicit program qualification during debugging. The value
of prog-name must be a program name from the PROGRAM-ID paragraph of the
Identification Division. If this parameter is omitted, it is assumed the reference is to
the currently executing program. If a line is specified on which no breakpoint exists,
the command is in error.
For example, entering:
C 100+2
clears the breakpoint set at the second intraline statement of line 100 in the currently
executing program.
9-22 Debugging
C (Clear) Command
D (Display) Command
Use the D Command to display on the screen the value of a specified data item.
Identifier Format
The syntax for the D Command with the identifier format (see the discussion of this
format that begins on page 9-6) is as follows:
D name-1 [ { IN | OF } n a m e - 2 ] … [ script ] [ r e f m o d ]
[ , { type | { * | & } [ type ] } ] [ # alias ]
( integer-1 [ [ , ] integer-2 ] … )
refmod specifies a subfield of the data item. (See page 9-7 for a complete
description.) It has this format:
( offset : [ length ] )
type specifies the data type to be used for displaying the named data item or index. If
this parameter is omitted, type defaults to the type of the item specified except when
a type modifier is specified. The type value IXN may only be used with index-names
and, when the named data item is an index-name, the only permissible type value is
IXN. The type value PTR may only be used with pointer data items and, when the
named data item is a pointer data item, the only permissible type value is PTR,
• The & type modifier indicates that the address of the data item specified is
to be displayed as a pointer value (data type PTR). Since the result type will
always be a pointer, if type is specified, type must be PTR. The & type modifier
may be used with a data item of any data type except an index-name (data type
IXN). The & type modifier may not be used with a constant-name since a
constant-name does not name a data item. The address of the data item will be
displayed as three sets of sixteen hexadecimal digits; the first set is the base
address, the second set is the offset (SET pointer UP/DOWN), and the third set
is the length of the memory area covered by the pointer.
alias is a name you enter to serve as another name for the data operand specification
that precedes it. (See page 9-11 for a complete description.) If present, alias must
follow a pound sign (#). The characters that follow the # must form a valid COBOL
word. Only the first three characters of this word are significant. When a command
defines an alias and specifies the * (indirect through pointer) type modifier, the
indirection is resolved at the time the alias is defined. In this case, the alias continues
to refer to the data item that the pointer data item referenced when the alias was
defined even if the pointer data item value has subsequently been changed. When a
command defines an alias and specifies the & (address of data item) type modifier,
the address of the data item is resolved each time the alias is specified using an alias
format command.
9-24 Debugging
D (Display) Command
For example, entering:
D MONTH-NAME(11)(1:3)
directs Debug to display the first three bytes of the 11th element in the table
MONTH-NAME. Debug then displays the following:
This shows the data address of 140, the type of data as alphanumeric, and the value
as NOV.
Address-Size Format
The syntax for the D Command with the address-size format (see the discussion of this
format that begins on page 9-9) is as follows:
base specifies the base item for formal arguments, based linkage items, and external
items as follows:
• For a USING formal argument, base is specified as U arg-num, where arg-num
specifies the ordinal position of the argument in the USING list of the Procedure
Division header provided in the allocation map of the program listing.
• For an external item, base is specified as X ext-num, where ext-num specifies the
compiler assigned external number provided in the allocation map of the
program listing.
Note A Linkage Section data item, which is neither a formal argument item nor a
based linkage item, is shown as "Not addressable:" in the allocation map of the
program listing. Since such items have not been used in the source program, the
compiler does not allocate a base pointer item for them and the Interactive Debugger
cannot access them.
directs Debug to display the data item located at decimal data address 25.
Debug then displays:
25 NSU 15
This shows that at the developed data address of (decimal) 25 is a value of 15, of type
numeric string unsigned.
9-26 Debugging
D (Display) Command
If the L Command (described on page 9-28) is used to specify a line number of the
monitor, the display appears one line at a time, at the line specified in the L Command. If
the display does not fit on one line, press the Enter key to see the next line. To return to
the Debug command prompt after the last line of data appears, press Enter.
If the L Command was not used, the display begins at the next line and scrolls when the
bottom of the screen is reached.
Alias Format
The syntax for the D Command with the alias format for specifying a data item or index
reference is as follows:
D # alias
# is required.
alias must form a valid COBOL word, only the first three characters of which are
valid. (See page 9-11 for a complete description.) The alias must have been
previously defined in an identifier or address-size format specification.
E (End) Command
Use the E Command to leave Debug. The currently executing program runs until
completion.
L [ line-display ]
line-display designates a line number on the monitor and may be in the range 0
through the number of lines on the screen.
This command is useful when you are debugging programs that have a variety of
interactive ACCEPT and DISPLAY statements. By selecting a specific line for Debug
displays, you can reduce or avoid conflicts between lines produced by Debug and lines
produced by the program.
If line-display is omitted from the command, or line-display equals 0, the screen resumes
its standard mode of operation (scrolling).
M (Modify) Command
Use the M Command to change the value of a specified data item.
Identifier Format
The syntax for the M Command with the identifier format (see the discussion of this
format that begins on page 9-6) is as follows:
M name-1 [ { IN | OF } n a m e - 2 ] … [ script ] [ r e f m o d ]
[ , { type | { * | & } [ type ] } ] [ # alias ] , value
name-1 is a name declared as a data-name or index-name for the data item or index
to be modified. name-2 is a qualifier for name-1. Qualification is required if the
name is not unique. The named data item or index must be described in the Data
Division of the current program or be described with the GLOBAL attribute in a
program that contains the current program.
9-28 Debugging
L (Line Display) Command
script specifies subscripting and is required if the data item referenced by name-1 is a
table element. (See page 9-7 for a complete description.) If the data item is not a
table element, do not specify script. The format for script is as follows:
( integer-1 [ [ , ] integer-2 ] … )
refmod specifies a subfield of the data item. (See page 9-7 for a complete
description.) It has this format:
( offset : [ length ] )
type specifies the data type of the item to be modified. If this parameter is omitted,
type defaults to the type of the item specified except when a type modifier is
specified. The type value IXN may only be used with index-names and, when the
named data item is an index-name, the only permissible type value is IXN. The type
value PTR may only be used with pointer data items and, when the named data item
is a pointer data item, the only permissible type value is PTR, except when a type
modifier is specified. The type modifiers * and & have the following effect:
• The * type modifier indicates that the data item to modify is determined by an
indirect reference, that is, a reference to the data item referenced by a pointer
data item value. The data item specified in the command must be a pointer data
item (data type PTR). In this case, type, if specified, indicates the type of the
data item referenced by the pointer data item value. If type is not specified, the
default is hexadecimal. If refmod is not specified for an indirect reference, the
entire effective memory area specified by the pointer data item value is modified.
The effective memory area specified by a pointer data item value begins with the
effective address (pointer.address + pointer.offset) and ends just before the
effective limit address (pointer.address + pointer.length). If refmod is specified
for an indirect reference, refmod is applied to the indirect reference rather than
the pointer data item itself. Thus, refmod may be used to modify a subfield
within the current effective memory area of an indirect reference.
• The & type modifier indicates that the address of the data item specified is
to be modified. The data item referenced in the command must be a based
linkage record because, otherwise, the address is not modifiable. The data item
referenced in the command may be any data type except an index-name (data
type IXN). When the & type modifier is used, the value must be a pointer value
and, if type is specified, type must be PTR.
M MONTH-NAME(12), DECEMBER
directs Debug to modify the 12th element of the table MONTH-NAME to have the value
of DECEMBER.
Address-Size Format
The syntax for the M Command with the address-size format (see the discussion of this
format that begins on page 9-9) is as follows:
base specifies the base item for formal arguments, based linkage items, and external
items as follows:
• For a USING formal argument, base is specified as U arg-num, where arg-num
specifies the ordinal position of the argument in the USING list of the Procedure
Division header provided in the allocation map of the program listing.
9-30 Debugging
M (Modify) Command
• For an external item, base is specified as X ext-num, where ext-num specifies the
compiler assigned external number provided in the allocation map of the
program listing.
Note A Linkage Section data item, which is neither a formal argument item nor a
based linkage item, is shown as "Not addressable:" in the allocation map of the
program listing. Since such items have not been used in the source program, the
compiler does not allocate a base pointer item for them and the Interactive Debugger
cannot access them.
address specifies the address of the data item to be modified. This is based on the
value obtained from the data allocation map. (See page 9-9 for more information on
addresses used with Debug.)
occur-size specifies the size of data items that contain OCCURS clauses in their
definitions.
occur-num specifies the occurrence number for data items that contain OCCURS
clauses in their definitions.
size specifies the size of the data item to be modified. If type is IXN, this is the value
that appears in the Span column of the data allocation map.
type specifies the type of data item referenced. If this parameter is omitted, type
defaults to hexadecimal. The type modifiers * (indirect through pointer) and &
(address of data item) may not be specified in the address-size format.
alias is a name you enter to serve as another name for the data operand specification
that precedes it. (See page 9-11 for a complete description.) If present, alias must
follow a pound sign (#). The characters that follow the # must form a valid COBOL
word. Only the first three characters of this word are significant.
value is the value of the data in the format specified by type in the M Command line.
If type is one of the nonnumeric types ANS, ANSE, ABS, ABSE, GRP or NSE, value is
stored in the specified data item and is left justified with blank fill or truncation on the
right. Note that no editing is performed during this operation.
If type is one of the numeric types NBS, NBU, NCS, NCU, NLC, NLS, NPP, NPS,
NPU, NSU, NTC or NTS, value is converted to a signed integer according to the rules
for a MOVE from a numeric edited sending item to a numeric destination item (see the
If type is IXN, value is converted to a signed integer occurrence number. This number is
then converted to the internal index-name representation based on the value of size.
If type is PTR, value must be a pointer value. The pointer value 0 is equivalent to NULL
(NULLS). For pointer values other than 0, a pointer value is forty-eight hex digits, where
the first sixteen digits specify the base address, the middle sixteen digits specify the offset
from the base address, and the last sixteen digits specify the length of the memory area.
Embedded spaces are allowed and ignored. Leading zeroes must be specified. If the
program was compiled with the Y Compile Command Option, then a pointer value may
also be specified with either of the value modifiers = or =& as follows:
If the = value modifier is specified (without the &), name-3 must refer to a pointer data
item and refmod is not allowed. The current value of the referenced pointer data item is
used for value. This is equivalent to the COBOL statement:
If the =& value modifier is specified, value is composed from the address of the data item
named by name-3, an offset of zero, and the length of the data item named by name-3.
This is equivalent to the COBOL statement:
Note The Interactive Debugger attempts to validate a pointer value when specified,
but the validation results may not be conclusive. It is the user's responsibility to take
care when modifying pointer data items or based linkage base addresses to ensure
correctness. One easy method of correctly modifying a pointer value is to display the
desired pointer value using the D Command and then using copy/paste to paste the
value into the value field of an M Command. Another method is to use one of the =
or =& value modifiers described above.
In all other cases, the resulting integer is stored in the data item as if the item had no
assumed decimal point. If conversion results in a noninteger, an error message appears
and the specified data item remains unaltered.
9-32 Debugging
M (Modify) Command
For example, entering:
M 13+2*7,2,NSU,0
directs Debug to modify the data item located at decimal data address 25. The NSU data
item will have a new value of 0.
Alias Format
The syntax for the M Command with the alias format for specifying a data item or index
reference is as follows:
M # alias , value
# is required.
alias must form a valid COBOL word, only the first three characters of which are
valid. (See page 9-11 for a complete description.) The alias must have been
previously defined in an identifier or address-size format reference to the desired
item (for example, in a D (Display) Command).
value specifies the new value for the data item or index. The format for specifying
the value is described by type in the preceding section, “Address-Size Format.”
Q (Quit) Command
Use the Q Command to stop program execution. This command terminates the program
as if a STOP RUN statement were executed.
The syntax of the Q Command is as follows:
When the Q Command is executed, open files are closed and control returns to the
operating system.
R [ statement-address ]
statement-address specifies the specific program address for the sentence at which
execution is to resume. If statement-address is not specified, execution resumes at
the current location. statement-address appears in the Debug column at the left of
the program listing, and should be entered as printed. statement-address is not a
line number.
An error condition or stop run condition (that is, the command prompt contains ER or SR)
forces the R Command to disallow statement-address. The R Command may be used in
its simple form (that is, without an accompanying statement-address) to allow Debug to
trace back through the program units of a run unit, but the run unit may not be restarted
when an error or stop run condition occurs.
Note The R Command used with a statement-address resets the program counter. If an
improper statement-address is specified, Debug displays an error. The program counter
remains invalid until another R Command with a valid statement-address is used. An
R Command with no statement-address at this time causes Debug to display an error.
9-34 Debugging
R (Resume) Command
S (Step) Command
Use the S Command to specify that program execution occur one step at a time. With
Debug, you can step through a statement, a paragraph, or an entire section.
S [ P | S ] [ count ]
Specifying count greater than 1 causes Debug to trace the statements, paragraphs or
sections executed while in stepping mode. The format of the trace message is as follows:
SS 10
directs Debug to execute 9 sections, produce 9 trace messages, and then halt before
executing the 10th.
A data trap set with the T Command can be removed with the U (Untrap) Command. A
data trap set on a Linkage Section data item is removed automatically when the program
exits. A data trap set on a File Section, Working-Storage Section or Screen Section data
item is removed automatically when the separately compiled program is canceled. A data
trap set on an external data item will continue until the run unit ends.
Identifier Format
The syntax for the T Command with the identifier format (see the discussion of this
format that begins on page 9-6) is as follows:
T name-1 [ { IN | OF } n a m e - 2 ] … [ script ] [ r e f m o d ]
[ , { type | { * | & } [ type ] } ] [ # alias ]
name-1 is a name declared as a data-name or index-name for the data item or index
to be monitored. name-2 is a qualifier for name-1. Qualification is required if the
name is not unique. The named data item or index must be described in the Data
Division of the current program or be described with the GLOBAL attribute in a
program that contains the current program.
script specifies subscripting and is required if the data item referenced by name is a
table element. (See page 9-7 for a complete description.) If it is not a table element,
do not specify script. The format for script is as follows:
( integer-1 [ [ , ] integer-2 ] … )
refmod specifies a subfield of the data item. (See page 9-7 for a complete
description.) It has this format:
( offset : [ length ] )
9-36 Debugging
T (Trap) Command
type specifies the data type to be used in displaying the monitored data item or index
when a change in value occurs. If this parameter is omitted, type defaults to the type
of the item specified except when a type modifier is specified. The type value IXN
may only be used with index-names and, when the named data item is an index-name,
the only permissible type value is IXN. The type value PTR may only be used with
pointer data items and, when the named data item is a pointer data item, the only
permissible type value is PTR, except when a type modifier is specified. The type
modifiers * and & have the following effect:
• The * type modifier indicates that the data item to start monitoring is determined
by an indirect reference, that is, a reference to the data item referenced by a
pointer data item value. The data item specified in the command must be a
pointer data item (data type PTR). In this case, type, if specified, indicates the
type of the item referenced by the pointer data item value. If type is not
specified, the default is hexadecimal. If refmod is not specified for an indirect
reference, the entire effective memory area specified by the pointer data item
value is monitored. The effective memory area specified by a pointer data item
value begins with the effective address (pointer.address + pointer.offset) and
ends just before the effective limit address (pointer.address + pointer.length). If
refmod is specified for an indirect reference, refmod is applied to the indirect
reference rather than the pointer data item itself. Thus, refmod may be used to
monitor a subfield within the current effective memory area of an indirect
reference. The indirect reference is resolved at the time the trap is set with the
T (Trap) Command and subsequent changes to the pointer data item used to set
the trap do not change the data item that is being monitored by the trap. To
monitor changes in the pointer data item itself, do not use the * type modifier.
• The & type modifier indicates that the base address of the data item specified is
to be monitored. The data item referenced in the command must be a based
linkage record because, otherwise, the address is not modifiable. The data item
referenced in the command may be any data type except an index-name (data
type IXN). When the & type modifier is used, the value to be monitored is a
pointer value and, if type is specified, type must be PTR. A trap set on a based
linkage data item, without the & type modifier, is resolved at the time the trap is
set and subsequent changes to the base address of the based linkage item do not
change the data item that is being monitored. To monitor changes in the base
address of a based linkage item, use the & type modifier with the based linkage
record data-name.
alias is a name you enter to serve as another name for the data operand specification
that precedes it. (See page 9-11 for a complete description.) If present, alias must
follow a pound sign (#). The characters that follow the # must form a valid COBOL
word. Only the first three characters of this word are significant. When a command
defines an alias and specifies the * (indirect through pointer) type modifier, the
T MONTH-NAME(12)
directs Debug to suspend execution whenever the value of the 12th element in the table
MONTH-NAME changes.
Address-Size Format
The syntax for the T Command with the address-size format (see the discussion of this
format that begins on page 9-9) is as follows:
base specifies the base item for formal arguments, based linkage items, and external
items as follows:
• For a USING formal argument, base is specified as U arg-num, where arg-num
specifies the ordinal position of the argument in the USING list of the Procedure
Division header provided in the allocation map of the program listing.
• For an external item, base is specified as X ext-num, where ext-num specifies the
compiler assigned external number provided in the allocation map of the
program listing.
Note A Linkage Section data item, which is neither a formal argument item nor a
based linkage item, is shown as "Not addressable:" in the allocation map of the
program listing. Since such items have not been used in the source program, the
9-38 Debugging
T (Trap) Command
compiler does not allocate a base pointer item for them and the Interactive Debugger
cannot access them.
address specifies the address of the data item to be monitored. This is based on the
value obtained from the data allocation map. (See page 9-9 for more information on
addresses used with Debug.)
occur-size specifies the size of data items that contain OCCURS clauses in
their definitions.
occur-num specifies the occurrence number for data items that contain OCCURS
clauses in their definitions.
size specifies the size of the data item to be monitored.
type specifies the type of data item referenced. If this parameter is omitted, type
defaults to hexadecimal. The type modifiers * (indirect through pointer) and &
(address of data item) may not be specified in the address-size format.
alias is a name you enter to serve as another name for the data operand specification
that precedes it. (See page 9-11 for a complete description.) If present, alias must
follow a pound sign (#). The characters that follow the # must form a valid COBOL
word. Only the first three characters of this word are significant.
Before RM/COBOL executes a statement, it examines the contents of the specified data
item with the value the data item had at the point program execution last resumed. If a
change has not occurred, execution proceeds to the next statement. If a change has
occurred, execution is suspended and the contents of the data item appear according to the
rules set down in the discussion of the D Command that begins on page 9-23. The trap is
updated, and remains in effect until a U Command is executed.
Alias Format
The syntax for the T Command with the alias format for specifying a data item or index
reference is as follows:
T [ # alias ]
# is required.
alias must form a valid COBOL word, only the first three characters of which are
valid. (See page 9-11 for a complete description.) The alias must have been
previously defined in an identifier or address-size format reference to the desired
item (for example, in a D (Display) Command).
Identifier Format
The syntax for the U Command with the identifier format (see the discussion of this
format that begins on page 9-6) is as follows:
U name-1 [ { IN | OF } n a m e - 2 ] … [ script ] [ r e f m o d ]
[ , { type | { * | & } [ type ] } ]
name-1 is a name declared as a data-name or index-name for the data item or index
whose data trap is to be removed. name-2 is a qualifier for name-1. Qualification is
required if the name is not unique. The named data item or index must be described
in the Data Division of the current program or be described with the global attribute
in a program that contains the current program.
script specifies subscripting and is required if the data item referenced by name is a
table element. (See page 9-7 for a complete description.) If it is not a table element,
do not specify script. The format for script is as follows:
( integer-1 [ [ , ] integer-2 ] … )
refmod specifies a subfield of the data item. (See page 9-7 for a complete
description.) It has this format:
( offset : [ length ] )
9-40 Debugging
U (Untrap) Command
type specifies the data type of the monitored data item that is to be removed from the
monitored item list. If this parameter is omitted, type defaults to the type of the item
specified except when a type modifier is specified. The type value IXN may only be
used with index-names and, when the named data item is an index-name, the only
permissible type value is IXN. The type value PTR may only be used with pointer
data items and, when the named data item is a pointer data item, the only permissible
type value is PTR, except when a type modifier is specified. The type modifiers *
and & have the following effect:
• The * type modifier indicates that the data item to discontinue monitoring is
determined by an indirect reference, that is, a reference to the data item
referenced by a pointer data item value. The data item specified in the command
must be a pointer data item (data type PTR). In this case, type, if specified,
indicates the type of the item referenced by the pointer data item value. If type is
not specified, the default is hexadecimal. If refmod is not specified for an
indirect reference, the entire effective memory area specified by the pointer data
item value is the data reference to discontinue monitoring. The effective
memory area specified by a pointer data item value begins with the effective
address (pointer.address + pointer.offset) and ends just before the effective limit
address (pointer.address + pointer.length). If refmod is specified for an indirect
reference, refmod is applied to the indirect reference rather than the pointer data
item itself. Thus, refmod may be used to discontinue monitoring a subfield
within the current effective memory area of an indirect reference.
• The & type modifier indicates that the data item to discontinue monitoring is the
address of the data item specified. The data item referenced in the command
must be a based linkage record because, otherwise, the address is not modifiable.
The data item referenced in the command may be any data type except an
index-name (data type IXN). When the & type modifier is used, the monitored
item is a pointer data item and, if type is specified, type must be PTR.
U MONTH-NAME(12)
U [ [ b a s e : ] address [ + occur-size * o c c u r - n u m ] … ]
base specifies the base item for formal arguments, based linkage items, and external
items as follows:
• For a USING formal argument, base is specified as U arg-num, where arg-num
specifies the ordinal position of the argument in the USING list of the Procedure
Division header provided in the allocation map of the program listing.
• For an external item, base is specified as X ext-num, where ext-num specifies the
compiler assigned external number provided in the allocation map of the
program listing.
Note A Linkage Section data item, which is neither a formal argument item nor a
based linkage item, is shown as "Not addressable:" in the allocation map of the
program listing. Since such items have not been used in the source program, the
compiler does not allocate a base pointer item for them and the Interactive Debugger
cannot access them.
address specifies the address of the data item for which a trap is active. This is based
on the value obtained from the data allocation map. (See page 9-9 for more
information on addresses used with Debug.) If address is not specified, all currently
active data traps are cleared.
occur-size specifies the size of data items that contain OCCURS clauses in their
definitions.
occur-num specifies the occurrence number for data items that contain OCCURS
clauses in their definitions.
9-42 Debugging
U (Untrap) Command
If you enter only U, all currently activated traps are cleared.
For example:
U 13+2*7
clears the trap on the data item located at decimal data address 25.
Alias Format
The syntax for the U Command with the alias format for specifying a data item or index
reference is as follows:
U [ # alias ]
# is required.
alias must form a valid COBOL word, only the first three characters of which are
used. (See page 9-11 for a complete description.) The alias must have been
previously defined in an identifier or address-size format reference to the desired
item (for example, in the T (Trap) Command which set the trap).
This chapter details the configuration file structure, configuration error format,
configuration record types, and terminal configuration record types.
Configuration records can appear in any order within the configuration file, except where
noted otherwise. The first field in each record identifies the type of record or value being
defined. The format of the remainder of the record depends on the type of record.
Except for specific character sequences, keywords and parameters in the records are case
insensitive; uppercase and lowercase letters are equivalent.
The records are free field; that is, individual fields need not start in any predetermined
column. The general syntax is as follows:
r e c o r d - n a m e k e y w o r d =value[,value]
record-name is the name of one of the configuration records detailed in this chapter.
keyword is the name of the keyword specification being described. It must be
followed by an equal sign. Optional spaces following the equal sign are allowed.
value, depending on the keyword, may be either a string or a number. Value strings
that contain a space, equal sign, or comma must be quoted with either the double
Comments may be included in the configuration file. Comment text begins with a slash
and an asterisk (/*) in columns 1 and 2. Lines that have /* in columns 1 and 2, as well as
blank lines, are ignored in their entirety.
10-2 Configuration
Built-In and Attached Configuration Files
Configuration Errors
If your configuration file contains errors, you will see a message similar to one of the
following:
Configuration error code at record number in configuration file.
code is the error number listed for configuration records, described in Appendix A,
Runtime Messages, starting on page A-37.
number is the logical record in the configuration file where the error occurred. When
using number to determine which record is in error, count lines combined with their
continuation lines as one record, and do not count comment lines or blank lines.
If the message is of the first format shown, the text of the configuration record in error
will follow the message.
The actual error message formats are described in Chapter 6, Compiling, for the compiler
and in Appendix A, Runtime Messages, for the runtime system and Indexed File
Recovery utility.
Configuration Records
Table 10-1 lists and describes the types of configuration records. Configuration
options that are not used by the compiler, the runtime system, or the Indexed File
Recovery utility (recover1) are ignored. Therefore, the same configuration file may be
used to configure the compiler, the runtime system, and the Indexed File Recovery
program, if appropriate.
Runtime
Record Type Description Compiler System Recover1
COMPILER-OPTIONS Allows default compiler 9
options to be changed
(see page 10-6).
DEFINE-DEVICE Associates the file 9 9
access name with a
physical filename of a
device or process (see
page 10-16).
EXTENSION-NAMES Defines the character- 9 9
strings to be used for
filename extensions (see
page 10-19).
EXTERNAL-ACCESS- Describes the access to 9 9
METHOD external file access
methods, such as
Btrieve, RM/plusDB,
and RM/InfoExpress,
from the RM/COBOL
file management system
(see page 10-20).
PRINT-ATTR Describes printer 9 9
characteristics (see
page 10-20).
RUN-ATTR Describes general 9
runtime characteristics
(see page 10-23).
RUN-FILES-ATTR Describes the 9 9 9
characteristics common
to all file organizations
(see page 10-26).
1
Terminal configuration records are never necessary because terminal independence is
provided by terminfo and termcap. Terminal configuration is still provided, however,
to allow extensions to the basic capabilities provided by terminfo and termcap in a
manner that will not conflict with other applications on your system.
9 Indicates that the configuration record is used.
10-4 Configuration
Configuration Records
Table 10-1 Types of Configuration Records (Cont.)
Runtime
Record Type Description Compiler System Recover1
RUN-INDEX-FILES Describes indexed file 9
characteristics (see
page 10-31).
RUN-OPTION Describes default 9
runtime option values
(see page 10-33).
RUN-REL-FILES Describes relative file 9 9
characteristics (see
page 10-34).
RUN-SEQ-FILES Describes sequential file 9 9 9
characteristics (see
page 10-34).
RUN-SORT Describes SORT- 9
MERGE characteristics
(see page 10-36).
TERM-ATTR1 Describes terminal 9 9
characteristics (see
page 10-36).
TERM-INPUT1 Defines incoming 9 9
character sequences (see
page 10-41).
TERM-INTERFACE1 Specifies the format for 9 9
the other terminal
configuration records,
as well as the interface
to be used for screen
I/O (see page 10-49).
TERM-UNIT1 Associates the unit 9
(UNIX Only) number of ACCEPT
and DISPLAY
statements with the
actual device on
the system (see
page 10-49).
Certain options require that another option be present before the compiler can proceed.
For example, it is not valid to specify a cross reference if the program listing is not being
generated. Other options may conflict with each other. For instance, the option to treat
COMPUTATIONAL operands as binary is not valid if the program is being compiled in
RM/COBOL (74) version 2.n-compatible mode. These conditions are not checked when
the configuration file is processed. Rather, they are deferred until the command line
options have also been processed.
10-6 Configuration
Configuration Records
Table 10-2 MF-RM Binary Allocation
The RM, RM1, and MF-RM values for the BINARY-ALLOCATION keyword have
the following relationships to the CUSTOM=integer-list value:
• REDEFINES validity when the subject or object define binary data items.
• CALL statement arguments that are binary or are groups that contain binary data
items. This includes CALL statement arguments for the supplied subprogram
library, for example, arguments for C$CARG and C$SCRD.
• Pop-up windows, because the Pop-Up Window Control Block is a group that
contains binary data items that must be allocated a specific number of bytes.
Thus, this configuration capability should be used with care. The binary allocation
override language feature of RM/COBOL (see the USAGE clause in the data
description entry) is more appropriate in situations where the programmer wants to
control the allocated sizes of certain binary data items on a case by case basis. The
binary allocation configuration capability is intended mostly for easing conversion to
RM/COBOL from other COBOL dialects that use a different allocation scheme.
When this configuration keyword is used, it must be used consistently throughout a
programming project, and, in some cases, the binary allocation override language
feature may need to be used to resolve conflicts (for example, when defining
argument data items for the Liant supplied subprogram library).
10-8 Configuration
Configuration Records
3. BINARY-ALLOCATION-SIGNED. This keyword causes unsigned binary data
items to be allocated as if they were signed, so that signed and unsigned data items
with the same number of digits will be allocated the same number of bytes of storage.
If the value is set to YES, unsigned binary data items are allocated the same number
of bytes of storage as if they were signed; only the allocation is affected, the data
item is not treated as signed for any other purpose. If the value is set to NO,
unsigned items are allocated the minimum number of bytes necessary to support the
unsigned precision specified by the PICTURE character-string, which for several
cases is one less byte of storage than for the corresponding signed precision. The
default value is NO.
4. COBOL-74. This keyword allows programs created for ANSI COBOL 1974 to be
compiled. If the value is set to YES, ANSI COBOL 1974 semantics and I-O status
values are assumed. If the value is set to NO, ANSI COBOL 1985 semantics and
I-O status values are assumed. The default value is NO.
When the value is set to YES, this keyword corresponds to the compiler U=B Option
(see page 6-7).
10-10 Configuration
Configuration Records
The RMCOBOL2 and RMCOS options allow applications to access files containing
COMPUTATIONAL and COMPUTATIONAL-3 data items that use previous sign
representations. This keyword has no corresponding Compile Command line option.
The default value is RMCOBOL85.
Note 1 The COMPUTATIONAL-VERSION keyword may be used in conjunction
with the COMPUTATIONAL-TYPE keyword or the compiler U Option (see
page 6-7). For example, by setting COMPUTATIONAL-TYPE=PACKED-DECIMAL
(or the compiler U=P Option in the Compile Command) and COMPUTATIONAL-
VERSION=RMCOBOL2, COMPUTATIONAL data items will be PACKED-
DECIMAL with the RM/COBOL (74) version 2 sign representation.
Note 2 When using the COMPUTATIONAL-VERSION keyword, you cannot
specify an object version level less than 7.
8. DEBUG. This keyword determines whether source programs are to be compiled as
if the WITH DEBUGGING MODE clause appeared in each program. If the value is
set to YES, the debugging mode is selected. If the value is set to NO, debugging
mode is not selected. The default value is NO.
This keyword corresponds to the compiler D Option (see page 6-15).
9. DEBUG-TABLE-OUTPUT. This keyword, when the value is set to YES, causes
the compiler to include both the symbol table and the debug line table in the
object program. Furthermore, when the value is set to ALL, the actual text of
compiler-generated lines that do not appear in source or copy files is also included
in the object file and is available during debugging.
When the debug line table is included in the object program, CodeWatch can display
the program’s source at execution time. Setting YES is sufficient for most purposes.
If ALL is set, the displayed source has the appearance of a printed listing. Note that
this may lead to large object program files. (After debugging is complete, this
information may be removed by the STRIP option in the Combine Program utility
(rmpgmcom), as described in Appendix G, Utilities.)
When the value of this keyword is set to NO, the line table is not included in the
object file. The default value is NO.
10-12 Configuration
Configuration Records
CROSS-REFERENCE generates a cross reference map. When set to this value, the
LISTING-ATTRIBUTES keyword corresponds to the compiler X Option (see
page 6-11). By default, the cross reference listing is not generated.
ERROR-ONLY-LIST includes only erroneous source lines in the listing file. When
set to this value, the LISTING-ATTRIBUTES keyword corresponds to the compiler
E Option (see page 6-9). By default, the source program component of the listing is
not suppressed.
LISTING-FILE writes a copy of the listing file to disk. When set to this value, the
LISTING-ATTRIBUTES keyword corresponds to the compiler L Option (see
page 6-9). By default, a copy of the listing file is not written to disk.
PRINT-LISTING prints a copy of the listing file. When set to this value, the
LISTING-ATTRIBUTES keyword corresponds to the compiler P Option (see
page 6-10). By default, the listing file is not printed.
SUPPRESS-COPY-FILES directs that text in the copy files not be placed in the
listing file. When set to this value, the LISTING-ATTRIBUTES keyword
corresponds to the compiler C Option (see page 6-9). By default, copy files are
placed into the listing file.
TERMINAL-LISTING displays a copy of the listing file on the screen. When set to
this value, the LISTING-ATTRIBUTES keyword corresponds to the compiler T
Option (see page 6-11). By default, a copy of the listing is not written to the standard
output device.
If the value is set to YES, this keyword numbers records beginning with 1 for each
source or copy input file. The number can be helpful when editing the source file.
This line number cannot be used with the RM/COBOL Interactive Debugger.
10-14 Configuration
Configuration Records
If the value is set to NO, the compiler will print the source record exactly as read,
including any commentary information present in columns 1 through 6.
The default value for this keyword is NO. This keyword corresponds to the compiler
R Option (see page 6-10).
20. RMCOBOL-2. This keyword allows programs created for the RM/COBOL (74)
version 2.n compiler to be compiled. If the value is set to YES, RM/COBOL (74)
version 2.n programs are accepted. If the value is set to NO, they are not. The
default value is NO.
DEFINE-DEVICE Record
The DEFINE-DEVICE record is used to associate a physical device to a value for an
RM/COBOL file access name. The keywords DEVICE and PATH must be present. The
DEFINE-DEVICE record identifier is followed by one or more keywords. If the keyword
is allowed to have a value, it is followed by an equal sign (=) and the value. The possible
keywords are as follows:
1. DEVICE. This keyword specifies the RM/COBOL file access name value that will
be associated with the operating system device. If the value of the DEVICE keyword
is the same as the value specified as the file access name, the value supplied in the
PATH keyword will be used as the actual pathname.
10-16 Configuration
Configuration Records
2. PATH. This keyword specifies the pathname to be used as the pathname or pipe for
the device. This value may be enclosed in quotation marks to allow spaces to be
included in a pipe (see the next paragraph). If it necessary to place a quotation mark
in the pipe, use a pair of consecutive quotation marks for each quote within the string.
3. PIPE. This keyword determines whether the value of the PATH keyword is a
process to be spawned. If the value is set to YES, the runtime system will start
another program to simulate a device receiving the record by creating a write-only
pipe and forking a child shell process using the value of the PATH keyword as the
shell’s command. Thus, the value of the PATH keyword specifies the program to
start. If you use quotation marks to enclose the command, any shell command may
be given along with any options. If the value is set to NO, the runtime system will
use the PATH value as the actual pathname. The default value is NO.
4. RAW. This keyword determines whether the Windows printer described by the
value of the PATH keyword is opened in RAW mode. If the value is set to YES,
the runtime system will open the printer in RAW mode. This allows certain
Windows NT networked printers to respond to embedded escape sequences. See
“P$SetRawMode” subprogram in Appendix E, Windows Printing, for a more
complete description of RAW mode. Most P$ subprograms are not available if
RAW mode is used. If the value is set to NO, the runtime system will treat the
printer as a normal Windows printer. The default value is NO.
The PATH keyword specifies the Windows printer device to use. The syntax is as
follows:
Note If neither a Device Name nor Port is specified, the default printer is used.
For compatibility with Windows, whenever a device name followed by the colon
character is encountered in either the DEVICE or PATH keywords, it is treated as if the
colon were not present. For example, the following configuration records:
DEFINE-DEVICE DEVICE=PRN: PATH=",LPT1"
DEFINE-DEVICE DEVICE=LPT2 PATH=",LPT2:"
10-18 Configuration
Configuration Records
To perform translation of “PRINTERx” names in the same way that the RM/COBOL for
DOS runtime system does, the following default synonym table is used.
DEVICE=PRINTER PATH="DEFAULT"
DEVICE=PRINTER? PATH="DYNAMIC"
DEVICE=PRINTER1 PATH=",LPT1"
DEVICE=PRINTER2 PATH=",LPT2"
DEVICE=PRINTER3 PATH=",LPT3"
DEVICE=PRINTER4 PATH=",LPT4"
DEVICE=PRINTER5 PATH=",LPT5"
DEVICE=PRINTER6 PATH=",LPT6"
DEVICE=PRINTER7 PATH=",LPT7"
DEVICE=PRINTER8 PATH=",LPT8"
DEVICE=PRINTER9 PATH=",LPT9"
EXTENSION-NAMES Record
The EXTENSION-NAMES record identifier is followed by one or more keywords
indicating file usages. Each keyword is allowed to have a value, and is followed by an
equal sign (=) and the value. More than one file usage keyword may be listed in one
EXTENSION-NAMES record. The extension value must be one to three characters in
length. The extension value may be specified as a single period to indicate that no
extension is to be used for files of the file usage indicated by the keyword. In all other
cases, the characters specified for the extension value must be in the set of characters that
are valid for a filename extension under the current operating system.
1. COPY. This keyword specifies the extension to be used for files referenced by
COPY statements in a COBOL source program. The default extension for copy files
is cbl.
2. LISTING. This keyword specifies the extension to be used for COBOL listing files.
The default extension for listing files is lst.
3. OBJECT. This keyword specifies the extension to be used for COBOL object
program files. The default extension for object files is cob.
4. SOURCE. This keyword specifies the extension to be used for COBOL source
program files. The default extension for source files is cbl.
1. CREATE-FILES. This keyword controls whether the external access method will
be called to create new files. If the value is set to YES, the external access method
will be allowed to create files. If the value is set to NO, and the file does not exist,
the external access method will not be called to create it. The default value for this
keyword is YES.
2. NAME. This keyword is used to identify the name of the external access method. It
is required and has no default value. The external access method names currently
identified are RMPLUSDB, RMINFOX, and USRMTACC for UNIX, and
RMBTRV32, RMSPX32, and RMTCP32 for Windows.
3. OPTIONS. This keyword is used to pass options to the external access method
interface. The options must be enclosed in quotation marks. The possible values
depend on the external access method that is specified in the NAME keyword. If this
keyword is not specified, no options will be passed to the external access
method interface.
PRINT-ATTR Record
The PRINT-ATTR record is used to describe the characteristics of the printer to which
printer files are assigned or on which printer files will eventually be printed. A printer
file is a line sequential file that has any or all of the following RM/COBOL source
program features:
• ASSIGN TO PRINT or ASSIGN TO PRINTER phrase in the file control entry for
the file
10-20 Configuration
Configuration Records
The PRINT-ATTR record identifier is followed by one or more keywords. If the
keyword is allowed to have a value, it is followed by an equal sign (=) and the value. The
possible keywords are as follows:
Note This option only determines the method used by the runtime I-O system to
position the file to a new physical page. The runtime I-O system would normally
print a form feed character to accomplish a physical page break. If the user's printer
does not support advancing to the next physical page when a form feed character is
printed, the value of this option can be set to NO to tell the runtime I-O system not to
use a form feed character for this purpose. Regardless of the setting of this option,
files described with the LINAGE clause do not normally use physical page breaks
because the LINAGE clause describes logical rather than physical pages. Files
described with the LINAGE clause will be affected by this option only if either of the
PRINT-ATTR configuration record keywords LINES or LINAGE-PAGES-PER-
PHYSICAL-PAGE are set to a nonzero value.
Note This option instructs the runtime I-O system to insert a physical page break
between certain logical pages. The physical page break is normally a form feed
character. However, the PRINT-ATTR configuration record keyword settings
FORM-FEED-AVAILABLE=NO and LINES=n may be used together in those cases
where a form feed character is either not available or not desirable. In this case, a
physical page break is accomplished by printing the number of line feed characters
necessary to ensure n lines per physical page.
This keyword also determines the number of lines on a page of a compilation listing.
If not specified, the RM/COBOL compiler assumes 66 lines per page.
Note This option, when set to a nonzero value, will cause files described with the
LINAGE clause to advance to a new physical page whenever that number of lines
have been printed. This may result in unintended additional spacing between or
within logical pages, depending on the relationship between the value specified for
LINES and the size(s) of logical pages. For page printers, setting LINES to the size
of the logical page may have the desired effect of ejecting pages from the printer
10-22 Configuration
Configuration Records
when a logical page is complete. However, the PRINT-ATTR configuration record
keyword LINAGE-PAGES-PER-PHYSICAL-PAGE, which only affects files
described with the LINAGE clause, is better suited to this purpose.
RUN-ATTR Record
The RUN-ATTR record identifier is followed by one or more keywords. If the keyword
is allowed to have a value, it is followed by an equal sign (=) and the value. The
following descriptions include the default values that are used if the keyword is not
modified by a RUN-ATTR record. The possible keywords are as follows:
Only fields output by the RM/COBOL runtime system can be reliably retrieved. The
contents of a field that appeared on the display prior to the invocation of the runtime
are considered undefined.
4. BEEP. This keyword determines whether the runtime system should override the
beeps (BEEP) that are coded in ACCEPT and DISPLAY statements. If the value
is set to YES, the beeps that are coded in the statements (including the default beeps
on ACCEPT statements) cause the terminal to beep. If the value is set to
FORCED-ACCEPT, all Format 3 ACCEPT statements cause the terminal to beep;
all other ACCEPT and DISPLAY statements behave as if the value were set to YES.
If the value is set to NO, the beeps that are coded in the statements are ignored. The
default value is YES.
5. BLINK. This keyword determines whether the runtime system should override
blinking (BLINK) coded in the ACCEPT and DISPLAY statements. If the value is
set to YES, blinking is used as directed by the statements. If the value is set to NO,
blinking is not used. The default value is YES.
10-24 Configuration
Configuration Records
9. EDIT-DECIMAL. This keyword enables the decimal point edit character to be
overridden with the character corresponding to the value of the keyword. This
configuration option is not affected by the presence of the DECIMAL-POINT IS
COMMA clause in the source program, except for the default value. The value of
this keyword must be a single character-string or a number from 0 to 255. The
default value is “.” (46 or 0x2e), or, if the DECIMAL-POINT IS COMMA clause is
specified in the source program, the default is “,” (44 or 0x2c).
10. EDIT-DOLLAR. This keyword enables the currency sign ($) to be overridden with
the character corresponding to the value of the keyword. This configuration option is
not affected by the presence of the CURRENCY SIGN clause in the source program,
unless the program specifies CURRENCY SIGN IS “$”. In that case, the “$” in that
program is the currency symbol and the EDIT-DOLLAR keyword has no effect.
(See the EDIT-CURRENCY-SYMBOL keyword for overriding the currency symbol
value.) The value must be a single character-string or a number from 0 to 255. The
default value is “$” (36 or 0x24).
12. REVERSE. This keyword determines whether the runtime system should override
reverse video (REVERSE) coded in the ACCEPT and DISPLAY statements. If the
value is set to YES, reverse video is used as directed by the statements. If the value
is set to NO, reverse video is not used. The default value is YES.
15. UNDERLINE. This keyword determines whether the runtime system should
override underlining (UNDERLINE) coded in the Screen Section or the CONTROL
phrase of ACCEPT and DISPLAY statements. If the value is set to YES, underlining
is used as directed by the statements. If the value is set to NO, underlining is not
used. The default value is YES.
For complete descriptions of the ACCEPT and DISPLAY statements, see Chapter 6,
Procedure Division Statements, of the RM/COBOL Language Reference Manual.
RUN-FILES-ATTR Record
The RUN-FILES-ATTR record identifier is followed by one or more keywords. If the
keyword is allowed to have a value, it is followed by an equal sign (=) and the value.
Some of the following keywords are allowed on both the RUN-FILES-ATTR record and
on the RUN-INDEX-FILES, RUN-REL-FILES, and RUN-SEQ-FILES records. For
these keywords, specifying a value on a RUN-FILES-ATTR record is equivalent to
specifying the same value on RUN-INDEX-FILES, RUN-REL-FILES, and RUN-SEQ-
FILES records. If a keyword exists on both a RUN-FILES-ATTR and on a RUN-xxx-
FILES record, then the last one in the configuration file will be used. The possible
keywords are as follows:
10-26 Configuration
Configuration Records
maximum value is 664838. The minimum value is 1. A value of 1 will cause the
minimum disk buffer pool to be allocated. The default value is 20480 for the
compiler and 256000 for the runtime system.
4. DISABLE-COMMIT-FILE. This keyword can be used to prevent the use of the
DOS Commit File function. If the value is set to YES, then the Commit File function
will never be used. If the value is set to NO, and the Commit File function is
available, then it will be used to flush data to the disk. The default value is NO.
Note This keyword is supported only under Windows.
5. ENABLE-OLD-DOS-FILENAME-HANDLING. This keyword controls whether
filenames are processed in the way they were handled in earlier DOS runtimes. If
this keyword is set to YES, filenames are converted to uppercase, all spaces are
eliminated, and each node name (characters between separators) is truncated to 8.3
format. For example, the filename “c:\long directory.name\long filename.extension”
would become “C:\LONGDIRE.NAM\LONGFILE.EXT”. If this keyword is set to
NO, filenames remain in mixed case, spaces are allowed, and long node names are
allowed (that is, no truncation). The default value is NO.
10-28 Configuration
Configuration Records
description of the FILE-LOCK-LIMIT keyword, described earlier in this section, for
details on this relationship.) The value assigned to this keyword is specified in
gigabytes (GB). The maximum value is 1048576, which equates to 1 petabyte (250).
The minimum value is 1. The default value is 64.
For an explanation of how to indicate that a relative file or a sequential file will be
accessed as a large file, see the description of the USE-LARGE-FILE-LOCK-LIMIT
configuration keyword of the RUN-REL-FILES and RUN-SEQ-FILES records on
page 10-34. See the description of File Version Level 3 on page 8-65 and the
description of the DEFAULT-FILE-VERSION-NUMBER configuration keyword
of the RUN-INDEX-FILES record on page 10-31 for information on using the
LARGE-FILE-LOCK-LIMIT with indexed files.
14. RESOLVE-LEADING-NAME. This keyword controls when the first directory
name specified in a file access name is resolved from the environment. The first
directory name is defined as a name that is not preceded by a slash character. Under
Windows, the slashes that may appear in a volume name are ignored. If the name is
not found in the environment, no substitution will occur, and the name will remain as
specified (after the possible removal of the leading character). There are several
possible values for this keyword, including ALWAYS, NEVER, or one of these
seven leading characters: !, @, #, $, %, ^, or &.
If RESOLVE-LEADING-NAME is set to ALWAYS, and the directory name exists
in the environment, the value of the environment variable will replace the name. If
RESOLVE-LEADING-NAME is set to one of the seven leading characters, the
directory name begins with that character, and the directory name without that
character exists in the environment, then the value of that environment variable will
replace the name. If the value is set to NEVER, then the leading directory name will
never be replaced. The default value for this keyword is NEVER.
In the special case that the file access name does not contain any directory specifiers,
substitution will always be attempted.
For example, if the environment contains a variable name DIR with the value
MYDIR, and does not contain the variable D1, the following substitutions would
occur.
Name Specified RESOLVE-LEADING-NAME value
ALWAYS NEVER @
For example, if the environment contains a variable name DIR with the value
MYDIR, a variable name FILE with the value MYFILE, and does not contain the
variable D1, the following substitutions would occur.
If the record is locked using a different file descriptor in the same run unit, the error
is always returned immediately to prevent a deadlock situation.
10-30 Configuration
Configuration Records
RUN-INDEX-FILES Record
The RUN-INDEX-FILES record identifier is followed by one or more keywords. If the
keyword is allowed to have a value, it is followed by an equal sign (=) and the value. The
possible keywords are as follows:
If an indexed file has a block size greater than this value, then the RM/COBOL file
management system will not perform certain network optimizations. If this keyword
has a value of zero, the optimizations are disabled for all indexed files.
10. KEY-COMPRESSION. This keyword determines whether the indexed files created
by the runtime system use key compression. If the value is set to YES, key
compression is used. If the value is set to NO, keys are stored in uncompressed form.
The default value is YES.
10-32 Configuration
Configuration Records
RUN-OPTION Record
The RUN-OPTION record identifier is followed by one or more keywords. If the
keyword is allowed to have a value, it is followed by an equal sign (=) and the value. The
possible keywords are as follows:
1. B. This keyword controls the default ACCEPT and DISPLAY buffer size and is
represented as a decimal number. The maximum value is 65280. The minimum
value is 1. A default value specified with this keyword may be overridden by the
runtime B Option (see page 7-4).
3. K. This keyword controls the suppression of the banner notice and the STOP RUN
message. If the value is set to SUPPRESS, the banner notice and STOP RUN
message are suppressed. If the value is set to DISPLAY, the suppression of the
banner notice and the STOP RUN message is controlled by the runtime K Option
(see page 7-3). The default value is DISPLAY.
4. LOG-PATH. This keyword specifies the location (directory) where the log file (as
specified in the ENABLE-LOGGING keyword above) will be written. The directory
must already exist before the runtime is started, and the user must have create and
write permission for the directory. The runtime will create the log file, if necessary,
and the file will be opened in append mode.
RUN-REL-FILES Record
The RUN-REL-FILES record identifier is followed by one keyword. The keyword is
followed by an equal sign (=) and a value. The possible keyword is as follows:
RUN-SEQ-FILES Record
The RUN-SEQ-FILES record identifier is followed by one or more keywords. If the
keyword is allowed to have a value, it is followed by an equal sign (=) and the value. The
possible keywords are as follows:
10-34 Configuration
Configuration Records
the C include file <stdio.h>, or 4096, whichever is larger. Under Windows, the
default value is the disk sector size or 4096, whichever is larger.
This keyword applies to line sequential files written directly to a nontape device. It
also applies to line sequential files on disk that are not opened WITH LOCK or are
not blocked. The value required for this keyword is generally the maximum value
specified by any BEFORE/AFTER ADVANCING phrase in a WRITE statement in
the program, plus 2. This value is configurable for performance considerations only,
since it enables the record—along with the appropriate number of control
characters—to be written in one write request. If the value specified for this keyword
is less than the maximum specified by the BEFORE/AFTER ADVANCING phrase,
the operation will be performed correctly, but will require more than one write
request to complete the operation.
4. TAB-STOPS. This keyword determines an ascending sequence of tab stop columns
represented as decimal numbers separated by commas. Up to 18 tab stop columns
are allowed. TAB-STOPS=0 specifies that no tab stop columns exist. The default
TAB-STOPS sequence is 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60, 64,
68, 72.
5. USE-LARGE-FILE-LOCK-LIMIT. This keyword determines which value to use
for the limit when applying locks to a sequential file. If the value of this keyword is
set to NO, the value of the FILE-LOCK-LIMIT keyword of the RUN-FILES-ATTR
record is used. If the value is set to YES, the value of the LARGE-FILE-LOCK-
LIMIT configuration keyword is used. (For a description of these keywords in the
RUN-FILES-ATTR record, see page 10-26.) For record and file locks to perform
correctly, all run units opening a file must use the same file lock limit. The default
value is NO.
TERM-ATTR Record
The TERM-ATTR record provides information about terminal attributes. The
TERM-ATTR record identifier is followed by one or more keywords. If the keyword is
allowed to have a value, it is followed by an equal sign (=) and the value. The possible
keywords are as follows:
1. BCOLOR. This keyword indicates the initial background color value to use for
ACCEPT and DISPLAY statements. The terminal will be restored to this color when
the run unit ends. The default color value is BLACK.
Note Under Windows, the default background color is determined by the system
settings. In particular, the default background color is the default “window
background” color.
Note 2 The value of the inter-character timer also affects the BEFORE TIME
phrase of the ACCEPT statement (see page 8-21).
10-36 Configuration
Configuration Records
3. COLUMNS. This keyword determines the number of columns the runtime system
will display on the terminal screen, represented as a decimal number between 1 and
255. The default value is 80.
• Lead byte. If the value of this byte falls into the lead-byte range, a DBCS
character is indicated.
• Trail byte. This byte further refines the selected character. The trail byte can
have any value except zero (0), but is typically restricted to a subset of all
possible characters.
Double-byte character set characters occupy two, physically adjacent positions on the
screen and are usually displayed as a double-width character.
Double-byte character set characters, however, are not the same as “wide” characters.
In a wide-character set, such as Unicode, all characters are represented by two bytes,
which provides up to 65,536 characters. In DBCS, the value of the first byte
determines whether the second byte is considered part of the current character.
Values for this keyword are specified as a pair of numbers separated by a comma.
The syntax of this keyword is as follows:
TERM-ATTR DBCS-CHARACTERS=n1,n2
Restrictions
• Because a DBCS character cannot be entered in a field where there is only one
remaining character position, DBCS characters cannot be any of the following:
• If an ACCEPT field spans a window or screen row, RM/COBOL will permit the
entry of a DBCS character when the cursor is in the last column of the window
or screen. The cursor advances two character positions and the DBCS character
is saved but not displayed (two spaces are displayed instead). If characters are
inserted or deleted from the field such that the character no longer wraps across
rows, it becomes visible. If another DBCS character wraps as a result, it
becomes invisible. All entered characters will be returned to the RM/COBOL
program when the ACCEPT is terminated.
10-38 Configuration
Configuration Records
6. FCOLOR. This keyword indicates the initial foreground color value to use for
ACCEPT and DISPLAY statements. The terminal will be restored to this color when
the run unit ends. The default color value is WHITE.
Note Under Windows, the default foreground color is determined by the system
settings. In particular, the default foreground color will be the default “window text”
color. The default high-intensity foreground color is determined by the default
“selected text” color.
9. ROWS. This keyword determines the number of rows the runtime system will
display on the terminal screen, represented as a decimal number between 1 and 255.
The default value is 25.
12. USE-COLOR. Setting the value of this keyword to YES forces a COBOL program
to perform all DISPLAY and ACCEPT statements using either the default color
values or the color values specified in a CONTROL phrase. If the termcap or
terminfo database contains color support and the set_foreground and set_background
strings are present, these strings are used to process the request. Otherwise, the
RM/COBOL runtime system will generate the seven-bit SGR (Set Graphics
Rendition) sequences assigned by the International Standards Organization for color.
These sequences are defined as follows:
Control Sequence Parameter
Introducer Selection Terminator
Foreground ESC [ 3 [0-7] m
Background ESC [ 4 [0-7] m
The color values associated with the parameter values zero through seven are as
follows:
Parameter
Color Second Digit
BLACK 0
RED 1
GREEN 2
YELLOW 3
BLUE 4
MAGENTA 5
CYAN 6
WHITE 7
If the value of the USE-COLOR keyword is set to NO, color sequences will not be
used until the first ACCEPT or DISPLAY that requests to use color and only if there
is support for color in the termcap or terminfo database. NO is the default value.
10-40 Configuration
Configuration Records
If none of the color keywords is specified, color processing will be disabled until a
CONTROL phrase is encountered that specifies the use of a valid color. When a
CONTROL phrase is encountered, it is honored provided there is color support in the
termcap or terminfo database. When the run unit ends, the terminal will be restored
to the values specified in the FCOLOR and BCOLOR keywords in the TERM-ATTR
configuration record.
TERM-INPUT Record
The TERM-INPUT record associates field editing semantics, exception codes, or a single
data character with incoming character sequences. See page 8-2 for more information on
defining keys under your operating system.
The TERM-INPUT record identifier is followed by one or more optional keywords and
finally, by the character sequence specification. If the keyword is allowed to have a
value, it is followed by an equal sign (=) and the value. The keywords may appear in
any order, but must precede the character sequence specification (see pages 10-42
through 10-44). The possible keywords are as follows:
1. ACTION. This keyword specifies the field editing action or screen action to be
performed. The allowed values (described in detail under “Field Editing Actions”
beginning on page 10-45) are as follows:
BACKSPACE REPAINT-SCREEN
CONTROL-BREAK RESET-ANSI-INSERTION
DELETE-CHARACTER RIGHT-ARROW
ERASE-ENTIRE SCREEN-ESCAPE
ERASE-REMAINDER SCREEN-HOME
ESCAPE-TO-COMMAND SCREEN-PREVIOUS-FIELD
ESCAPE-TO-OS SCREEN-TERMINATE
FIELD-HOME SET-ANSI-INSERTION
INSERT-CHARACTER SET-RM-INSERTION
LEFT-ARROW TOGGLE-ANSI-INSERTION
2. CODE. This keyword specifies the numeric exception code value to be returned to
the program. The definition of an exception code identifies a key sequence that
terminates input. Key sequences without exception codes do not terminate field input
unless one of the screen actions is defined for that key sequence (as described in the
ACTION keyword).
10-42 Configuration
Configuration Records
Table 10-3 ASCII Equivalents
Character Character
ASCII Code Equivalent ASCII Code Equivalent
000 NUL 017 DC1
001 SOH 018 DC2
002 STX 019 DC3
003 ETX 020 DC4
004 EOT 021 NAK
005 ENQ 022 SYN
006 ACK 023 ETB
007 BEL 024 CAN
008 BS 025 EM
009 HT 026 SUB
010 LF 027 ESC
011 VT 028 FS
012 FF 029 GS
013 CR 030 RS
014 SO 031 US
015 SI 032 SP
016 DLE 127 DEL
Additional character equivalents, listed in Table 10-4, have been defined for the character
sequence specifications in Windows. If one of these character equivalents, other than
WSFT or WCNT, is used to specify an incoming character sequence, the specification
should begin with NUL. This is necessary to distinguish between the special Windows
character equivalents and normal ASCII characters.
Note Alt-key sequences are not available under RM/COBOL for Windows because the
underlying Windows-based environment traps the Alt-key sequences. Alt-key sequences
are entered as Ctrl-Shift-key combination sequences. For example, use Ctrl-Shift-I
instead of Alt-I.
Incoming character sequences are specified by the corresponding attribute name. For
example, assume you have a keyboard with a Next page key (knp in the terminfo
database, and kN in the termcap database) and you want that to cause the ON
EXCEPTION branch of your ACCEPT statement to be taken with the decimal value 80
stored in the EXCEPTION variable. This could be described in the following ways:
For terminfo:
For termcap:
For Windows:
10-44 Configuration
Configuration Records
Field Editing Actions
RM/COBOL ACCEPT statements define fields on the terminal in which the operator may
enter data. Depending on the phrases specified in the ACCEPT statement and the setting
of the ACCEPT-FIELD-FROM-SCREEN keyword of the RUN-ATTR configuration
record (see page 10-23), the initial contents of the screen field may be empty (all spaces),
filled with characters from the screen, filled with prompt characters or filled with the
current value of the associated ACCEPT operand. The operator may then modify the
displayed contents of the screen field; all positions of that screen field may continue to be
modified until a field termination key is entered. This modification of the displayed data
is called field editing.
Data entry is processed in either insertion mode or replacement mode. In insertion mode,
incoming text characters are inserted at the current cursor position, and following
characters are moved to the right in the field. In replacement mode, incoming text
characters replace the characters at the current cursor position. The RM/COBOL terminal
model defines three types of insertion mode:
1. Single-character insertion mode reverts to replacement mode after one text character
is inserted.
2. RM insertion mode reverts to replacement mode when data entry in the field is
terminated or when a field editing key is entered.
3. ANSI insertion mode remains active across ACCEPT operations until reset by the
operator to RM insertion mode or replacement mode.
The RM/COBOL terminal interface provides the following field editing facilities that may
be made available to the operator. These facilities can be specified with the ACTION
keyword of the TERM-INPUT configuration record (see page 10-41).
8. FIELD-HOME. The FIELD-HOME value moves the cursor to the leftmost position
of the screen field.
10. LEFT-ARROW. The LEFT-ARROW value moves the cursor left one position in
the screen field. If entered in the leftmost position of the screen field, this value is
treated as a field termination key or as an illegal keystroke, depending on whether an
exception code has been assigned to the key sequence.
10-46 Configuration
Configuration Records
13. RIGHT-ARROW. The RIGHT-ARROW value moves the cursor right one position
in the screen field. The key sequence is illegal if the character at the current
character position is a prompt character. If entered in the rightmost screen field
position, the key sequence is treated as a field termination key or as an illegal
keystroke, depending on whether an exception code has been assigned to the key
sequence.
15. SCREEN-HOME. The SCREEN-HOME value moves the cursor to the first input
field defined in the Screen Section for the current screen. The current field is
checked for errors. No semantic action is taken for ACCEPT identifier statements.
RM insertion mode is reset when any field editing key sequence is entered or when
the field input is terminated.
If a key sequence assigned to an exception code has also been assigned to any of the field
editing facilities (excluding BACKSPACE, LEFT-ARROW, and RIGHT-ARROW), the
editing action is performed and field editing will terminate.
10-48 Configuration
Configuration Records
TERM-INTERFACE Record
The terminal configuration records have different formats, depending on the type of
terminal interface the runtime system uses: termcap, terminfo, or graphical user interface
(GUI). The TERM-INTERFACE record describes the format of records in this
configuration file. The runtime system will use this information to correctly process the
records and to ensure that it is the correct version of the runtime system (termcap,
terminfo, or GUI) to be using the information.
The TERM-INTERFACE record must precede all other terminal interface configuration
records except TERM-UNIT.
The TERM-INTERFACE record identifier is followed by one keyword that describes the
format. The possible keywords are as follows:
1. GUI. This value must be specified for use with RM/COBOL for Windows. It
indicates that the terminal interface is a graphical user interface (GUI).
TERM-UNIT Record
The TERM-UNIT record is used to associate RM/COBOL units to stations (devices).
The TERM-UNIT record identifier is followed by one or more keywords. If the keyword
is allowed to have a value, it is followed by an equal sign (=) and the value.
The TERM-UNIT record must contain the PATH keyword if the UNIT keyword does not
specify the default unit. The possible keywords are as follows:
1. BPS. This keyword specifies the Bits Per Second to which the communication port
should be initialized when the unit is first accessed by the RM/COBOL program.
The default for this keyword is the value to which the operating system has set the
port. The valid values for this keyword are 50, 75, 110, 134.5, 150, 200, 300, 600,
1200, 1800, 2400, 4800, 9600, EXT-A and EXT-B (for external A and external B).
If the MOVE-ATTR keyword has the value NO, it specifies that the attribute
characters are placed at the line and position requested by the RM/COBOL program
and the actual start of the field is moved to the right, accordingly.
If the MOVE-ATTR keyword has the value YES, it specifies that the field should be
placed in the line and position requested and the attributes moved to the left. The
only time this will not be done is when the termcap capability database indicates that
the attributes set by the attribute characters will not cross a line boundary or if the
field starts in line 1, position 1 and the database does not indicate that the attribute
will wrap from the bottom to the top of the screen.
5. PARITY. This keyword specifies the parity to which the communication port should
be initialized when the unit is first accessed by the RM/COBOL program. The
default for this keyword is the value to which the operating system has set the port.
The valid values of this keyword are: EVEN, ODD and NONE.
6. PATH. This keyword specifies the device pathname that will be used for this unit.
This must be a tty port that currently has no other processes attached to it and has
read and write privileges for the user who starts the run unit. This is a required field
if the unit being described is not the default unit. If the unit being described is the
default unit, this keyword must not be present.
10-50 Configuration
Configuration Records
7. STOP-BITS. This keyword specifies the number of stop bits that the
communication port should send following transmitted characters. The default for
this keyword is the value to which the operating system has set the port. The valid
values of this keyword are 1 and 2.
8. TYPE. This keyword specifies the terminal type connected to the port. This is the
name that is used when searching the termcap or terminfo database. The default
value for this keyword is the value of the TERM environment variable.
9. UNIT. This keyword specifies the RM/COBOL unit number being described and is
either a decimal number between 0 and 255 or the value DEFAULT-UNIT. If the
value is DEFAULT-UNIT, this TERM-UNIT record describes the unit that is used
when no UNIT clause appears on the ACCEPT or DISPLAY statement. If it is a
number, this TERM-UNIT record describes a particular UNIT number that will be
used in an RM/COBOL ACCEPT or DISPLAY statement. The default for this
keyword is DEFAULT-UNIT.
Termcap Example
The following records define the default configuration as provided by Liant on systems
that use termcap.
RUN-ATTR accept-intensity=high beep=yes blink=yes
&display-intensity=high reverse=yes
RUN-ATTR error-message-destination=standard-error
RUN-OPTION b=264 k=display m=1
RUN-INDEX-FILES allocation-increment=8
RUN-INDEX-FILES data-compression=yes force-closed=no force-data=no
&force-disk=no
RUN-INDEX-FILES force-index=no key-compression=yes
RUN-SEQ-FILES default-type=binary
RUN-SEQ-FILES device-slewing-reserve=255
RUN-SEQ-FILES tab-stops=8,12,16,20,24,28,32,36,40,44,48,52,
&56,60,64,68,72
RUN-SORT intermediate-files=5 memory-size=16000
TERM-UNIT move-attr=no define-control-characters=yes
TERM-INTERFACE TERMCAP
TERM-INPUT action=left-arrow kl
10-52 Configuration
Default Configuration Files
TERM-INPUT code=43 FX
TERM-INPUT code=44 FY
TERM-INPUT code=45 FZ
TERM-INPUT code=46 Fa
TERM-INPUT code=47 Fb
TERM-INPUT code=48 Fc
TERM-INPUT code=49 Fd
TERM-INPUT code=50 Fe
TERM-INPUT code=51 Ff
TERM-INPUT code=52 Fg
TERM-INPUT code=53 Fh
TERM-INPUT code=54 Fi
TERM-INPUT code=55 Fj
TERM-INPUT code=56 Fk
TERM-INPUT code=57 Fl
TERM-INPUT code=58 Fm
TERM-INPUT code=59 Fn
TERM-INPUT code=60 Fo
TERM-INPUT code=61 Fp
TERM-INPUT code=62 Fq
TERM-INPUT code=63 Fr
TERM-INPUT code=13 exception=no cr
TERM-INPUT code=40 k0
TERM-INPUT code=41 K3
TERM-INPUT code=49 l0
TERM-INPUT action=screen-previous-field code=52 ku
TERM-INPUT code=53 kd
TERM-INPUT action=screen-home code=54 kh
TERM-INPUT code=55 nw
TERM-INPUT code=56 K4
TERM-INPUT action=erase-remainder code=57 kE
TERM-INPUT code=58 K5
TERM-INPUT code=59 kA
TERM-INPUT code=61 kL
TERM-INPUT code=64 K2
TERM-INPUT code=67 kP
TERM-INPUT code=68 kN
TERM-INPUT code=82 K1
TERM-INPUT code=83 precedence=1 %1
TERM-INPUT code=84 %0
PRINT-ATTR auto-line-feed=no
PRINT-ATTR form-feed-available=yes top-of-form-at-close=no
DEFINE-DEVICE device=PRINTER path="lp -s" pipe=yes
DEFINE-DEVICE device=TAPE path=/dev/rtp pipe=no
10-54 Configuration
Default Configuration Files
TERM-INPUT code=22 kf22
TERM-INPUT code=23 kf23
TERM-INPUT code=24 kf24
TERM-INPUT code=25 kf25
TERM-INPUT code=26 kf26
TERM-INPUT code=27 kf27
TERM-INPUT code=28 kf28
TERM-INPUT code=29 kf29
TERM-INPUT code=30 kf30
TERM-INPUT code=31 kf31
TERM-INPUT code=32 kf32
TERM-INPUT code=33 kf33
TERM-INPUT code=34 kf34
TERM-INPUT code=35 kf35
TERM-INPUT code=36 kf36
TERM-INPUT code=37 kf37
TERM-INPUT code=38 kf38
TERM-INPUT code=39 kf39
TERM-INPUT code=40 kf40
TERM-INPUT code=41 kf41
TERM-INPUT code=42 kf42
TERM-INPUT code=43 kf43
TERM-INPUT code=44 kf44
TERM-INPUT code=45 kf45
TERM-INPUT code=46 kf46
TERM-INPUT code=47 kf47
TERM-INPUT code=48 kf48
TERM-INPUT code=49 kf49
TERM-INPUT code=50 kf50
TERM-INPUT code=51 kf51
TERM-INPUT code=52 kf52
TERM-INPUT code=53 kf53
TERM-INPUT code=54 kf54
TERM-INPUT code=55 kf55
TERM-INPUT code=56 kf56
TERM-INPUT code=57 kf57
TERM-INPUT code=58 kf58
TERM-INPUT code=59 kf59
TERM-INPUT code=60 kf60
TERM-INPUT code=61 kf61
TERM-INPUT code=62 kf62
TERM-INPUT code=63 kf63
TERM-INPUT code=13 exception=no cr
TERM-INPUT code=40 kf0
TERM-INPUT code=41 ka3
TERM-INPUT code=49 lf0
TERM-INPUT action=screen-previous-field code=52 kcuu1
10-56 Configuration
Default Configuration Files
Windows Example
The following records define the default configuration provided by Liant for the Windows
operating system.
RUN-ATTR accept-intensity=high beep=yes blink=yes
&display-intensity=high reverse=yes
RUN-ATTR error-message-destination=standard-error
RUN-OPTION b=264 k=display m=1
RUN-INDEX-FILES allocation-increment=8
RUN-INDEX-FILES data-compression=yes force-closed=no force-data=no
&force-disk=no
RUN-INDEX-FILES force-index=no key-compression=yes
RUN-SEQ-FILES default-type=binary
RUN-SEQ-FILES device-slewing-reserve=255
RUN-SEQ-FILES tab-stops=8,12,16,20,24,28,32,36,40,44,48,52,
&56,60,64,68,72
RUN-SORT intermediate-files=5 memory-size=16000
PRINT-ATTR auto-line-feed=no
PRINT-ATTR form-feed-available=yes top-of-form-at-close=no
TERM-INTERFACE GUI
TERM-ATTR Data-Characters=32,126
TERM-INPUT Code=1 SOH
TERM-INPUT Code=2 STX
TERM-INPUT Action=Control-Break ETX
TERM-INPUT Code=4 EOT
TERM-INPUT Code=5 ENQ
TERM-INPUT Code=6 ACK
TERM-INPUT Code=7 BEL
TERM-INPUT Action=Backspace BS
TERM-INPUT Code=9 HT
TERM-INPUT Code=10 LF
TERM-INPUT Code=11 VT
TERM-INPUT Code=12 FF
TERM-INPUT Code=13 Exception=No CR
TERM-INPUT Code=14 SO
TERM-INPUT Code=15 SI
TERM-INPUT Code=16 DLE
TERM-INPUT Code=17 DC1
TERM-INPUT Code=18 DC2
TERM-INPUT Code=19 DC3
TERM-INPUT Code=20 DC4
TERM-INPUT Code=21 NAK
TERM-INPUT Code=22 SYN
TERM-INPUT Code=23 ETB
TERM-INPUT Code=24 CAN
TERM-INPUT Code=25 EM
10-58 Configuration
Default Configuration Files
TERM-INPUT Code=16 NUL WSFT WF6
TERM-INPUT Code=17 NUL WSFT WF7
TERM-INPUT Code=18 NUL WSFT WF8
TERM-INPUT Code=19 NUL WSFT WF9
TERM-INPUT Code=20 NUL WSFT WF10
TERM-INPUT Code=21 NUL WCNT WF1
TERM-INPUT Code=22 NUL WCNT WF2
TERM-INPUT Code=23 NUL WCNT WF3
TERM-INPUT Code=24 NUL WCNT WF4
TERM-INPUT Code=25 NUL WCNT WF5
TERM-INPUT Code=26 NUL WCNT WF6
TERM-INPUT Code=27 NUL WCNT WF7
TERM-INPUT Code=28 NUL WCNT WF8
TERM-INPUT Code=29 NUL WCNT WF9
TERM-INPUT Code=30 NUL WCNT WF10
TERM-INPUT Code=31 NUL WSFT WCNT WF1
TERM-INPUT Code=32 NUL WSFT WCNT WF2
TERM-INPUT Code=33 NUL WSFT WCNT WF3
TERM-INPUT Code=34 NUL WSFT WCNT WF4
TERM-INPUT Code=35 NUL WSFT WCNT WF5
TERM-INPUT Code=36 NUL WSFT WCNT WF6
TERM-INPUT Code=37 NUL WSFT WCNT WF7
TERM-INPUT Code=38 NUL WSFT WCNT WF8
TERM-INPUT Code=39 NUL WSFT WCNT WF9
TERM-INPUT Code=40 NUL WSFT WCNT WF10
TERM-INPUT Code=65 NUL WCNT WLFT
TERM-INPUT Code=66 NUL WCNT WRGT
TERM-INPUT Code=83 NUL WCNT WEND
TERM-INPUT Code=70 NUL WCNT WPGD
TERM-INPUT Code=81 NUL WCNT WHOM
TERM-INPUT Code=71 WSFT WCNT 49
TERM-INPUT Code=72 WSFT WCNT 50
TERM-INPUT Code=73 WSFT WCNT 51
TERM-INPUT Code=74 WSFT WCNT 52
TERM-INPUT Code=75 WSFT WCNT 53
TERM-INPUT Code=76 WSFT WCNT 54
TERM-INPUT Code=77 WSFT WCNT 55
TERM-INPUT Code=78 WSFT WCNT 56
TERM-INPUT Code=79 WSFT WCNT 57
TERM-INPUT Code=80 WSFT WCNT 48
TERM-INPUT Code=85 WSFT WCNT -
TERM-INPUT Code=87 WSFT WCNT =
TERM-INPUT Code=69 NUL WCNT WPGU
TERM-INPUT Code=11 NUL WF11
TERM-INPUT Code=12 NUL WF12
The data gathered by Instrumentation and reported by analysis can be used during
program development to optimize program flow, identify bugs caused by run-away loop
control, and improve program integrity by pinpointing unexecuted program code.
Invoking Instrumentation
Instrumentation is invoked when you enter the I Runtime Command Option (see
page 7-3). If you intend to use analysis as well, all programs in the run unit should be
compiled with the L Compile Command Option (see page 6-9).
Keep in mind that the runtime system needs additional memory when the I Runtime
Command Option is used. Furthermore, each program in the run unit requires additional
memory as it is loaded by the Runtime Command or by a CALL statement (see the
“CALL Statement” section in Chapter 6, Procedure Division Statements, of the
RM/COBOL Language Reference Manual). The exact amount of required memory
depends on the number of lines in the PROCEDURE DIVISION, as described in the
next section.
• PROGRAM-ID value
z 01 PROGRAM-IDENTIFICATION.
02 PROGRAM-ID-VALUE PIC X(30). z
02 PROCEDURE-DIVISION-LINE PIC 9(8) BINARY.
O 02 SOURCE-LINE-COUNT PIC 9(8) BINARY. O
z 02 TOTAL-STATEMENTS-EXECUTED
02 TOTAL-STATEMENTS-PITCHED
PIC 9(8) BINARY.
PIC 9(8) BINARY. z
02 PIC X(14).
O 02 OCCURS 1 TO 65000 O
z DEPENDING ON number of procedure lines.
03 OCCURS 2. z
04 STATEMENT-TYPE PIC X(1).
O 88 NO-STATEMENT-OR-NOT-EXECUTED O
z 88 SECTION-COUNT
VALUE LOW-VALUE.
VALUE 'X'. z
88 PARAGRAPH-COUNT VALUE 'P'.
O 88 STATEMENT-COUNT VALUE 'S'. O
z 04 COUNT-VALUE PIC 9(9) BINARY.
z
The size of the required structure may be calculated as follows:
n = source-line-count - procedure-division-line + 1
size (in bytes) = 60 + (n * 10)
The data structure for a program is allocated when the first statement in that program is
executed. The data structure remains allocated even when the associated program is
canceled.
11-2 Instrumentation
Data Collection
numbers. Likewise, programs within the run unit that were compiled with the
Q Compile Command Option are invisible to Instrumentation. No information will be
gathered nor file created for such programs.
The runtime directory search sequence (described on page 2-4 for UNIX and page 3-11
for Windows) is used when writing these files. An existing file within the directories
named in the RUNPATH specification will be replaced by a data collection file with the
same name. If no file with the same name exists, a new data collection file will be
created.
Instrumentation either replaces or creates new data collection files for each invocation of
a run unit. Historical information is not maintained from run unit to run unit. This is a
function of the analysis program, which processes the data collection files after each run
unit.
Instrumentation writes messages to the screen as each data collection file is written. The
form of the message when no errors occur is the following:
name is derived from the first eight characters of the PROGRAM-ID, as described
above. Should an error occur during the opening, writing or closing of the file, an
error message (see Appendix A, Runtime Messages) appears after the name of the
operation encountering the error. If Opening receives an error, Writing and Closing
are not attempted and will not be included in the message.
• Statement count data from the .CNT file is added to the statement count data
gathered from earlier invocations of Instrumentation. This keeps a total count of the
statements executed.
• Statement count data from the total count file is merged with the listing file, creating
a new listing file showing execution counts for each statement.
• A summary of execution counts for each paragraph and section is appended to the
new listing file.
To use analysis as delivered, first compile the program with the RM/COBOL Compile
Command:
rmcobol analysis A L X
This creates a source listing, allocation map, and cross reference on a listing file named
analysis.lst in the directory containing analysis.cbl. An RM/COBOL object file,
analysis.cob, is also created in that directory. See Chapter 6, Compiling, for more
information about the compilation options and parameters.
Next, execute the analysis program by entering the RM/COBOL Runtime Command:
The optional A=‘path’ may be used to supply a pathname of the directory where the
merged listing files created by analysis are to reside. If this parameter is omitted, the
RUNPATH specification is used. See Chapter 7, Running, for more information about
the Runtime Command options and parameters.
11-4 Instrumentation
Data Analysis
The analysis program is listing-file driven, that is, the filenames of one or more listing
files are supplied by the user. These listing files are then processed by analysis, one at a
time, as follows:
1. The merged listing file is opened using the same filename as the listing file, with the
extension .HST.
3. The program name found in the PROGRAM-ID paragraph is used to construct the
filename of the .CNT file.
5. The program name used in the PROGRAM-ID paragraph is used to construct the
filename of the total count (.TOT) file.
7. The .TOT file is updated (or created if it does not exist) by adding the statement
counts from the .CNT file to the corresponding statement counts in the .TOT file.
8. The source listing section is reformatted merging the statement counts from the .CNT
or .TOT file with the source listing.
10. All listing file information between the end of one program and the beginning of
another in the file or end of file is copied to the merged file.
11. If another program exists in the listing file, this process is repeated starting at
Step 2.
12. If the name of another listing file is supplied by the user, this process is repeated
starting at Step 1.
When prompted to supply a listing filename, enter only the filename portion of the name;
the .lst extension is supplied automatically. To indicate there are no more listing files,
press Enter without typing a name. Use redirected input on the Runtime Command to
automate the entry of filenames where repeated runs are desired.
If the line was not referenced or executed, Count1 and Count2 will be blank. This
indicates that the line did not contain a verb, or that it is code that was never executed.
11-6 Instrumentation
Data Analysis
Some parts of the merged listing file may be suppressed with the S Runtime Command
Option. In this case, the Runtime Command would be:
produces a merge listing file with only paragraph and section execution counts
and some summary information from the .CNT file but updates historical data for
all statements.
A Traceback message traces back through one or more calling programs when an error
occurs within a called subprogram. The traceback traces the path from the statement
causing the error through all programs currently active in the run unit.
An Internal Error message indicates that an inconsistency not normally caused by a flaw
in the source program has been detected. The numbers within the error message are
needed by Liant technical support services should an internal error occur.
code is the first two digits of the error numbers listed in this appendix.
number identifies a particular line in the Procedure Division of the source program.
It is the line in which the statement being referred to starts, and it can be looked up in
the leftmost column (labeled “Line”) of the source listing produced by the compiler.
If a question mark appears in this position, the following prog-id field refers to a
machine language subprogram, or indicates that a valid line number has not been
established following an Interactive Debug R (Resume) Command (see page 9-34).
If the program has been compiled with the Q Compile Command Option, line
numbers are not available. Instead, the statement address, which appears under the
“Debug” heading in the listing, will appear. The statement address consists of a
segment number and a segment offset and can be distinguished from a line number
since the segment offset is always displayed as a six-digit number (with leading
zeros, if necessary). The segment number is not displayed if it is zero. If a segment
number is present, it precedes the segment offset and the two are separated by a slash
(/) character.
Note The statement address in the error message may not match exactly any of the
statement addresses in the program listing. If the statement address in the error
message does match a statement address in the program listing, the error condition
may have been caused by the statement whose address is just prior to the error
address.
prog-id identifies the program interrupted in order to produce this message. It has
the following format:
program-name (pathname.ext)
pathname.ext is the fully qualified pathname of the object library in which the
object program resides.
Number Description
2. The Procedure Division header in the first (or main) program in the
run unit specifies more than one data item (see the discussion of the
A Runtime Command Option that begins on page 7-5 for more
details). This is just a special case of reason 1 since the main
program is called with only one argument.
Note This error does not occur if the Linkage Section data item
is referenced in the ADDRESS OF special register or in an
ADDRESS OF phrase in a SET statement. Thus, this error can
be prevented by first testing if ADDRESS OF identifier-1
NOT = NULL before attempting to reference identifier-1 directly.
102 A reference to a variable length group is illegal because the value in the
DEPENDING data item (data-name-1) is less than the minimum value
(integer-1) or greater than the maximum value (integer-2) in the
OCCURS clause.
104 A reference to a data item is illegal for one of the following reasons:
104 (Cont.) the pointer data item. In this case, the error occurs not when the
Format 6 SET statement is executed, but when the resultant pointer
value is used as the base address of a based linkage record.
108 The referenced Linkage Section data item (which is other than one
associated with an argument listed in the USING or GIVING phrases of
the Procedure Division header), has a null base address because of one
of the following reasons:
1. The base address has never been set during this run unit.
Note This error does not occur if the Linkage Section data item
is referenced in the ADDRESS OF special register or in an
ADDRESS OF phrase in a SET statement. Thus, this error can
be prevented by first testing if ADDRESS OF identifier-1
NOT = NULL before attempting to reference identifier-1 directly.
110 A reference to a data item is illegal because the base address for the
data item has been set to a pointer value, other than NULL, that does
not point to memory that the program may access. This error occurs
when the based linkage item is referenced after, but not at, the time the
bad base address is established in a Format 6 SET statement.
Number Description
Under Windows, if the CALL statement specified a DLL file that does
not contain a nonresident ordinal one entry point, this error occurs.
If the CALL statement specified the ON EXCEPTION or ON
OVERFLOW phrase, this procedure error is suppressed and execution
continues with the imperative statement in the ON EXCEPTION or ON
OVERFLOW phrase.
205 A CALL statement has attempted to call a program that is still active.
An active program is one that has called, directly or indirectly, the
program attempting the call in error.
206 The called filename is not a valid RM/COBOL object file. The file
may be corrupt or contain information that makes it invalid for this run
unit. A corrupt file could be caused by a system failure or abnormal
termination of the RM/COBOL compiler. The file also could be invalid
for this run unit if the registration information is not correct or if the
object was compiled with features that make it incompatible with the
calling program (for example, the computational versions may not
match).
207 There is not enough memory to load the program from the Runtime
Command or the CALL statement, or to build the in-memory library
structures indicated in the Runtime Command, or to reserve memory for
the ACCEPT and DISPLAY buffers. This may be caused by memory
fragmentation resulting from the dynamics of CALL and CANCEL
operations and file I/O, or it may mean the requested program is too
large for the available memory. More memory can be made available
during a SORT statement by using the T Runtime Command Option to
reduce the memory requested by sort. Additional memory can be made
available by reducing the amount of buffer pool memory through the
use of the BUFFER-POOL-SIZE keyword on the RUN-FILES-ATTR
configuration record (see page 10-26). See page 6-29 for details on
memory size requirements for object programs.
212 The USE procedure cannot exit because it was invoked by the
execution of a SORT or MERGE statement and the sort-merge
operation is either no longer active or the exit location has been lost.
213 The RM/COBOL object library file specified in the Runtime Command
cannot be found.
214 The RM/COBOL object library file specified in the Runtime Command
does not contain a valid object program.
216 An external item with the same name and type (data record, file
connector or index name) as an existing external in the run unit has a
different description than the existing external.
For an index-name, the span of the table item associated with the index
name is different, or the index-name is associated with a different
external record.
216 (Cont.) For a file connector, any of the file control clauses, file description
clauses or record description lengths are different. For a relative
organization external file connector, this error is caused if the new
external does not reference the same external data item for the relative
key as is referenced by the existing external file connector.
218 There is not enough memory to allocate the data structures necessary to
support an external item declared in the program currently being
loaded.
219 There is not enough memory to allocate the data structures necessary to
support entry into a USE GLOBAL procedure following the occurrence
of an I/O error for which the USE GLOBAL procedure is applicable.
The program is terminated as if no applicable USE procedure were
found.
222 Under Windows, the SYSTEM routine was called but the command
processor required by SYSTEM could not be loaded for some
unexpected reason, such as, bad environment, access denied, too many
open files, or bad format for the command processor. If the command
processor could not be found, error 204 would occur instead of this
error. If there was insufficient memory, procedure error 207 would
occur instead of this error. If the operating system fails to load the
command processor for any other reasons, then this error occurs.
223 Under Windows, an error occurred while loading a DLL file. If the
DLL file could not be found, error 204 would occur instead of this
error. If there was insufficient memory, procedure error 207 would
occur instead of this error. If the operating system fails to load the DLL
for any other reasons, then this error occurs. This error generally
indicates that the DLL was found, but has an invalid format for the
operating system being used. Some “system out of memory” conditions
may cause an error 223, since Windows returns an ambiguous error
status in some low memory situations.
251 Under UNIX, a syntax error was detected while scanning the termcap
entry for a terminal type.
252 Under UNIX, the terminal type name specified by the TERM
environment variable or by the termcap entry tc cannot be located.
254 Under UNIX, two termcap or terminfo entries have identical input
sequences for this terminal. Use the PRECEDENCE= keyword to
indicate that one entry takes precedence over another (see page 10-42).
255 Under UNIX, the terminal described in the termcap or terminfo entry
has no cursor positioning sequence, or the rows or columns for the
terminal are zero.
Input/Output Errors
Input/output errors include all errors that can occur during file access. The format is as
follows:
The numerically ordered list presented below shows the values that can appear as number
in the I/O error messages, and a description of each error. The list is presented in
numerical order. The I/O error number has the form:
mm, nn
mm is a two-digit decimal number indicating the general class of error that occurred.
It is also the value stored into the file status data item if such an item has been
specified for the associated file. Thus, this value is available to the program.
nn is a two-digit code that provides more specific information on the nature of the
error. This value is available to the program only if you call the subprogram
C$RERR (described in the discussion that begins on page F-22).
When the I/O error is 30, the I/O error number has the form:
OS is the operating system that generated the error and indicates how the nnnnn code
should be interpreted.
The phrase “1985 mode” indicates that the error message description applies only to
ANSI COBOL 1985. The phrase “1974 mode” indicates that the error message
description applies only to ANSI COBOL 1974. Messages not marked with either phrase
indicate that the description applies to both ANSI COBOL 1985 and 1974.
Number Description
02 The operation was successful but a duplicate key was detected. For a
READ statement, the key value for the current key of reference is equal
to the value of that same key in the next logical record within the
current key of reference. For a REWRITE or WRITE statement, the
record just written created a duplicate key value for at least one
alternate record key for which duplicates are allowed.
04, 05 The record read from the file is shorter than the minimum record length.
(1985 mode)
04, 06 The record read from the file is longer than the record area.
(1985 mode)
05 The operation was successful but the file was not present at the time the
statement began. For a DELETE FILE statement, the file was not
found. For an OPEN statement, the optional file was not found. If the
open mode is I-O or EXTEND, the file has been created. (1985 mode)
14 A sequential READ statement was attempted for a relative file and the
number of significant digits in the relative record number is larger than
the size of the relative key data item. (1985 mode)
22 The new record value attempts to duplicate an indexed file key which
prohibits duplicates, or a relative record number that already exists.
23 An attempt was made to randomly access a record that does not exist in
the file, or a START or random READ statement was attempted on an
optional input file that is not present.
24, 01 A sequential WRITE statement was attempted for a relative file and the
number of significant digits in the relative record number is larger than
the size of the relative key data item, or the relative record number is
zero. (1985 mode)
24, 02 There is insufficient room left in the file for the operation. See the
description of the FILE-LOCK-LIMIT and FILE-PROCESS-COUNT
keywords of the RUN-FILES-ATTR configuration record on
page 10-28 for more details.
This error may occur on UNIX systems if the file's size exceeds the
user's ulimit.
24, 04 An attempt was made to add a record to a shared relative file that is so
far beyond the current EOF that the entire intervening region exceeds
the maximum size of a file region lock.
30, 25 This permanent error may be returned for Btrieve files. It indicates that
an error occurred during the creation of the file. It may also mean that
the file was already opened during the creation. If the file did not exist
at the time the RM/COBOL-to-Btrieve Adapter program checked for
the existence of the file but did exist at the time of the attempt to create
it, then the Adapter program will misinterpret the error as an I/O error
and return the permanent error code.
30, 58 The Btrieve compression size is too small. Use the appropriate Btrieve
Setup utility to increase the size for the Largest Compressed Record
Size setting (see the appropriate Btrieve installation and operation
manual for more details). The Btrieve MicroKernel Database Engine
(MKDE) must be restarted before the increase will take effect.
30, 64 End of file occurred when ACCEPTing from a redirected input file.
30, 97 The Btrieve requester’s data message length is too small. Reconfigure
the requester and specify a higher value. Be certain also to ensure that
the maximum record length (Communication Buffer Size), configured
on server-based Btrieve, is at least as large as the requester’s value (see
the appropriate Btrieve installation and operation manual for more
details).
35 The file is not available because the file identified by the resultant file
access name could not be found. The pathname or filename may be
misspelled or may not be valid for the operating system. Specifying a
pathname or filename that is not a valid name or that is longer than
allowed also results in this error. The directory search sequence
specified by RUNPATH may be incorrect. See the “Locating
RM/COBOL Files” sections either on pages 2-3 through 2-7 for UNIX
or pages 3-10 through 3-15 for Windows for information on the
resultant file access name. (1985 mode)
37, 01 The file must be mass storage. The device-name specified for the file
was DISC, DISK or RANDOM, but the resultant file access name
identifies a file that does not reside on a disk. (1985 mode)
37, 07 The requested operation conflicts with the permissions allowed to the
run unit for the file. This error can occur under any of the following
conditions: a DELETE FILE statement failed because the run unit did
not have write permission for the directory containing the file; an
OPEN statement with the OUTPUT or EXTEND phrase failed because
the run unit does not have write permission for the file; an OPEN
statement with the INPUT phrase failed because the run unit does not
have read permission for the file; or, an OPEN statement with the I-O
phrase failed because the run unit does not have read and write
permissions for the file. (1985 mode)
39, 01 The file organization specified for the filename does not match the
actual file organization of the physical file. (1985 mode)
This message may not occur if the file is actually a Btrieve file. The
Btrieve MicroKernel Database Engine (MKDE) always opens its files
with lock, and the OPEN WITH LOCK error condition is encountered
by the RM/COBOL file management system, preventing it from
determining the organization of the file.
For Btrieve files, if the minimum record length of the file is less than
four bytes, the file will be implemented using four-byte records. In this
situation, the RM/COBOL-to-Btrieve Adapter program cannot detect
the initial minimum record length and will fail to diagnose the
mismatched minimum record length error condition.
This error can occur when reopening a print file closed WITH NO
REWIND if the OPEN statement specifies a different record length
than was used on the previous OPEN statement.
This error does not occur with variable-length record Btrieve files.
Btrieve files do not support a mechanism to record this information and,
thus, it cannot be verified.
39, 04 The minimum block length specified in the BLOCK CONTAINS clause
for the filename does not match the actual minimum block size of the
physical file. (1985 mode)
This error does not occur with variable-length record Btrieve files.
Btrieve files do not support a mechanism to record this information and,
thus, it cannot be verified.
39, 07 The CODE-SET specified for the filename does not match the actual
character code of the physical file. (1985 mode)
39, 08 The COLLATING SEQUENCE specified for the indexed file does not
match the actual collating sequence of the physical file. (1985 mode)
39, 09 The record type attribute, fixed or variable, specified in the RECORD
CONTAINS clause or implied by the record descriptions of the
filename does not match the record type attribute of the physical file.
(1985 mode)
39, 0A The character specified in the PADDING CHARACTER clause for the
filename does not match the actual padding character of the file on the
external medium. (1985 mode)
39, 30 The key duplicates allowed flag specified for keys 0 through 14 does
through not match the corresponding key duplicates allowed flag of the physical
39, 3E file. The prime record key is 0. Alternate record keys are numbered in
ascending order of key offset, starting with 1. (1985 mode)
For Btrieve files, this error also indicates that in the physical file, a key
attribute other than duplicate, modifiable, binary, null, alternate
collating sequence, or extended type was specified for the Btrieve key
that corresponds with the COBOL key defined for the key offset. (For
example, descending, supplemental, and manual key attributes may not
be used for RM/COBOL keys.) In addition, the primary key may not
have a null attribute.
39, 3F The key duplicates allowed flag specified for an alternate record key 15
through 254 does not match the corresponding key duplicates allowed
flag of the physical file. (1985 mode)
For Btrieve files, this error also indicates that in the physical file, a key
attribute other than duplicate, modifiable, binary, null, alternate
collating sequence or extended type was specified for the Btrieve key
that corresponds with the COBOL key defined for the key offset. (For
example, descending, supplemental and manual key attributes may not
be used for RM/COBOL keys.)
Btrieve allows multiple keys to be defined at the same key offset, but
only the first is considered by the RM/COBOL-to-Btrieve Adapter
program.
39, 40 The offset from the start of the record area to the start of the key area
through for keys 0 through 14 does not match the corresponding key offset of
39, 4E the physical file. The prime record key is 0. Alternate record keys are
numbered in ascending order of key offset, starting with 1.
(1985 mode)
39, 4F The offset from the start of the record area to the start of the key area
for an alternate key 15 through 254 does not match the corresponding
key offset of the physical file. (1985 mode)
39, 50 The length of the key area for keys 0 through 14 does not match the
through corresponding key length of the physical file. The prime record key is
39, 5E key 0. Alternate record keys are numbered in ascending order of key
offset, starting with 1. (1985 mode)
This error also occurs if the number of keys specified does not match
the actual number of keys in the physical file. The key number 1
through E, if greater than the number of keys in the file description,
indicates that the file contains more keys than the program describes.
The key number 1 through E, if less than or equal to the number of keys
in the file description, provides a value one greater than the number of
keys contained in the file. (1985 mode)
39, 5F The length of the key area for an alternate key 15 through 254 does not
match the corresponding key offset of the physical file. (1985 mode)
This error also occurs if the number of keys specified does not match
the actual number of keys in the physical file. (1985 mode)
39, 60 The number of segments for keys 0 through 14 does not match the
through corresponding key number of segments of the physical file. The prime
39, 6E record key is 0. Alternate record keys are numbered in ascending order
of key offset, starting with 1. (1985 mode)
39, 6F The number of segments for an alternate key 15 through 254 does not
match the corresponding key number of segments of the physical file.
(1985 mode)
41, 01 A duplicate open was rejected by a system that does not allow the
physical file to be opened twice. (1985 mode)
41, 02 A duplicate open was rejected by a system that does not allow the
COBOL filename to be opened twice. (1985 mode)
41, 03 A DELETE FILE was rejected because the file was open. (1985 mode)
44, 03 The length of the record area specified in the WRITE, REWRITE or
RELEASE statement is less than the minimum record length of the file.
(1985 mode)
44, 04 The length of the record area specified in the WRITE, REWRITE or
RELEASE statement is greater than the maximum record length of the
file. (1985 mode)
For Btrieve files, A READ NEXT operation was attempted and could
not be completed because the Btrieve MicroKernel Database Engine
(MKDE) position was lost due to the current record (and surrounding
records) being deleted by programs at other computers. See the
“Current Record Position Limitations” section in Chapter 4, System
Considerations for Btrieve.
47, 01 The requested operation conflicts with the open mode of the file. A
START or READ operation was attempted on a file that is not open in
the INPUT or I-O mode. (1985 mode)
48, 01 The requested operation conflicts with the open mode of the file. This
error can occur under the following conditions: a WRITE operation
was attempted on a file that is not open in the EXTEND, I-O, or
OUTPUT mode; or, a WRITE operation was attempted on a file in the
sequential access mode that is open in the I-O mode. (1985 mode)
49, 01 The requested operation conflicts with the open mode of the file. A
DELETE or REWRITE operation was attempted on a file that is not
open in the I-O mode. (1985 mode)
This error also indicates that an invalid request has been made to the
RM/COBOL file management system or some other external access
method. This may be caused by an internal error or when
communicating to an earlier version of RM/InfoExpress.
90, 01 The requested operation conflicts with the open mode of the file. This
error can occur under the following conditions: a READ or START
operation was attempted on a file that is not open in the INPUT or I-O
mode; a WRITE operation was attempted on a file that is not open in
the EXTEND, I-O, or OUTPUT mode or a WRITE operation was
attempted on a file in the sequential access mode that is open in the I-O
mode; or, a DELETE or REWRITE operation was attempted on a file
that is not open in the I-O mode. (1974 mode)
90, 03 The requested operation conflicts with the media type. This error can
occur under the following conditions: a READ or OPEN INPUT
operation was attempted on a file with a device-name of OUTPUT,
PRINT or PRINTER; a WRITE, OPEN OUTPUT or EXTEND
operation was attempted on a file with a device-name of CARD-
READER or INPUT; or a DELETE, REWRITE, START or OPEN I-O
operation was attempted on a file with a device-name other than DISC,
DISK or RANDOM.
On Btrieve files, Error 90, 05 also indicates that an I/O error occurred
on the creation of the file. (If the file already existed and the Btrieve
MicroKernel Database Engine (MKDE) returned a Create I/O Error,
25, then the RM/COBOL-to-Btrieve Adapter program will misinterpret
the error as truncation conflict because the Btrieve MKDE uses this
error for both conditions.)
90, 06 The file access name specified in the OPEN statement indicates that the
file is accessed through an alternative access method and the alternative
access method refused to accept the request by the RM/COBOL file
management system to establish a session.
This error also indicates that the RM/COBOL file management system
refused one of the configuration parameters passed to it. The runtime
system validates all the configuration parameters of the RM/COBOL
file management system; however, if there is insufficient memory to
create a buffer pool of the requested size, this will not be detected until
later. Reducing the size of the buffer pool may resolve the problem.
90, 07 The requested operation conflicts with the permissions allowed to the
run unit for the file. This error can occur under the following
conditions: a DELETE FILE statement failed because the run unit did
not have write permission for the directory containing the file; an
OPEN statement with the OUTPUT or EXTEND phrase failed because
the run unit does not have write permission for the file; or, an OPEN
statement with the INPUT or I-O phrase failed because the run unit
does not have read permission for the file. (1974 mode)
For Btrieve files, this error code may also indicate that a DELETE,
WRITE, or REWRITE operation was performed on a file that has been
opened for read-only access using an RM/COBOL-to-Btrieve Adapter
program mode option of M=R (read-only). See page 4-14 for more
information about this option. (1974 and 1985 mode)
92, 01 A duplicate open was rejected by a system that does not allow the
physical file to be opened twice. (1974 mode)
92, 02 A duplicate open was rejected by a system that does not allow the
COBOL filename to be opened twice. (1974 mode)
92, 03 A DELETE FILE was rejected because the file was in an open mode.
(1974 mode)
93, 02 An operation was rejected because file lock conflicts with another user.
An OPEN WITH LOCK was attempted on a file that is already open, or
an OPEN without lock was attempted and the file is already open
WITH LOCK.
A DELETE FILE was attempted on a file that is currently open.
This message may occur in cases with Btrieve files when it would not
occur with RM/COBOL indexed files, because the Btrieve MicroKernel
Database Engine (MKDE) always opens its files WITH LOCK. See
error messages 39, 01 and 94, 01 for more information.
For Btrieve files, this error code may also indicate either of the
following conditions:
• Another computer has a transaction in progress on this file.
• Or, an attempt was made to open a file that another computer had
opened already with a conflicting RM/COBOL-to-Btrieve Adapter
program mode option (see page 4-14 for more information about
the mode option). For example, if the first computer opens a file
with a value of A (accelerated) for the mode option, then the
accelerated mode option must be specified by all other computers
that subsequently open the file. Conversely, if the first computer
opens a file and does not specify the accelerated mode option, then
no other computers that subsequently open the file can specify the
accelerated mode option either. These restrictions remain in effect
until all computers have closed the file.
93, 03 An OPEN or DELETE FILE operation failed because the filename was
previously closed WITH LOCK. (1974 mode)
93, 04 The file could not be opened because another file in the same SAME
AREA clause is currently open.
93, 05 The file could not be opened because another file in the same
MULTIPLE FILE TAPE clause is already open.
93, 06 The file could not be created because a file with the same name
already exists.
93, 07 The file could not be opened because a lock table for the requested
open mode was full. See the FILE-PROCESS-COUNT keyword of the
RUN-FILES-ATTR configuration record on page 10-28 for more
information.
94, 01 The file organization specified for the filename does not match the
actual file organization of the physical file. (1974 mode)
This message may not occur if the file is actually a Btrieve file. The
Btrieve MicroKernel Database Engine always opens its files WITH
LOCK, and the OPEN WITH LOCK error condition will be
encountered by the RM/COBOL file management system, preventing it
from determining the organization of the file.
For Btrieve files, if the minimum record length of the file is less than
four bytes, the file will be implemented using four-byte records. In this
situation, the RM/COBOL-to-Btrieve Adapter program cannot detect
the initial minimum record length and will fail to diagnose the
mismatched minimum record length error condition.
This error can occur when reopening a print file closed WITH NO
REWIND if the OPEN statement specifies a different record length
than was used on the previous OPEN statement.
This error will not occur with variable-length record Btrieve files.
Btrieve files do not support a mechanism to record this information and,
thus, it cannot be verified.
94, 04 The minimum block length specified in the BLOCK CONTAINS clause
for the filename does not match the actual minimum block size of the
physical file. (1974 mode)
This error will not occur with variable-length record Btrieve files.
Btrieve files do not support a mechanism to record this information and,
thus, it cannot be verified.
94, 07 The CODE-SET specified for the filename does not match the actual
character code of the physical file. (1974 mode)
94, 08 The COLLATING SEQUENCE specified for the indexed file does not
match the actual collating sequence of the physical file. (1974 mode)
94, 09 The record type attribute, fixed or variable, specified in the RECORD
CONTAINS clause or implied by the record descriptions of the
filename does not match the record type attribute of the physical file.
(1974 mode)
94, 20 The file is not available because the file identified by the resultant file
access name could not be found. The pathname or filename may be
misspelled or may not be valid for the operating system. Specifying a
pathname or filename that is not a valid name or that is longer than
allowed also results in this error. The directory search sequence
specified by RUNPATH may be incorrect. See the “Locating
RM/COBOL Files” sections either on pages 2-3 through 2-7 for UNIX
or pages 3-10 through 3-15 for Windows for information on the
resultant file access name. (1974 mode)
94, 22 The minimum record length is invalid. The minimum record length
specified in the RECORD CONTAINS clause for the filename exceeds
the maximum record length.
94, 23 The maximum record length is invalid. The maximum record length
specified in the RECORD CONTAINS clause of the filename exceeds
65280, or the indexed records are not compressed and the maximum
record length exceeds the block size.
94, 24 The minimum block size is invalid. The minimum block size specified
in the BLOCK CONTAINS clause of the filename exceeds the
maximum block size.
94, 25 The maximum block size is invalid. The maximum block size specified
in the BLOCK CONTAINS clause of the filename is too large. The
method of computing the block size and the limitations on the block
size for each organization are described on pages 8-41 (sequential
files), 8-47 (relative files), and 8-50 (indexed files).
For indexed organization files, the computed block size is also a
function of the maximum record size. In general, if the BLOCK
CONTAINS clause is omitted, the runtime system defaults to the valid
block size that is a multiple of the disk sector size. For files with a very
large record size, specifying BLOCK CONTAINS 1 RECORDS yields
the minimum possible block size.
94, 26 The record delimiter is invalid. A record delimiting technique other
than LINE-SEQUENTIAL or BINARY-SEQUENTIAL was specified.
94, 27 The CODE-SET specified is invalid or unsupported.
94, 28 The COLLATING SEQUENCE specified for an indexed file is invalid
or unsupported.
94, 29 The record type attribute, fixed or variable, specified for the filename is
unsupported.
94, 30 The key duplicates allowed flag specified for keys 0 through 14 is
through invalid (1974 and 1985 modes) or does not match the corresponding
94, 3E key duplicates allowed flag of the physical file (1974 mode). The
prime record key is 0. Alternate record keys are numbered in
ascending order of key offset, starting with 1.
For Btrieve files, this error also indicates a key attribute other than
duplicate, modifiable, binary, null, alternate collating sequence, or
extended type was specified for the Btrieve key that corresponds with
the COBOL key defined for the key offset. (For example, descending,
supplemental, and manual key attributes may not be used for
RM/COBOL keys.) In addition, the primary key may not have a null
attribute.
Btrieve allows multiple keys to be defined at the same key offset,
but only the first key is considered by the RM/COBOL-to-Btrieve
Adapter program.
94, 3F The key duplicates allowed flag specified for an alternate record key 15
through 254 is invalid (1974 and 1985 modes) or does not match the
corresponding key duplicates allowed flag of the physical file. (1974
mode)
For Btrieve files, this error also indicates that in the physical file, a key
attribute other than duplicate, modifiable, binary, null, alternate
collating sequence or extended type was specified for the Btrieve key
that corresponds with the COBOL key defined for the key offset. (For
example, descending, supplemental and manual key attributes may not
be used for RM/COBOL keys.)
Btrieve allows multiple keys to be defined at the same key offset, but
only the first key is considered by the RM/COBOL-to-Btrieve Adapter
program.
94, 40 The offset from the start of the record area to the start of the key area
through for keys 0 through 14 is invalid (1974 and 1985 modes) or does not
94, 4E match the corresponding key offset of the physical file (1974 mode).
The prime record key is 0. Alternate record keys are numbered in
ascending order of key offset, starting with 1.
Error 94, 40 also occurs if more than 254 alternate record keys are
specified.
For Btrieve files, this error also indicates that the key extends into the
variable portion of a Btrieve file record.
94, 4F The offset from the start of the record area to the start of the key area
for an alternate key 15 through 254 is invalid (1974 and 1985 modes)
or does not match the corresponding key offset of the physical file.
(1974 mode)
For Btrieve files, this error also indicates that the key extends into the
variable portion of a Btrieve file record.
94, 50 The length of the key area for keys 0 through 14 is invalid (1974 and
through 1985 modes) or does not match the corresponding key length of the
94, 5E physical file (1974 mode). The prime record key is key 0. Alternate
record keys are numbered in ascending order of key offset, starting
with 1.
This error also occurs if the number of specified keys does not match
the actual number of keys in the physical file. The key number 1
through E, if greater than the number of keys in the file description,
indicates that the file contains more keys than the program describes.
The key number 1 through E, if less than or equal to the number of keys
in the file description, provides a value one greater than the number of
keys contained in the file. (1974 mode)
94, 5F The length of the key area for an alternate key 15 through 254 is invalid
(1974 and 1985 modes) or does not match the corresponding key offset
of the physical file. (1974 mode)
This error also occurs if the number of keys specified does not match
the actual number of keys in the physical file (see error messages
94, 50 through 94, 5E). (1974 mode)
94, 62 The LINAGE parameters are invalid for an OPEN statement. One or
more LINAGE parameters are negative or greater than 32767, LINAGE
equals zero, FOOTING equals zero, or FOOTING is greater than
LINAGE.
94, 63 An OPEN WITH LOCK was attempted on a system that does not
support WITH LOCK.
94, 64 The filename specified is invalid. This error can occur if the filename
is set to spaces.
94, 68 An attempt was made to open an indexed file that has a future file
version number. The indexed file may have been created by a later
version of RM/COBOL or the indexed file may be corrupt.
94, 69 The specified large file lock limit is too large for either the operating
system on which the runtime is running, or the file system on which the
file would reside. For example, Windows 98 does not support a large
file lock limit greater than four gigabytes (4 GB).
95, 01 The file must be mass storage. The device-name specified for the file
was DISC, DISK or RANDOM, but the resultant file access name
identifies a file that does not reside on disk. (1974 mode)
97, 01 One or more characters in the record are illegal in a line sequential file.
97, 02 One or more characters could not be translated from the native
character set to the external code-set.
97, 03 The length of the record area specified in the WRITE, REWRITE or
RELEASE statement is less than the minimum record length of the file.
(1974 mode)
97, 04 The length of the record area specified in the WRITE, REWRITE or
RELEASE statement is greater than the maximum record length of the
file. (1974 mode)
97, 05 The record read from the file is shorter than the minimum record length.
97, 06 The record read from the file is longer than the record area.
97, 08 The LINAGE parameters are invalid for a WRITE statement. One or
more LINAGE parameters are negative or greater than 32767, LINAGE
equals zero, FOOTING equals zero, or FOOTING is greater than
LINAGE.
98, 01 The indexed file structure includes a count of the number of times the
file is currently open for modification. The count should be zero
whenever a file in a single-user environment is opened or a file in a
shared environment is opened WITH LOCK. If the count is non-zero
when the file is opened WITH LOCK, a 98, 01 error is returned. The
conditions that determine whether the runtime system assumes a
single-user or shared environment are described in the “File Types and
Structure” section (see page 8-40) and in the explanation of the
FORCE-USER-MODE keyword of the RUN-FILES-ATTR
configuration record (see page 10-28).
The count is incremented when a program opens the file I-O, OUTPUT,
or EXTEND and decremented when the program closes the file. If the
count is non-zero when the file is opened in a single-user environment
or opened WITH LOCK in a shared environment, then the system must
have terminated without closing the file. This error can also appear
when a file with a non-zero count is moved from a shared environment
to a single-user environment. The indexed file will be inconsistent if all
the modifications to it were not written to disk. Use the Indexed File
Recovery utility (recover1) to rebuild or recover disk information (see
page G-23).
98, 01 (Cont.) You can reduce the likelihood of encountering this error by changing
the Indexed File Recovery utility strategy to “Force File Closed” (see
page 8-51). This causes the count to be changed around every write
operation instead of during open and close. Use the Define Indexed
File utility (rmdefinx) to change the recovery strategy of an existing
indexed file (see page G-19).
Code Message
1 Memory management failure
2 Operator requested termination
3 Locks lost
Sort-Merge Errors
Sort-merge errors include errors processing a SORT or MERGE statement.
Number Description
302 Fewer than three intermediate files were available to begin a SORT
statement. The sort procedure cannot begin unless it is able to create at
least three intermediate files.
303 A record read from a MERGE file or SORT USING file was not long
enough to include all the keys.
304 Too many out of sequence records were passed to the sort process. Use
the T Runtime Command Option to increase the memory available to
sort. Or, divide the records to be sorted into several files, sort the
several files, and merge the resulting files.
Number Description
Configuration Errors
Configuration errors include all errors that occur because of an error in the configuration.
The formats are as follows:
number identifies the logical record in the configuration file (location) at which the
error was found. Each logical record is identified with a configuration record type.
In other words, when you are using the record number provided in the message to
determine the erroneous record, count the lines combined with their corresponding
continuation lines as one line, and do not count the comment lines and blank lines.
The first format is used if an error is detected during the processing of a configuration
record. The error message will be followed by a line containing the portion of the record
being processed when the error occurred and another line placing a currency symbol
underneath the item being processed when the error occurred.
The second format is used if an error is detected after all configuration records have been
processed or if an error is detected with which a record is not associated.
Number Description
403 The input sequence in the current TERM-INPUT record has been
defined in a previous TERM-INPUT record.
404 A keyword has not been provided where expected or the keyword is
invalid.
405 The resulting terminal input configuration table (used by the runtime
system during ACCEPT statements) is too large or out of memory.
409 A value has not been provided where expected or the value is invalid.
410 The configuration file requested in the Runtime Command was not
found.
Initialization Errors
If the runtime system receives an error from the operating system during initialization, the
following message appears:
code depends on the operating system on which the file resides. See the description
of the 30, OS error code on page A-14 for more information.
The runtime system compares its version number and product code with those in the
message file. If they do not match, one or both of the following messages appears:
When any of the above messages appear, the runtime system terminates with the
following message:
When the runtime system detects that the message file version does not match its own
version, the following message appears:
The occurrence of this message does not prevent the runtime system from continuing, but
the messages that it generates may be not correct.
Further processing is done for libraries (as specified by the L Runtime Command Option)
during which control structures are built for use later in the run unit. If errors are
encountered during this processing, the following message appears:
code is the first two digits of the error numbers listed in this appendix.
code is the first two digits of the error numbers listed in this appendix.
Note Registration checking on Novell is sometimes performed using server facilities and
will be enforced until the runtime product terminates, or the server is aware that the client
station is no longer connected to the network. If a runtime system is not properly
terminated due to the powering off of the client machine or rebooting it, the server will
not be aware of the absence of the client until the client starts the network shell again.
When the runtime system encounters a STOP literal or STOP data item statement, the
following message appears:
If you enter Y or y, execution continues with the next executable statement. If you enter
N or n, execution ends as if a STOP RUN statement was encountered.
Note See also Chapter 4, System Considerations for Btrieve, for a description of the
limitations of the Btrieve MicroKernel Database Engine (MKDE), and the way in which
these limitations affect RM/COBOL indexed files. Although these two systems perform
the same functions, they do not operate in the same manner.
No more than 65534 identifiers may be defined in a single source program, including any
of its nested source programs. Only 65533 identifiers may be defined in the Data
Division (see below for information about compiler generated identifiers that occur in the
Procedure Division). Note that the compiler implicitly defines identifier entries, reducing
the number that can be explicitly defined, as follows:
• one for each LINAGE-COUNTER associated with any files described with the
LINAGE clause;
• one for each variable length record file that has multiple record descriptions and no
record description is a group having the maximum record length;
• one for each indexed file with a CODE-SET or COLLATING-SEQUENCE that
requires that an external collating sequence be provided, that is, when the specified or
implicit code-set for the file requires a mapping other than identity to obtain the
specified or implicit collating sequence used for record keys of the file;
• one for each RERUN clause;
• one for a RETURN-CODE special register item if the program contains an explicit
reference to RETURN-CODE or contains a STOP RUN identifier/integer statement;
The maximum length of an element of a table is 65280 characters (that is, data items
subordinate to an OCCURS clause cannot exceed 65280 characters in length).
Data items greater than 65280 characters in length may be referenced in a MOVE
statement or the USING phrase of a CALL statement, but may not be referred to in any
other context.
Data items greater than 65280 characters in length may not be reference modified.
A record key of an indexed file may not exceed 254 characters in length.
A maximum of 255 keys may be declared for an indexed file (one prime key and up
to 254 alternate keys).
The maximum length of literals generated for any one segment type within a program may
not exceed 65535 bytes. Segment type refers to fixed permanent, fixed overlayable and
independent. Segmentation can greatly increase the number of literals a program may
have, since literals are overlaid for each segment.
Note Refer to Table 6-1 (beginning on page 6-36) for additional compilation limits.
2B 35 31 34 37 32
The line of source code shows the RM/COBOL statement itself. The values inside the
box show the hexadecimal data values in bytes, as stored in memory. The numbers above
the box show the hexadecimal relative byte address.
The ASCII code-set is used to represent all data items whose usage is DISPLAY.
Nonnumeric Data
Nonnumeric data items are formatted one character per byte. The leftmost character
starts at the lowest address. Edited nonnumeric data items have an associated editing
PICTURE character-string that is used only when the data item is a receiving operand.
Nonnumeric data items always have DISPLAY usage.
The SIGN clause does not apply to nonnumeric data items. The BLANK WHEN ZERO
clause—when associated with a numeric PICTURE character-string—causes the data
item to be treated as numeric edited.
Table C-1 lists the types of nonnumeric data, the compiler designation for each type, and
the valid picture symbols for each type.
0 1 2 3 4 5 6 7
00: 20 21 22 23 24 25 26 27
08: 28 29 2A 2B 2C 2D 2E 2F
10: 30 31 32 33 34 35 36 37
18: 38 39 3A 3B 3C 3D 3E 3F
20: 40 41 42 43 44 45 46 47
28: 48 49 4A 4B 4C 4D 4E 4F
30: 50 51 52 53 54 55 56 57
38: 58 59 5A 5B 5C 5D 5E 5F
40: 60 61 62 63 64 65 66 67
48: 68 69 6A 6B 6C 6D 6E 6F
50: 70 71 72 73 74 75 76 77
58: 78 79 7A 7B 7C 7D 7E
2A 2A 2F 31 32 30 30 2F 51 52 20 20
Alphabetic
01 ABS1 PIC A(12) VALUE "STOCK NUMBER" DISPLAY.
0 1 2 3 4 5 6 7 8 9 a b
53 54 4F 43 4B 20 4E 55 4D 42 45 52
Alphabetic Edited
01 ABSE1 PIC AA BAABAA VA LUE "XX YY ZZ" DISPL AY.
0 1 2 3 4 5 6 7
58 58 20 59 59 20 5A 5A
Numeric Edited
01 NSE1 PIC $*(5).**CR VALUE "$***24.13 " DISPLAY.
0 1 2 3 4 5 6 7 8 9 a
24 2A 2A 2A 32 34 2E 31 33 20 20
20 24 34 39 31 33 2E 37 38 2B
A numeric data item may vary in size from 1 to 31 bytes. Storage requirements for a
numeric item depend on the usage, the number of digits, and the presence of an
operational sign.
Numeric DISPLAY data items are formatted one digit character per byte. The number is
formatted as an integer aligned with the most significant digit at the lowest address and
the least significant digit at the highest address. The position of the implied decimal point
is maintained in a separate data descriptor. The format descriptions of the numeric
DISPLAY data items begin on page C-6.
Numeric computational data items are formatted in a variety of ways depending on the
specific USAGE applied to the data item and whether the data item is unsigned or signed.
The various numeric computational data item formats are described beginning on
page C-11
Format Illustrations
0 1 2 3 4
37 33 31 32 34
30 30 33 34 35 36 37 30 30 30 30 30
35 37 31 32 33
39 34 33 31 37 32 36
If the S (separate sign) Compile Command Option is specified, the compiler assumes the
presence of the SIGN IS TRAILING SEPARATE clause for all signed numeric
DISPLAY data items for which the SIGN clause is not explicitly stated.
Format Illustrations
37 33 31 32 34 2D
30 30 33 34 35 36 37 30 30 30 30 2D
35 37 31 32 33 2B
39 34 33 31 37 32 36 2D
Format Illustrations
2B 37 33 31 32 34
2D 30 37 36 35 34 33 30 30 30
2B 35 37 31 32 33
2B 39 34 33 31 37 32 36
Because of the combined digit and sign, this format is sometimes called trailing combined
sign. It is also sometimes called trailing zoned sign because the sign is represented in a
manner consistent with a sign zone punch and digit punch on Hollerith punch cards.
The hexadecimal values that result from this combination are shown in Table C-2.
This format is the default for all signed numeric DISPLAY data items when the SIGN
clause is not specified, unless the S (separate sign) Compile Command Option is
specified.
Signed numeric DISPLAY data (TRAILING) is designated as NTC. The valid picture
symbols are S, 9, V and P. Usage is always DISPLAY. The sign is always TRAILING.
Note that if an NTC data item is sent directly to a printer or display device, the position
that contains the combined sign and digit appears as a special character or letter. A
positive zero value appears as {. A negative zero value appears as }. Positive 1 through
9 values appear as A through I. Negative 1 through 9 values appear as J through R.
37 33 31 32 4D
30 33 31 34 31 35 39 30 7D
35 37 31 32 43
39 34 33 31 37 32 4F
Because of the combined digit and sign, this format is sometimes called leading combined
sign. It is also sometimes called leading zoned sign because the sign is represented in a
manner consistent with a sign zone punch and digit punch on Hollerith punch cards.
Signed numeric DISPLAY data (LEADING) is designated as NLC. The valid picture
symbols are S, 9, V and P. Usage is always DISPLAY. The sign is always LEADING.
Format Illustrations
50 33 31 32 34
4B 39 38 37 36 30 30 30
45 37 31 32 33
49 34 33 31 37 32 36
The number is formatted as an integer aligned with the most significant digit at the lowest
address and the least significant digit at the highest address. The position of the implied
decimal point is maintained in a separate data descriptor.
Format Illustrations
07 03 01 02 04
00 02 03 04 05 00 00
05 07 01 02 03
09 04 03 01 07 02 06
Format Illustrations
07 03 01 02 04 0D
01 02 03 04 05 06 07 0C
05 07 01 02 03 0C
09 04 03 01 07 02 06 0D
The number is formatted as a 2’s complement binary word with the most significant byte
at the lowest address and the least significant byte at the highest address.
The operational sign is indicated by the 2’s complement format. If the most significant
bit is zero, the number is positive. If this bit is one, the number is negative.
Format Illustrations
03 E8
FC 18
80 00
7F FF
The number is formatted as an integer aligned with the most significant digit at the lowest
address and the least significant digit at the highest address. The position of the implied
decimal point is maintained in a separate data descriptor.
The operational sign is concatenated with the least significant digit in the highest
addressed byte. The high-order four bits of the byte is the least significant digit and the
low-order four bits of the byte is the operational sign. The sign is always Fh, denoting a
positive value.
07 31 24 6F
00 12 34 56 78 90 00 0F
57 12 3F
94 31 72 6F
The number is formatted as an integer aligned with the most significant digit at the lowest
address and the least significant digit at the highest address. The position of the implied
decimal point is maintained in a separate data descriptor.
Format Illustrations
07 31 24 6D
00 12 34 56 78 90 00 0C
57 12 3D
94 31 72 6D
The number is formatted as a binary integer with the most significant byte at the lowest
address and the least significant byte at the highest address. The position of the decimal
point is maintained in a separate data descriptor.
For unsigned binary items there is no operational sign. In particular, the most significant
bit is not indicative of the sign. The value is always interpreted as a positive number.
Unsigned numeric COMPUTATIONAL-4 data is designated as NBU, binary unsigned.
The valid picture symbols are 9, V and P. Usage is COMPUTATIONAL-4, COMP-4
or BINARY.
BINARY-ALLOCATION=RM (Default)
1-4 2
5-9 4
10-18 8
19-30 16
BINARY-ALLOCATION=RM1
1-2 1
3-4 2
5-9 4
10-18 8
19-30 16
BINARY-ALLOCATION=MF-RM
1-2 1
3-4 2
5-7 3
8-9 4
10-12 5
13-14 6
15-16 7
17-19 8
20-21 9
22-24 10
25-26 11
27-28 12
29-30 13
04 D2
00 00 DF 23
00 00 00 21 05 67 14 32
00 8F EA AE
A4 32
The number is formatted as a binary integer with the most significant byte at the lowest
address and the least significant byte at the highest address. The position of the decimal
point is maintained in a separate data descriptor.
The operational sign is indicated by the 2’s complement format. If the most significant
bit is zero, the number is positive. If this bit is one, the number is negative.
BINARY-ALLOCATION=RM (Default)
1-4 2
5-9 4
10-18 8
19-30 16
BINARY-ALLOCATION=RM1
1-2 1
3-4 2
5-9 4
10-18 8
19-30 16
BINARY-ALLOCATION=MF-RM
1-2 1
3-4 2
5-6 3
7-9 4
10-11 5
12-14 6
15-16 7
17-18 8
19-21 9
22-23 10
24-26 11
27-28 12
29-30 13
The number is formatted as an integer aligned with the most significant digit at the lowest
address and the least significant digit at the highest address. The position of the implied
decimal point is maintained in a separate data descriptor.
Format Illustrations
07 31 24
00 12 34 56 78 90 00 00
05 71 23
94 31 72
• RM/InfoExpress server
For some of these products, different variations can be built by including one or more of
the following software components:
• RM/InfoExpress client
• RM/plusDB
The RM/COBOL runtime system also can be customized by adding C (or assembly)
language subprograms, a Message Control System (MCS), or a built-in configuration file
(see “Other Runtime Customizations” on page D-5).
RM/InfoExpress Client
The RM/InfoExpress add-on product for RM/COBOL is designed to optimize
RM/COBOL data file access on various local area networks (LANs) and wide area
networks (WANs). It allows RM/COBOL programs to realize significant speed
improvements for sequential, relative, and indexed files over conventional network access
methods. To add the RM/InfoExpress client to your runtime system, invoke customiz,
choose option 1 (runcobol), and type “y” at the following prompt:
When you answer “y” to the preceding prompt, the customiz program will ask for the
directory where the RM/InfoExpress server software is installed. See the RM/InfoExpress
User’s Guide for more information on installing RM/InfoExpress.
RM/InfoExpress also can be included with the RM/COBOL Open File Manager and
the RM/COBOL compiler in the same way. An RM/COBOL Open File Manager that is
linked with the RM/InfoExpress client can be used to access remote RM/COBOL data
files using the RM/InfoExpress server. Similarly, an RM/COBOL compiler that is linked
with the RM/InfoExpress client (running under UNIX or Windows) can be used to
compile a source program or access a library that is present on a machine running
RM/InfoExpress server software.
When you answer “y” to the preceding prompt, the customiz program will prompt you for
the directory where the RM/plusDB software is installed. See the RM/plusDB User’s
Guide for more information about installing RM/plusDB.
RM/plusDB also can be included with the RM/InfoExpress server product by invoking
customiz, choosing option 5 (rmserver), and typing “y” at the prompt. (See Example 2
on page D-9.) RM/plusDB enables the remote RM/InfoExpress client applications
(running on UNIX and Windows machines) to access transparently the associated
database on a UNIX machine over the network.
To build a runtime system with the Pop-Up Window Manager removed, invoke customiz
(see Example 1 on page D-6), choose option 1 (runcobol), and type “n” at the following
prompt:
Enterprise CodeBench
Enterprise CodeBench is an add-on product for RM/COBOL that allows you to create,
edit, compile, debug, and run RM/COBOL applications on UNIX within the Windows
environment.
To add Enterprise CodeBench to your runtime system, invoke customiz, choose option 1
(runcobol), and type “y” at the following prompt:
To add VanGui Interface Builder to your runtime system, invoke customiz, choose option
1 (runcobol), and type “y” at the following prompt:
1. Adding C (or assembly) language subprograms. The procedures for adding C (or
assembly) language subprograms begin on page D-12.
2. Adding a Message Control System (MCS). The Message Control System (MCS) is
discussed on page 8-65. To link your MCS with the runtime system, use the
customiz utility to generate a Makefile to build the runtime with the same
configuration as that of your current runtime system.
mymcs.o is the file containing the code for your MCS. The MCS parameter to the
make command can also be used with other runtime systems you build.
3. Adding a built-in configuration file. See Chapter 10, Configuration, for more
information.
Example 1
This first example describes how to generate a Makefile to build a runtime system with
the termcap terminal interface, an RM/InfoExpress client, RM/plusDB, Enterprise
CodeBench, VanGui Interface Builder, and the Pop-Up Window Manager. It does not
include MCBA or Flexgen C language routines.
Note This example assumes that RM/InfoExpress, RM/plusDB, MCBA and Flexgen C
language routines, Enterprise CodeBench, and VanGui Interface Builder are supported on
your UNIX system. If that is not the case, the system prompts associated with these
products are not displayed.
1. To execute the customiz shell script, you must be in the directory where
RM/COBOL is installed. To invoke the shell script, type the following command:
customiz
2. Type “n” to cause the program to exit without affecting the current status. Type “y”
to cause the program to erase the Makefile. Pressing the Interrupt key at any point
causes the program to remove the incomplete Makefile before exiting to the system.
The program displays the following screen:
RM/COBOL Customization
(Press system cancel to abort)
The program responds with the following prompt, which will repeat until an
appropriate response is entered:
Building runcobol
-----------------
Would you like the Terminfo or Termcap terminal interface (1/2)?
4. Type “2” and press Enter to choose the termcap terminal interface.
6. Type the complete pathname for the directory where RM/InfoExpress is installed.
customiz checks the system for the presence of the specified directory. If no
directory name is entered, the program uses /usr/rminfox as the default value.
customiz checks the system for the presence of the specified directory. If no
directory name is entered, the program uses /usr/rmdb as the default value.
8. Type “y” and press Enter. (The Pop-Up Window Manager is required for Enterprise
CodeBench, which is described in Step 10.)
customiz allows you to specify the executable filename of the linked product using
the following prompt:
13. Press Enter to use the default name or type the name of the final linked product.
The program builds the Makefile and displays the following prompt:
a. If you want the program to build the product, type “y” and press Enter. The
program builds the product using the system make utility and the newly
generated make script specified in Makefile.
b. You may choose to run the make script yourself if you need to change the values
of the macros defined in the make script specified in Makefile. If you type “n”,
the program displays the following information and then exits:
Note If you look at the generated Makefile using any text editor, you will find
comments at the beginning about the configuration of the product built.
Note This example assumes that RM/InfoExpress and RM/plusDB are supported on
your UNIX system.
customiz
2. Type “n” to cause the program to exit without affecting the current status. Type “y”
to cause the program to erase the Makefile. Pressing the Interrupt key at any point
causes the program to remove the incomplete Makefile before exiting to the system.
RM/COBOL Customization
(Press system cancel to abort)
Building rmserver
-----------------
Would you like to build RM/plusDB (y/n)?
customiz checks the system for the presence of the specified directory. If no
directory name is entered, the program uses /usr/rmdb as the default value and
displays the following prompt:
7. Type the complete pathname for the directory where RM/InfoExpress is installed.
customiz checks the system for the presence of the specified directory. If no
directory name is entered, the program uses /usr/rminfox as the default value.
The program responds with the following prompt, which allows you to specify the
name of the linked product:
8. Press Enter to use the default name or type the name of the final linked product.
a. If you want the program to build the product, type “y” and press Enter. The
program builds the product using the system make utility and the newly
generated make script specified in Makefile.
b. You may choose to run the make script yourself if you need to change the values
of the macros defined in the make script specified in Makefile. If you type “n”,
the program displays the following information and then exits:
Note If you look at the generated Makefile using any text editor, you will find
comments at the beginning about the configuration of the product built.
1. Log in as root.
2. Change your working directory to the directory in which you initially installed
RM/COBOL.
For example:
cd rmc85_dir
./rminstall
During the execution of this command, messages appear periodically indicating the status
of the installation.
C Calling Sequence
The syntax (Format 2) for the CALL statement in the RM/COBOL program is as follows:
identifier-2
[ BY REFERENCE ] OMITTED
identifier-2
USING BY CONTENT literal-2
OMITTED
identifier-1
CALL identifier-2
literal-1
literal-2
OMITTED
GIVING
RETURNING identifier-3
[ ON EXCEPTION imperative-statement-1 ]
The value of the contents of the data item specified by identifier-1 or the value of
literal-1 is the program name of the subprogram to be called.
identifier-2 or literal-2 are one or more actual arguments to be passed to the called
program. If the BY CONTENT phrase applies to an argument, a temporary copy of
the item is passed, thus preventing the subprogram from modifying the original item.
identifier-3 is an actual argument to be passed to the called program for the purposes
of returning a result to the calling program.
The runtime system can locate the C subprograms only if their names appear in the
subprogram name table. The subprogram name table is an array of structures linked into
the runtime system. The name of this table must be LIBTABLE, and must be of the
following format:
struct PROCTABLE {
char *subname; /* name of subroutine as in call */
int (*ent_pnt)(); /* pointer to subroutine function */
};
/* define library header */
Here, “SYSTEM”, “RENAME”, and “DELETE” are the program names. subsys, subren,
and subdel are the entry points into the routines. The last two entries in the table must be
zeroes.
Upon entry to the subprogram, all registers are volatile. The top of the stack contains the
following information:
The return address is used during the execution of the C return (x) statement, or during the
execution of the corresponding assembly instruction.
The pointer to the subprogram name (name) is used by the run unit to identify the
requested subprogram. This is a null-terminated ASCII string.
The number of the arguments (arg_count) describes the number of USING argument
entries in the actual argument entry table (arg_vector) pointed to by the next argument.
The initial entry flag (initial) contains zero to indicate that the subprogram is in its “initial
state,” which is the state a subprogram is in the first time it is called in the run unit, and a
non-zero value to indicate that it should be in its “last used state.”
In the initial state, all external and static automatic variables are initialized by the system
to the appropriate values. In the last used state, external and static variables are left in the
last state they were used. In either state, all automatic variables are reallocated on the
stack. It is your responsibility to initialize them to the desired values.
Once memory used by a subprogram has been linked into the runtime system, it cannot be
released.
Use of the CANCEL statement to cancel a routine linked with the runtime system sets the
initial flag to zero on the next entry into the subprogram. The CANCEL statement has no
effect on the values of the external and static variables used in the program.
The argument entry table (arg_vector) contains descriptions of the actual arguments
specified in the CALL statement. The arg_vector[0] entry describes the first actual
argument in the USING phrase of the CALL statement. The arg_vector[arg_count - 1]
entry describes the last actual argument in the USING phrase of the CALL statement.
The arg_vector[-1] entry describes the argument specified in the GIVING phrase of the
CALL statement. If the GIVING phrase is omitted from the CALL statement, or for any
actual argument specified as OMITTED in the USING phrase of the CALL statement, the
corresponding arg_vector entry contains a type value 32 (OMITTED, as shown in table
D-1) and the remaining fields are zero. C or assembly language subprograms that access
the GIVING argument in arg_vector[-1] will function correctly only for RM/COBOL 7.0
and later release runtimes because prior runtimes did not make a GIVING argument entry
available in arg_vector[-1].
ARGUMENT_ENTRY STRUC
A_ADDRESS DD ? ; linear address of argument
A_LENGTH DW 2 DUP (?) ; length of argument
A_TYPE DB ? ; type of argument
DB ? ; reserved, set to zero
A_DIGIT_COUNT DB ? ; number of digits in argument
A_SCALE DB ? ; position of implied/actual decimal point
A_PICTURE_ADDRESS DD ? ; linear address of encoded picture
ARGUMENT_ENTRY ENDS
struct ARGUMENT_ENTRY {
char *a_address; /* pointer to start of arg */
unsigned long a_length; /* length of argument */
short a_type; /* arg type see table below */
char a_digits; /* digit count 0x1-0x1E */
signed char a_scale; /* implied decimal location */
char *a_picture; /* pointer to edit DOPE */
}
;
a_type specifies the RM/COBOL data type as a number from Table D-1.
Note See also Table 9-2 on page 9-4 for an explanation of the data type abbreviations in
the following table and Appendix C, Internal Data Formats, for a description of
RM/COBOL data types.
Note The data type GRPV (23) occurs only when C$CARG is called with the formal
argument in the main program. In all other cases, RM/COBOL passes variable length
group actual arguments as if they were a fixed length group of the maximum length.
a_digits specifies the actual number of digits in a numeric data item (where the type of
argument is in the range 0 through 30). It is set to zero for nonnumeric data items.
a_scale specifies the power of 10 by which the digits in a numeric data item (where the
type of argument is in the range 1 through 12) must be multiplied to obtain the numeric
value of the data item. The power of 10 is represented as a signed, 2’s complement
number. It is set to zero for nonnumeric data items.
a_picture specifies the lowest addressed byte of the encoded picture for edited items (type
of argument equals 0, 20 or 21). It is set to zero for all other types.
picture address
implied decimal
digit count
type
argument length
argument address
For Intel-based computers, the memory organization is different, so the values for the
fields are different but the organization of the structure is the same. Using the same
example as above except that the argument address is 0xdf:0x2850, the argument entry
will contain:
50 28 DF 00 03 00 00 00 01 00 03 FF 00 00 00 00
picture address
implied decimal
digit count
type
argument length
argument address
ptr to char
argument address
argument [3];
argument length 3
type 1
digit count 3
implied decimal -1
Accessing C Subprograms
Two methods are available to access a C (or assembly) language subprogram that has
been linked to the runtime system: either each subprogram can be given a unique name
and entry point or each subprogram can be given a unique name and share the same entry
point. In the second case, it is necessary to determine which subprogram has been called.
Here is an example:
struct PROCTABLE LIBTABLE [] = {
{"SUBA", library },
{"SUBB", library },
{(char *) 0, 0 }
};
int library(name, arg_count, arg_vector, initial)
char *name;
int arg_count;
struct ARGUMENT_ENTRY arg_vector[];
int initial;
{
if (!strcmp ( "SUBA", name)) {
return( suba( arg_count, arg_vector, initial));
}
else
{
if (!strcmp ( "SUBB", name)) {
return( subb( arg_count, arg_vector, initial));
}
else
{
return( 1);/* error stop run */
}
}
}
If a single source module is to be linked into the runtime system, ensure that LIBTABLE
is present (as described previously). The following commands automatically generate the
subprogram object file and link it with the runtime system:
If you want to modify the routine (called sub.c) that is delivered with your system, you
would edit sub.c, making changes as appropriate, and then enter:
make runcobol
The make utility automatically compiles and links the default subprogram module sub.c.
You can link multiple subprograms into the runtime system. Only one LIBTABLE can be
declared, holding all the subprogram names and entry points. For example, if you want to
link three subprograms, you would enter these commands (assuming that one of the C
routines contains LIBTABLE):
mysubn.c is the name of the files that contain your C programs. These files will be
automatically compiled to produce mysubn.o.
C Subprogram Examples
The programs that have been provided with your distribution media as examples include
sub.c, subtest.cbl, subtype.c, and typetest.cbl.
Example 1
sub.c is the default subprogram library that is distributed and already linked into the
runtime system. This routine includes the following subprograms:
The third parameter must be defined as PIC S9(4) BINARY and contains
the return code from the command when control is returned to the COBOL
program.
"return (wexitstatus(system(command))"
DELETE Deletes a file. DELETE is called with one argument, which is the full or
relative pathname of the file to be deleted.
RENAME Renames a file. RENAME is called with one or two arguments. If one
argument is passed to the routine, the routine handles the request in the
same fashion as the RENAME subprogram in RM/COBOL (74) 2.n.
That is, the one argument contains both the source filename and the
target filename. If the subprogram is invoked this way, the argument
must be NULL terminated (that is, the last character must be
COBOL LOW-VALUES). If the subprogram is invoked with two
arguments, it uses the first argument as the source filename and the
second as the target filename. In this case, the names do not have to be
NULL terminated.
In all cases, except using RENAME in the RM/COBOL (74) 2.n fashion, the use of
literals in the CALL statement is supported. In the case of the RM/COBOL (74) 2.n
RENAME subprogram, it is not possible to have LOW-VALUES as part of a literal. Use
a Working-Storage Section variable. See subtest.cbl for examples of all calling
sequences.
rmcobol subtest
runcobol subtest
subtype.c is a subprogram that returns the type of the first argument in the second
argument. The second argument must be declared as COMP-1.
typetest.cbl is an RM/COBOL program that calls subtype with many different types of
arguments, and tests that the proper value is returned. In order to run this test, you must
link this routine into the runtime system. To run Example 2, enter the following
commands:
cc -c subtype.c
make runcobol CLIBRARY=subtype.o
rmcobol typetest
runcobol typetest
Remember, by doing this you have replaced the default subprogram library, sub.o,
with this test subprogram. It is recommended that after you run this test, you relink the
default subprogram library into the runtime system, as described previously in
this appendix.
• RmForget (int y1, int x1, int y2, int x2). This function marks the indicated area of
screen memory as unknown. By doing so, the next COBOL display to that area will
not be optimized based on the screen contents. This allows COBOL output to be
correctly displayed over linked C subprogram output, which is not stored in the
in-memory screen image.
This routine requires four int parameters (two line and position pairs), which specify
the upper-left (y1,x1) and lower-right (y2,x2) coordinates of the area of the screen to
be marked as unknown. Valid values range from 0 to the line or position limit of the
screen. Passing zero values mark the entire screen as being unknown. See the
“C$Forget” section in Appendix F, Subprogram Library, for more information.
• RmRefreshCwd(). This function causes the COBOL runtime system to refresh its
internal copy of the current working directory. This internal copy is used to construct
complete file names from any filename that is not fully qualified. This function
should be called before returning to the COBOL program if a non-COBOL
subprogram changes the current working directory with the chdir() C library routine.
The RmRefreshCwd() routine has no parameters and does not return a value.
The COBOL copy files that are supplied with an RM/COBOL development system
to facilitate Windows printing program development are described starting on
page E-44. Examples illustrating some common uses for the P$ subprograms begin
on page E-71.
In addition to the Windows printing subprogram library, this appendix also describes an
alternative means of printing under Windows using a set of RM/COBOL-specific escape
sequences (see page E-85).
P$ Subprogram Library
Note P$ subprogram names are case-insensitive. For readability, mixed case is used in
this document except in calling sequences and code fragments, where uppercase letters
are used.
The P$ subprograms can be logically grouped into the following categories that control:
• Drawing activities
• Text manipulation
Table E-1 lists the subprograms alphabetically within each of these categories.
Text Manipulation
Subprograms Function
P$ClearFont Clears font description values back to their default
(unset) state. See page E-24.
P$GetTextExtent Retrieves the bounding rectangle size for the text
passed to the function, calculated using the current font
size. The returned values can be used to draw boxes
around text. See page E-25.
P$GetTextMetrics Retrieves the characteristics of the current font.
See page E-25.
P$GetTextPosition Retrieves the ending position of the last print operation
adjusted to the top or bottom of the current font. See
page E-28.
P$SetDefaultAlignment Sets default alignment used in text positioning.
See page E-28.
P$SetFont Changes fonts for subsequent text print operations.
See page E-29.
P$SetLineExtendMode Concatenates output from two COBOL WRITE
statements on the same line. See page E-31.
P$SetPitch Sets normal, compressed, or expanded font pitch.
See page E-31.
P$SetTabStops Sets the tab stop increment. See page E-32.
P$SetTextColor Sets the color for text output. See page E-32.
P$SetTextPosition Sets a new position for the next print operation
adjusted from the top or bottom of the current font.
See page E-33.
P$TextOut Allows the program to control the position of the text.
This provides an alternative to using the COBOL
WRITE to print text. See page E-34.
Common Drawing and Text
Manipulation Subprograms Function
P$SetDefaultMode Sets default mode used in positioning and sizing
parameters. See page E-35.
P$SetDefaultUnits Sets default unit of measurement in positioning and
sizing parameters. See page E-36.
P$SetLeftMargin Sets left margin for subsequent printer output.
See page E-36.
P$SetTopMargin Sets the top margin for subsequent printer output.
See page E-37.
Printer Control
Subprograms Function
P$ChangeDeviceModes Changes device mode (DEVMODE) values for the
standard Windows Print dialog box. Values take effect
beginning with the next page. See page E-37.
P$EnableEscapeSequences Enables RM/COBOL-specific escape sequences.
See page E-38.
P$GetDeviceCapabilities Retrieves the device capabilities of a P$ printer. See
page E-39.
P$GetHandle Retrieves the handle of the current P$ printer.
See page E-41.
P$GetPrinterInfo Retrieves detailed information about a P$ printer.
See page E-41.
P$SetHandle Changes the current P$ printer. See page E-43.
P$SetRawMode Bypasses Windows printer drivers, enabling printing
with escape sequences to a remote Windows NT
printer. See page E-43.
Overview
Prior to version 7 of RM/COBOL for Windows, a COBOL Windows application had
limited control of printing, as printer and font selection could only be specified using a
configuration record. The RM/COBOL 7 for Windows runtime provides enhanced
capabilities and flexibility when printing under Windows.
A new predefined printer device, “PRINTER?”, has been added to the RM/COBOL
runtime (see page 10-19). When this device is opened, a standard Windows Print dialog
box, as shown in Figure E-1, is presented to the user to allow dynamic selection of the
Windows printer.
A broad range of COBOL callable subprograms (P$) has been added to the runtime to
allow printer control, font control, drawing of bitmaps, lines, and boxes, color control,
positioning of printed objects, and other print-related functions.
These new functions can be applied to a single printer or, if the application uses multiple
printers, a printer “handle” is available to allow selection of an open printer on which
subsequent P$ subprograms will operate. The printer handle can be ignored by the
application if it opens only one printer at a time.
Note Some of the more advanced printer functions require knowledge of Windows
printing structures. Only limited documentation is given here because it is assumed that
the developer who requires advanced functions has access to the appropriate Windows
documentation.
WARNING Due to differences among printers and printer drivers, output produced
using P$ subprograms can vary from printer to printer. To avoid surprises after
application deployment, test your application on printers that you plan to support.
1. Open a printer that selects the “PRINTER?” device using the standard COBOL
OPEN statement.
This allows the end-user to choose the desired P$ printer.
2. Optionally retrieve the printer handle by calling P$GetHandle (see page E-41).
Disregard this step if the application does not open more than one printer at a time.
3. Call various P$ subprograms to control the font, orientation, color, position, and so
on, of printed text or drawing objects.
If more than one printer is opened at one time, call the P$SetHandle subprogram
(see page E-43) to switch between them.
• Position. XPosition, YPosition, XPoint, and YPoint arguments can be any COBOL
numeric data type. The default value for these arguments is the current position. An
XPosition or XPoint argument must have a corresponding YPosition or YPoint
argument, respectively.
Note 1 For any of the P$Get subprograms receiving a Position argument, the
format of the receiving field's PICTURE clause varies, depending on the type of
Units being used. If Units is “Device-Units”, the format of the PICTURE clause
must be PIC S9(10). If Units is “Characters”, the format of the PICTURE clause
must be PIC S9(3). If Units is “Inches” or “Metric”, the format of the PICTURE
clause must be PIC S99v99.
Note 2 Position 0,0 is the upper-left corner of the printable area of the page.
• Size. Size arguments can be any COBOL numeric data type. Size arguments are
used to specify the width (SizeWidth) and height (SizeHeight) of objects. Except
when used with P$DrawBitmap (see page E-19), Size arguments have default
values of 1 for width and 1 for height.
Note For any of the P$Get subprograms receiving a Size argument, the format
of the receiving field's PICTURE clause varies, depending on the type of Units
being used. If Units is “Device-Units”, the format of the PICTURE clause must
be PIC 9(10). If Units is “Characters”, the format of the PICTURE clause must be
PIC 9(3). If Units is “Inches” or “Metric”, the format of the PICTURE clause must
be PIC 99v99.
• Amount and Increment. Amount and Increment arguments can be any COBOL
numeric data type. These arguments specify the value of an argument used in
subprogram calls.
• Units. Units arguments can be any alphabetic or alphanumeric COBOL data type.
Units arguments allow the application to select one of four units of measurement:
“Inches”, “Metric”, “Characters”, and “Device-Units”. “Inches” are expressed in
inches with 2.5 meaning 2½ inches and have precision to 1/1000th of an inch.
“Metric” is expressed in centimeters and has precision to 1/1000th of a centimeter.
“Characters” are expressed in character cell row/column position (computed using
the current font). “Device-Units” are expressed in the low-level Windows device
unit measurement. The default value for Units is “Inches” unless changed by the
P$SetDefaultUnits call (see page E-36). Only the first letter of the value is relevant,
and it is case-insensitive. Possible values are contained in the WINDEFS.CPY copy
file (see page E-69).
2. RGB (Red, Green, Blue) triplet method. These values may be any COBOL
numeric data items. Possible values for each data item are 0 through 255. See
Table E-2 for a list of default colors to use with RM/COBOL. Note that if you
use the RGB triplet method, you must specify a value for all three colors.
The calling COBOL program may omit arguments by passing fewer arguments than
expected or passing the reserved word, OMITTED, for one or more arguments. The
following example illustrates how the OMITTED keyword may be used with P$
subprograms.
This example causes the next drawn object to appear at the specified coordinates. The
Mode argument (see the “Common P$ Subprogram Arguments” topic on page E-7) has
been omitted, which causes the RM/COBOL runtime to use the default value for Mode.
Note 1 P$GetDialog and P$SetDialog use the printer dialog/device mode parameters
listed in Table E-3. In this table, the fields listed in the “Parameter Name” column
represent the string that must be passed to the P$ subprograms that use the
ParameterName/Value pairs calling sequence, which allows parameters to be set or
changed individually. Possible values are provided in the 78-level entries in the
PRINTDLG.CPY copy file, described on page E-51.
The description in the “PICTURE Clause” column indicates whether the field is numeric
or alphanumeric and its required number of digits or characters. When setting values
using P$SetDialog with the ParameterName/Value pairs calling sequence, there is no
minimum requirement on the number of digits or characters. When retrieving values
using P$GetDialog with the ParameterName/Value pairs calling sequence, the PICTURE
may specify BINARY and must specify at least the number of digits or characters shown.
Note 2 Some user selections in the Windows Print dialog box must be acted on by the
COBOL application, while others will be handled automatically by the device driver.
Still other user selections will vary from driver to driver. See “Printing Multiple Copies”
on page E-13 and “Printing Partial Reports” on page E-14 for more information.
PICTURE
Parameter Name Clause Description
Return PIC X Standard Windows Print dialog box status:
Y = OK
N = An error occurred (see Extended
Error below).
Extended Error PIC 9(5) Extended error code. See
PD-ExtendedErrorValue in
PRINTDLG.CPY (page E-51) for details.
All Pages Flag PIC X “All” radio button is selected.
Selection Flag PIC X “Selection” radio button is selected. See
“Printing Partial Reports” on page E-14.
Page Numbers Flag PIC X “Pages” radio button is selected.
No Selection Flag PIC X Disables the “Selection” radio button.
No Page Numbers Flag PIC X Disables the “Pages” radio button.
Collate Flag PIC X “Collate” check box is checked.
Print Setup Flag PIC X Displays the Print Setup dialog box rather
than the Print dialog box. The Print dialog
box has Print Range and Copies features
that are replaced by Paper and Orientation
features in the Print Setup dialog box.
Print to File Flag PIC X “Print to File” check box is checked.
No Warning Flag PIC X Prevents the warning message from being
displayed when there is no default printer.
Use Device Mode Copies Flag PIC X Indicates whether your application
supports multiple copies and collation.
See “Printing Multiple Copies” on
page E-13.
Disable Print to File Flag PIC X Disables the “Print to File” check box.
Hide Print to File Flag PIC X Hides the “Print to File” check box.
No Network Button Flag PIC X Hides and disables the “Network” button.
From Page PIC 9(5) First page to print.
To Page PIC 9(5) Last page to print.
Min Page PIC 9(5) Minimum value for From Page and To
Page. If Min Page equals Max Page, the
“Pages” radio button and the starting and
ending page edit controls are disabled. See
“Printing Partial Reports” on page E-14.
PICTURE
Parameter Name Clause Description
Max Page PIC 9(5) Maximum value for From Page and To
Page. See “Printing Partial Reports” on
page E-14.
Print Dialog Copies PIC 9(5) Initial number of copies for the Copies edit
control. If a value is specified for Device
Name (or any of the parameters following
Device Name in this table), the value
specified for Device Mode Copies
overrides the value specified for Print
Dialog Copies. See “Printing Multiple
Copies” on page E-13.
Device Name PIC X(31) Name of the printer selected by the user.
Fields Group Note This parameter is not available
when using the ParameterName/Value
pairs calling sequence because the pairs
calling sequence automatically sets the
appropriate Fields bits when setting Device
Mode fields. The Fields parameter is
available when using the
PrinterDialogDescription group data item
calling sequence. The developer is
responsible for setting the appropriate
Fields bits.
Orientation PIC 9(5) Portrait versus landscape.
Paper Size PIC 9(5) The size of the paper.
Paper Length PIC 9(5) Length of the paper (overrides Paper Size).
Paper Width PIC 9(5) Width of the paper (overrides Paper Size).
Scale PIC 9(5) Scale factor applied while printing,
expressed as a percentage. For example,
50 would print text and graphics at 50% of
their specified height and width.
Device Mode Copies PIC 9(5) The number of copies to print (overrides
Print Dialog Copies). See “Printing
Multiple Copies” on page E-13.
Default Source PIC 9(5) The default paper bin.
Print Quality PIC S9(5) High, medium, low, or draft.
Color PIC 9(5) Color versus monochrome.
Duplex PIC 9(5) One-sided versus two-sided printing.
PICTURE
Parameter Name Clause Description
Y Resolution PIC 9(5) Y-resolution of the printer specified in
dots-per-inch. If this parameter is set,
Print Quality specifies the X-resolution of
the printer in dots-per-inch.
True Type Option PIC 9(5) TrueType® rendering options.
Collate PIC X True or False. See “Printing Multiple
Copies” on page E-13.
ICM Method PIC 9(10) System-specific. See Microsoft
documentation.
ICM Intent PIC 9(10) System-specific. See Microsoft
documentation.
Media Type PIC 9(10) System-specific. See Microsoft
documentation.
Dither Type PIC 9(10) System-specific. See Microsoft
documentation.
Not all printers, however, can print multiple copies. If the printer driver does not support
printing multiple copies, the “Copies” edit control on the standard Windows Print dialog
box (see Figure E-1 on page E-5) will be disabled. Similarly, if the printer driver does
not support collation, the “Collate” check box will be disabled. After the printer is
opened or the standard Windows Print dialog box is displayed, the application may use
P$GetDialog (see page E-17) to retrieve values set by the user in the Windows Print
dialog box. The application developer should first check the return information provided
by P$DisplayDialog (see page E-16) or by P$GetDialog to determine whether or not
the user canceled the Print dialog box. If the application set PD-UseDevModeCopiesFlag
to TRUE, P$GetDialog will return PD-Copies with a value of one and PD-CollateFlag
set to FALSE.
To preset the number of copies in the Windows Print dialog box to a number other than
one, the application should set DM-Copies to the desired number and, if not using the
ParameterName/Value pairs method, set DM-CopiesField to TRUE.
After the printer is opened or the Windows Print dialog box is displayed, the DM-Copies
and DM-CollateValue data items (obtained from P$GetDialog) contain the copies and
collate information used by the printer driver. If the PD-UseDevModeCopiesFlag is set
to FALSE, DM-Copies will contain the number of copies the printer will print, and
DM-CollateValue will be zero (FALSE). If the PD-UseDevModeCopiesFlag is set to
TRUE and the printer driver supports multiple copies, DM-Copies will contain the
number of copies requested by the user and, if the printer driver supports collation,
DM-CollateValue will indicate whether the user wants collation.
Remember, fields in the DEVMODE portion of the PRINTDLG.CPY copy file (that is,
those fields that begin with the DM- prefix) are meaningful only if the associated item in
DM-Fields is set to TRUE. Therefore, it is necessary to set the appropriate item in
DM-Fields in addition to setting such values as DM-Copies. Similarly, the application
should check the appropriate item in DM-Fields before referencing the associated item
after calling P$GetDialog. When using the ParameterName/Value pairs method,
although it is not necessary to set DM-Fields before using P$SetDialog (see page E-18),
it is necessary to check the Validity-Flag when using P$GetDialog.
The example code fragment, “Presetting the Print Dialog Box” on page E-75, illustrates
the proper way to set fields before calling P$SetDialog.
If the application does support generating partial reports (that is, the
PD-NoPageNumbersFlag is set to FALSE), the application should set PD-MinPage and
PD-MaxPage to specify the minimum and maximum values, respectively, allowed for the
page range specified in the From and To page edit controls. If PD-MinPage and
PD-MaxPage have the same value, the Pages radio button and the starting and ending
page edit controls are disabled. The application may specify the initial starting and
ending pages with PD-FromPage and PD-ToPage. These values must be within the range
of PD-MinPage and PD-MaxPage. If the user selects the Pages radio button, then the
PD-PageNumberFlag will be set to TRUE when the application calls P$GetDialog to
determine what the user selected. Remember to first check the return information
provided by P$DisplayDialog (see page E-16) or by P$GetDialog (see page E-17) to
determine whether or not the user canceled the Print dialog box. If the user selected a
range of pages to print, the range will be returned by P$GetDialog in the PD-FromPage
and PD-ToPage fields. It is then the application’s responsibility to generate only
those pages.
P$ClearDialog
P$ClearDialog is used to clear the standard Windows Print dialog box values back to
their default (unset) state.
For an example that includes P$ClearDialog, see “Presetting the Print Dialog Box” on
page E-75.
Calling Sequence
CALL "P$CLEARDIALOG"
For an example that includes P$DisplayDialog, see “Checking the Return Code After
Displaying the Print Dialog Box” on page E-76.
Calling Sequence
DialogReturn is a COBOL data item that receives the results of the Windows Print
dialog box return value. This allows the application to determine whether the dialog
was dismissed using the OK or Cancel button, or by an error condition. Possible
values are contained in the 78-level entries in the copy file, PRINTDLG.CPY under
the heading, “P$DisplayDialog Return Values.”
P$EnableDialog
P$EnableDialog is used to control the automatic invoking of the standard Windows Print
dialog box when opening a “PRINTER?” device. Normally, the Print dialog box is
presented only the first time a dynamic printer is opened. Calling P$EnableDialog causes
the Print dialog box to appear the next time a “PRINTER?” device is opened. See also
the discussion of “PRINTER?” on page 10-19.
For an example that includes P$EnableDialog, see “Opening and Writing to Separate
Printers” on page E-80.
Calling Sequence
CALL "P$ENABLEDIALOG"
Calling Sequences
ParameterName is an alphanumeric data item that contains the name of the printer
dialog or device mode parameter to get (see Table E-3 on page E-11).
Value is a COBOL data item used to get the value of the parameter named by
ParameterName. Possible values are contained in the 78-level entries in the copy
file, PRINTDLG.CPY.
Validity-Flag is a returned numeric data item that indicates the validity of the
returned parameter value. A non-zero value indicates a valid parameter.
Note For a more complete discussion of printer dialog and device mode parameters, see
the Microsoft Windows documentation for the PRINTDLG and DEVMODE structures.
For web site information, see page E-51.
The two calling sequences for this subprogram allow parameters to be set either
individually or collectively. Setting parameters individually using ParameterName/Value
pairs allows multiple calls to the subprogram to accumulate values for the standard
Windows Print dialog box. Setting parameters collectively using the
PrinterDialogDescription group data item sets all values, after which the
ParameterName/Value method can be used to modify values.
For examples that include P$SetDialog, see “Presetting the Print Dialog Box” on
page E-75 and “Checking the Return Code After Displaying the Print Dialog Box” on
page E-76.
Calling Sequences
ParameterName is an alphanumeric data item that contains the name of the printer
dialog or device mode parameter to set (see Table E-3 on page E-11).
Value is a COBOL data item used to set the value of the parameter named by
ParameterName. Possible values are contained in the 78-level entries in the copy
file, PRINTDLG.CPY.
Note For a more complete discussion of printer dialog and device mode parameters, see
the Microsoft Windows documentation for the PRINTDLG and DEVMODE structures.
For web site information, see page E-51.
• P$DrawBitmap • P$MoveTo
• P$DrawBox • P$SetBoxShade
• P$DrawLine • P$SetPen
• P$GetPosition • P$SetPosition
• P$LineTo
P$DrawBitmap
P$DrawBitmap is used to print a bitmap file from an existing Windows bitmap file. For
an example that includes this subprogram, see “Printing a Bitmap” on page E-77.
Calling Sequence
Filename can be any alphabetic or alphanumeric COBOL data type. It specifies the
pathname of the Windows bitmap file to draw.
SizeWidth and SizeHeight are the values used to determine the size of the bitmap. If
you specify a value for SizeWidth, you must also specify a value for SizeHeight. A
value of 0,0 indicates that the new bitmap should be the same size as the original
bitmap. A value of 0 in one position but not in the other indicates that the new
bitmap should be scaled to match the proportions of the original bitmap. For
example, a non-zero SizeWidth value specifies the width and requests that SizeHeight
be determined by the original width/height ratio.
Calling Sequence
ShadeYesNo is an alphanumeric data item that specifies a yes/no value (see Yes/No in
“Common P$ Subprogram Arguments”). It specifies whether or not to shade the
interior of the box using the current box shading color (set with P$SetBoxShade,
described on page E-22).
P$DrawLine
P$DrawLine is used to draw a line. For an example that includes P$DrawLine, see
“Drawing a Ruler” on page E-74.
Calling Sequence
For an example that includes P$GetPosition, see “Setting Text Position” on page E-84.
Calling Sequence
P$LineTo
P$LineTo is used to draw a line starting at the current position.
For an example that includes P$LineTo, see “Drawing a Ruler” on page E-74.
Calling Sequence
For an example that includes P$MoveTo, see “Drawing a Ruler” on page E-74.
Calling Sequence
P$SetBoxShade
P$SetBoxShade is used to set color and density of the color used in P$DrawBox (see
page E-20) calls.
For an example that includes P$SetBoxShade, see “Drawing Shaded Boxes with Colors”
on page E-73.
Calling Sequence
For an example that includes P$SetPen, see “Drawing Shaded Boxes with Colors” on
page E-73.
Calling Sequence
Style can be any COBOL numeric data type. It specifies the style of the pen.
Possible values are contained in the WINDEFS.CPY copy file (see page E-69).
Width can be any COBOL numeric data type. It specifies the pen width in logical
units. If Width is zero, the pen is a single pixel wide. The default value is 1.
Note If you specify a Width value greater than 1 for the pen styles, Dash, Dot,
DashDot, or DashDotDot, Windows will force Style to a value of Solid.
P$SetPosition
P$SetPosition is used to set a position for the next print operation.
For examples that include P$SetPosition, see “Drawing a Box Around Text” on
page E-73 and “Setting Text Position” on page E-84.
Calling Sequence
• P$ClearFont • P$SetLineExtendMode
• P$GetTextExtent • P$SetPitch
• P$GetTextMetrics • P$SetTabStops
• P$GetTextPosition • P$SetTextColor
• P$SetDefaultAlignment • P$SetTextPosition
• P$SetFont • P$TextOut
P$ClearFont
P$ClearFont clears the font description values that were set using the P$SetFont
subprogram (see page E-29) and returns them to their default (unset) state. This
subprogram can be used to clear previous values before calling P$SetFont using the
ParameterName/Value method to set information for a new font.
Calling Sequence
CALL "P$CLEARFONT"
For examples that include P$GetTextExtent, see “Drawing a Box Around Text” on
page E-73, “Printing Text at the Top of a Page” on page E-81, and “Printing Text at the
Corners of a Page” on page E-82.
Calling Sequence
Text can be any alphabetic or alphanumeric COBOL data type, where n must be at
least 1. It specifies the text to use in calculating the bounding rectangle.
P$GetTextMetrics
P$GetTextMetrics is used to retrieve the characteristics of the current font. Figure E-2
illustrates some of these characteristics.
For examples that include P$GetTextMetrics, see “Drawing a Box Around Text” on
page E-73 and “Setting the Point Size for a Font” on page E-83.
Note The values retrieved by P$GetTextMetrics are available after opening a P$ printer.
All values returned by P$GetTextMetrics are in device units.
Calling Sequences
ParameterName is an alphanumeric data item that contains the name of the font
parameter to get (see Table E-4).
Value is a COBOL data item used to receive the value of the parameter named by
ParameterName. Possible values are contained in the 78-level entries in the copy
file, TXTMTRIC.CPY.
Note For a more complete discussion of text metric parameters, see the Microsoft
Windows documentation for the TEXTMETRIC structure. For web site information, see
page E-65.
For examples that include P$GetTextPosition, see “Drawing a Box Around Text” on
page E-73 and “Setting Text Position” on page E-84.
Calling Sequence
Note The P$GetPosition subprogram (see page E-21) returns the ending “baseline”
position. P$GetTextPosition should be used when you need the ascender line (top) or
descender line (bottom) position of the current font.
P$SetDefaultAlignment
P$SetDefaultAlignment is used to set default alignment used in text positioning. Possible
values are “Top” and “Bottom”. The initial value is “Top”.
Calling Sequence
The two calling sequences for this subprogram allow parameters to be set either
individually or collectively. Setting parameters individually using ParameterName/Value
pairs allows multiple calls to the subprogram to accumulate values for the desired font.
Setting parameters collectively using the LogicalFontDescription group data item sets all
values, after which the ParameterName/Value method can be used to modify values.
For examples that include this subprogram, see "Printing a Watermark" on page E-73,
“Changing a Font While Printing” on page E-77, "Using the COBOL WRITE Statement
to Print Multiple Text Outputs on the Same Line" on page E-78, “Setting the Point Size
for a Font” on page E-83, and “Setting Text Position” on page E-84.
Note The values set by P$SetFont are available to P$GetTextMetrics (see page E-25)
after the OPEN for the printer. You can use P$ClearFont (see page E-24) to clear the
existing font description before calling P$SetFont using the ParameterName/Value
method to set information for a new font.
Calling Sequences
ParameterName is an alphanumeric data item that contains the name of the font
parameter to set (see Table E-5).
Value is the COBOL data item used to set the value of the parameter named by
ParameterName. Possible values are contained in the 78-level entries in the copy
file, LOGFONT.CPY.
Note For a more complete discussion of font attribute parameters, see the Microsoft
Windows documentation for the LOGFONT structure. For web site information, see
page E-47.
COBOL
Parameter Name Data Type Description
Height Any numeric Font height in logical units.
Width Any numeric Average font width in logical units.
Escapement Any numeric Angle, in tenths of degrees, for a string of
characters (relative to the X-axis of the device).
Orientation Any numeric Angle, in tenths of degrees, for individual
characters (relative to the X-axis of the device).
Weight Any numeric Font weight in the range 0 through 1000. For
example, 400 is normal and 700 is bold. If this
value is zero, a default weight is used.
Italic Any alphabetic or ‘Y’ if italic font; ‘N’ otherwise.
alphanumeric
Underline Any alphabetic or ‘Y’ if underlined font; ‘N’ otherwise.
alphanumeric
Strike Out Any alphabetic or ‘Y’ if “struck-out” font; ‘N’ otherwise.
alphanumeric
Char Set Any numeric Specifies the character set.
Out Precision Any numeric Specifies the output precision for font matching.
Clip Precision Any numeric Specifies the clipping precision for font
matching.
Quality Any numeric Specifies the output quality for font matching.
Pitch Any numeric Pitch of the font.
Family Any numeric Family of the font.
Face Name Any alphabetic or Windows typeface name.
alphanumeric
For an example that includes P$SetLineExtendMode, see “Using the COBOL WRITE
Statement to Print Multiple Text Outputs on the Same Line” on page E-78.
Calling Sequence
SpaceAmount can be any COBOL numeric data type. It specifies the amount of
space to leave between the two sets of output. The default value is 0.
P$SetPitch
P$SetPitch is used to set normal, compressed, or expanded font pitch.
For an example that includes P$SetPitch, see “Changing Orientation and Pitch” on
page E-79.
Calling Sequence
P$SetTabStops
P$SetTabStops sets the increment used for computing the next tab stop location. Tabs are
sent using the Horizontal Tab escape sequence (see Table E-9 on page E-85).
Calling Sequence
P$SetTextColor
P$SetTextColor is used to set the color of text for subsequent P$TextOut (see page E-34)
and COBOL WRITE statements.
For an example that includes P$SetTextColor, see “Printing a Watermark” on page E-73.
Calling Sequence
For examples that include P$SetTextPosition, see “Printing Text at the Top of a Page” on
page E-81, “Printing Text at the Corners of a Page” on page E-82, and “Setting Text
Position” on page E-84.
Calling Sequence
Note 1 The P$SetPosition subprogram (see page E-23) should be used to set the
“baseline” for the next text print operation.
Note 2 To print a line of text in the top left corner of a page, without cutting off the top
of the characters, call P$SetTextPosition specifying a value of “Top” for Alignment. To
print a line of text in the bottom left corner of a page without cutting off the bottom of the
characters, call P$SetTextPosition specifying a value of “Bottom” for Alignment.
For examples that include P$TextOut, see “Drawing a Box Around Text” on page E-73,
“Changing a Font While Printing” on page E-77, “Changing Orientation and Pitch”
on page E-79, “Opening and Writing to Separate Printers” on page E-80, “Printing Text
at the Top of a Page” on page E-81, “Printing Text at the Corners of a Page” on
page E-82, and “Setting Text Position” on page E-84.
Calling Sequence
Text can be any COBOL alphanumeric data item. It specifies the text to be printed.
BoxYesNo can be any COBOL alphanumeric data item that specifies a yes/no value
(see Yes/No in “Common P$ Subprogram Arguments”). It specifies whether or not to
draw a box around the text.
ShadeYesNo can be any COBOL alphanumeric data item that specifies a yes/no value
(see Yes/No in “Common P$ Subprogram Arguments”). It specifies whether or not to
shade the interior of the box using the current box shading color (set with
P$SetBoxShade, described on page E-22).
P$SetDefaultMode
P$SetDefaultMode is used to control the default mode used in positioning and
sizing parameters. Possible values are “Relative” and “Absolute”. The initial value
is “Absolute”.
Calling Sequence
For an example that includes P$SetDefaultUnits, see “Drawing a Ruler” on page E-74.
Calling Sequence
P$SetLeftMargin
P$SetLeftMargin is used to set a left margin (offset from left side of paper) for
subsequent COBOL WRITE statements. This margin will be cleared to zero at the
next page boundary. This subprogram is useful for generating columns of text.
Calling Sequence
Calling Sequence
• P$ChangeDeviceModes • P$GetPrinterInfo
• P$EnableEscapeSequences • P$SetHandle
• P$GetDeviceCapabilities • P$SetRawMode
• P$GetHandle
P$ChangeDeviceModes
P$ChangeDeviceModes changes the device mode (DEVMODE) values for the standard
Windows Print dialog box. The new values take effect beginning with the next page.
This subprogram is used for such tasks as changing the paper source or the orientation
of paper.
The two calling sequences for this subprogram allow parameters to be set either
individually or collectively. Setting parameters individually using ParameterName/Value
pairs allows multiple calls to the subprogram to accumulate values for the standard
Windows Print dialog box (see page E-5). Setting parameters collectively using the
PrinterDialogDescription group data item sets all values, after which the
ParameterName/Value method can be used to modify values.
Calling Sequences
ParameterName is an alphanumeric data item that contains the name of the printer
dialog/device mode parameter to set (see Table E-3 on page E-11).
Value is the COBOL data item used to set the value of the parameter named by
ParameterName. Possible values are contained in the 78-level entries in the copy
file, PRINTDLG.CPY.
Note For a more complete discussion of device mode parameters, see the Microsoft
Windows documentation for the DEVMODE structure. For web site information, see
page E-51.
P$EnableEscapeSequences
P$EnableEscapeSequences is used to enable RM/COBOL-specific escape sequences,
as described on page E-85. (This subprogram is used in conjunction with the
ESCAPE-SEQUENCES keyword of the DEFINE-DEVICE configuration record.
See page 10-17 for more information.)
Calling Sequence
CALL "P$EnableEscapeSequences"
The two calling sequences for this subprogram allow parameters to be retrieved either
individually or collectively. You can retrieve parameters individually using
ParameterName/Value pairs. Retrieve parameters collectively using the
DeviceCapabilitesDescription group data item.
For examples that include P$GetDeviceCapabilities, see “Setting the Point Size for a
Font” on page E-83, “Printing Text at the Top of a Page” on page E-81, and “Printing
Text at the Corners of a Page” on page E-82.
Calling Sequences
ParameterName is an alphanumeric data item that contains the name of the device
capability parameter (see Table E-6).
Value is the COBOL data item used to receive the value of the parameter named by
ParameterName. Possible values are contained in the 78-level entries in the copy
file, DEVCAPS.CPY.
Note For a more complete discussion of device capability parameters, see the Microsoft
Windows documentation for the GetDeviceCaps function. For web site information, see
page E-45.
Calling Sequence
Handle is a PICTURE 9(2) numeric data item. It specifies the variable to receive the
handle of the current P$ printer.
P$GetPrinterInfo
P$GetPrinterInfo is used to retrieve detailed information about a P$ printer.
The two calling sequences for this subprogram allow parameters to be retrieved either
individually or collectively. You can retrieve parameters individually using
ParameterName/Value pairs. Retrieve parameters collectively using the
PrinterInfoDescription group data item.
Calling Sequences
ParameterName is an alphanumeric data item that contains the name of the device
capability parameter to get (see Table E-7).
Note For a more complete discussion of printer information parameters, see the
Microsoft Windows documentation for the PRINTER_INFO_2 structure. For web site
information, see page E-62.
Table E-7 Printer Information Parameters
For an example that includes P$SetHandle, see “Opening and Writing to Separate
Printers” on page E-80.
Calling Sequence
Handle can be any COBOL numeric data item. It specifies the variable that contains
the handle of the printer to use in subsequent P$ calls.
P$SetRawMode
P$SetRawMode is used to set a raw mode output when the next printer is opened.
This subprogram allows completely raw byte-stream I/O in applications that require it.
It is intended to be used when a user is having problems sending escape sequences to
networked printers on a Windows NT server. The RAW keyword of the
DEFINE-DEVICE configuration record (see page 10-17) or the Printer Enable Raw
Mode property (see page 3-26) may also be used to set raw mode output for a printer.
Only the following P$ subprograms can be used for a raw mode printer:
• P$ClearDialog (see page E-13) • P$GetDeviceCapabilities (see page E-39)
• P$DisplayDialog (see page E-16) • P$GetHandle (see page E-41)
• P$EnableDialog (see page E-16) • P$GetPrinterInfo (see page E-41)
• P$GetDialog (see page E-17) • P$SetHandle (see page E-43)
• P$SetDialog (see page E-18)
Calling Sequence
CALL "P$SETRAWMODE"
WARNING We strongly recommend that you do not change these Liant-supplied copy
files, as unpredictable results may occur if the copy files are changed incorrectly. If you
must alter the files, please be aware that the names of the data items are the only thing that
can be changed. Do not alter the pictures, types, sizes, or order of the data items.
The following search tree was accurate when this document went to print:
Platform SDK
Graphics and Multimedia Services
Windows GDI
Device Contexts
Device Context Reference
Device Context Functions
GetDeviceCaps
The following search tree was accurate when this document went to print:
Platform SDK
Graphics and Multimedia Services
Windows GDI
Fonts and Text
Font and Text Reference
Font and Text Structures
LOGFONT
PRINTDLG.CPY
Information regarding the Microsoft Windows PRINTDLG and DEVMODE structures
can be found on the Internet at http://msdn.microsoft.com/library/. Periodically,
Microsoft reorganizes the MSDN information on the web site. Use the search capability
to find information on the requested topic.
The following search trees were accurate when this document went to print:
For PRINTDLG:
Platform SDK
User Interface Services
Windows User Interface
User Input
Common Dialog Box Library
Common Dialog Box Reference
Common Dialog Box Structures
PRINTDLG
Platform SDK
Graphics and Multimedia Services
Windows GDI
Printing and Print Spooler
Printing and Print Spooler Reference
Printing and Print Spooler Structures
DEVMODE
The following search tree was accurate when this document went to print:
Platform SDK
Graphics and Multimedia Services
Windows GDI
Printing and Print Spooler
Printing and Print Spooler Reference
Printing and Print Spooler Structures
PRINTER_INFO_2
TXTMTRIC.CPY
Information regarding the Microsoft Windows TEXTMETRIC structure can be found on
the Internet at http://msdn.microsoft.com/library/. Periodically, Microsoft reorganizes the
MSDN information on the web site. Use the search capability to find information on the
requested topic.
The following search tree was accurate when this document went to print:
Platform SDK
Graphics and Multimedia Services
Windows GDI
Fonts and Text
Font and Text Reference
Font and Text Structures
TEXTMETRIC
WINDEFS.CPY
Information regarding the Microsoft Windows PlaySound function and LOGPEN
structure can be found on the Internet at http://msdn.microsoft.com/library/. Periodically,
Microsoft reorganizes the MSDN information on the web site. Use the search capability
to find information on the requested topic.
The following search trees were accurate when this document went to print:
For PlaySound:
Platform SDK
Graphics and Multimedia Services
Windows Multimedia
Multimedia Reference
Multimedia Functions
PlaySound
For LOGPEN:
Platform SDK
Graphics and Multimedia Services
Windows GDI
Pens
Pen Reference
Pen Structures
LOGPEN
To See Example
Change a font while printing Changing a Font While Printing (see page E-77)
Change the print orientation Presetting the Print Dialog Box (see page E-75) and
Changing Orientation and Pitch (see page E-79)
Change the pitch of a font Changing Orientation and Pitch (see page E-79)
Change the print resolution Presetting the Print Dialog Box (see page E-75)
Check the return code value Checking the Return Code After Displaying the Print
Dialog Box (see page E-76).
Draw a box around text Drawing a Box Around Text (see page E-73)
Draw a shaded box with colors Drawing Shaded Boxes with Colors (see page E-73)
Draw a box using “relative” Drawing Shaded Boxes with Colors (see page E-73)
positioning
Draw a ruler Drawing a Ruler (see page E-74)
Open three separate printers and Opening and Writing to Separate Printers (see
write to each one page E-80
Print text at corners of a page Printing Text at the Corners of a Page (see page E-82)
Print text at the top of a page Printing Text at the Top of a Page (see page E-81)
Print a bitmap file Printing a Bitmap (see page E-77)
Print multiple copies Presetting the Print Dialog Box (see page E-75)
Print multiple text outputs on the Using the COBOL WRITE Statement to Print Multiple
same line Text Outputs on the Same Line (see page E-78)
Print a word in italics Using the COBOL WRITE Statement to Print Multiple
Text Outputs on the Same Line (see page E-78)
Print a word in boldface type Using the COBOL WRITE Statement to Print Multiple
Text Outputs on the Same Line (see page E-78)
Print a word underlined Using the COBOL WRITE Statement to Print Multiple
Text Outputs on the Same Line (see page E-78)
Print a watermark Printing a Watermark (see page E-73)
Set the point size for a font Setting the Point Size for a Font (see page E-83)
Set text position Setting Text Position (see page E-84)
Drawing a Ruler
The following code fragment draws a 5-centimeter ruler.
Centimeter-Ruler.
MOVE 0.0 TO WS-X, WS-Y, WS-Y2.
MOVE 5.0 TO WS-X2.
MOVE 0 to WS-CENT-COUNT.
CALL "P$SETDEFAULTUNITS" USING "Metric".
END-PERFORM.
Note The example code fragment shown below sets the collate flag to false, that is,
printed pages will not be collated. Some printers do not support printing multiple
copies with the pages collated. For more information, see “Printing Multiple Copies”
on page E-13.
INITIALIZE PrintDialog.
CALL "P$CLEARDIALOG".
SET PD-AllPagesFlag TO TRUE. *>Sets All Pages
*>option on
SET PD-NoPageNumbersFlag TO TRUE. *>Disable Pages
*>option button and
*>associated edit
*>controls
SET PD-NoSelectionFlag TO TRUE. *>Disables Selection
*>button
SET PD-CollateFlag TO FALSE. *>Don’t check Collate
*>check box
SET PD-HidePrintToFileFlag TO TRUE. *>Hides Print To File
*>checkbox
SET DM-CopiesField TO TRUE.
MOVE 2 TO DM-Copies.
SET DM-OrientationField TO TRUE.
SET DM-OrientationIsLandscape TO TRUE.
SET DM-PrintQualityField TO TRUE.
SET DM-ResolutionIsHigh TO TRUE.
CALL "P$SETDIALOG" USING PrintDialog.
OPEN OUTPUT PFILE.
WRITE FD-RECORD FROM
"Example 5: Presetting the Printer Dialog Box Page 1"
AFTER PAGE.
WRITE FD-RECORD FROM
"Example 5: Text After CALLING P$SETDIALOG".
WRITE FD-RECORD FROM
"Example 5: This should be printed in landscape mode.".
WRITE FD-RECORD FROM
"Example 5: There should be two copies printed.".
CLOSE PFILE.
Evaluate True
When Dialog-OK *> Value zero
Display "OK Button Pressed" Line 13 Col 1
Perform Open-Printer-Para
When Dialog-Cancel *> Value one
Display "Cancel Button Pressed" Line 13 Col 1
Perform Printer-Canceled-Para
When Dialog-Error *> Value two
Display "Error in Dialog" Line 13 Col 1
Perform Printer-Error-Para
When Other *> Value other
Display "Invalid Value: " Line 13 Col 1 Dialog-Return
End-Evaluate.
STOP RUN.
Open-Printer-Para.
Open Output Printer-File.
Write Fd-Record From
"Checking the Printer Dialog Box " After Page.
Close Pfile.
Printer-Canceled-Para.
Display "Printer Dialog Canceled" Line 22 Col 3 Reverse Erase Eol.
Printer-Error-Para.
CALL "P$GetDialog" Using PD-ExtendedErrorParam,
PD-ExtendedErrorValue,
Validity-Flag.
If PD-ExtErrIsPrinterNotFound
Display "Printer Not Found!" Line 22 Col 3 Reverse
Erase Eol
Else
Display "Printer Dialog Had Error" Line 22 Col 3 Reverse
PD-ExtendedErrorValue Convert
Erase Eol
End-If.
Printing a word in Italic, Underline, or Bold on the same line is no problem with RM/COBOL.
INITIALIZE LogicalFont.
CALL "P$SETFONT" USING LF-HeightParam 50,
LF-WeightParam 10,
LF-FaceNameParam "Arial".
WRITE PRINT-RECORD FROM "Printing a word in".
CALL "P$SETLINEEXTENDMODE" USING 1, "Characters".
CALL "P$SETFONT" USING LF-ItalicParam, "Y".
WRITE PRINT-RECORD FROM "Italic", AFTER ADVANCING ZERO.
CALL "P$SETLINEEXTENDMODE" USING 1, "Characters".
CALL "P$SETFONT" USING LF-ItalicParam, "N", LF-UnderlineParam, "Y".
WRITE FD-RECORD FROM "Underline," AFTER ADVANCING ZERO.
CALL "P$SETLINEEXTENDMODE" USING 1, "Characters".
CALL "P$SETFONT" USING LF-WeightParam, LF-WeightBold,
LF-UnderlineParam, "N".
WRITE PRINT-RECORD FROM "or Bold" AFTER ADVANCING ZERO.
CALL "P$SETLINEEXTENDMODE" USING 1, "Characters".
CALL "P$SETFONT" USING LF-WeightParam, LF-WeightNormal.
WRITE PRINT-RECORD FROM
"on the same line is no problem with RM/COBOL."
AFTER ADVANCING ZERO.
CALL "P$ENABLEDIALOG".
OPEN OUTPUT PFILE2.
CALL "P$GETHANDLE" USING HANDLE-2.
CALL "P$ENABLEDIALOG".
OPEN OUTPUT PFILE3.
CALL "P$GETHANDLE" USING HANDLE-3.
Table E-9 lists the available printing functions and their escape sequences and options.
The “Options” column of the table describes the permissible values for certain variables
in an escape sequence that are represented by the characters #, ##, or ###. These
variables are always binary values, that is, they are not ASCII characters representing
the values.
Options
Function ASCII Decimal Hex (#, ##, or ###)
Reset <Esc>E 027 069 1B 45 Clears the margins, clears line
spacing, clears line extend mode,
resets text length, sets
page orientation back to portrait,
sets paper source back to
DMBIN_ONLYONE, and sets the
font back to default font.
Left <Esc>&a#L 027 038 097 ### 1B 26 61 ## Size of left margin, in characters
Margin 076 4C (calculated using current font).
Set Tab <Esc>&k#H 027 038 107 ### 1B 26 6B ## Horizontal increment in characters
Stops 072 48 (calculated using current font).
Line <Esc>&l#D 027 038 108 ### 1B 26 6C ## Lines per inch.
Spacing 068 44
Top Margin <Esc>&l#E 027 038 108 ### 1B 26 6C ## Size of top margin, in lines
069 45 (calculated using current font).
Text <Esc>&l#F 027 038 108 ### 1B 26 6C ## Length of page, in lines (calculated
Length 070 46 using current font).
Options
Function ASCII Decimal Hex (#, ### or ##)
Paper <Esc>&l#H 027 038 108 ### 1B 26 6C ## 1 - DMBIN_ONLYONE
Source 072 48 2 - DMBIN_LOWER
3 - DMBIN_MIDDLE
4 - DMBIN_MANUAL
5 - DMBIN_ENVELOPE
6 - DMBIN_ENVMANUAL
7 - DMBIN_AUTO
8 - DMBIN_TRACTOR
9 - DMBIN_SMALLFMT
10 - DMBIN_LARGEFMT
11 - DMBIN_LARGECAPACITY
14 - DMBIN_CASSETTE
15 - DMBIN_FORMSOURCE
Orientation <Esc>&l#O 027 038 108 ### 1B 26 6c ## 0 - Portrait
079 4F 1 - Landscape
Print Pitch <Esc>(s#H 027 040 115 ### 1B 28 73 ## Characters per horizontal inch.
072 48
Style <Esc>(s#S 027 040 115 ### 1B 28 73 ## 0 - Normal
083 53 1 - Italic
2 - Bold
4 - Underline
8 - Compressed
16 - Expanded
Font Height <Esc>(s#V 027 040 115 ### 1B 28 73 ## Characters per vertical inch.
086 56
Clear <Esc>9 027 057 1B 39 Clear left and top margin.
Margins
Null <NUL> 000 00 See Note below.*
Horizontal <HT> 009 09 Position to next tab stop.
Tab
Shift Out <SO> 014 0E Shifts normal font to expanded
font. Shifts compressed font to
normal. Stays in effect until start
of new line.
Shift In <SI> 015 0F Shifts normal font to compressed
font. Shifts expanded font to
normal font. Stays in effect until
start of new line.
Note RM/COBOL normally changes nulls to spaces before sending them to the printer.
This behavior may be changed by setting the property “Printer Enable Null Esc. Seq.”
value to Yes.
Note Subprogram names are case insensitive. For readability, mixed case is used in this
document when subprogram names are lengthy. Uppercase letters are used for short
subprogram names, in calling sequences, and in code fragments.
Subprogram Library
Table F-1 lists the subprograms alphabetically and gives a brief description.
Subprogram Function
C$Bitmap Sets the name of a bitmap file for a program.
C$BTRV Calls Btrieve directly from an RM/COBOL program.
C$CARG Returns information about a passed argument.
C$Century Facilitates updating RM/COBOL programs to handle the
year 2000.
C$ClearDevelopmentMode Disables expanded error information reporting (known as
“development mode”) for many of the C$ and P$
subprograms.
C$Delay Relinquishes the CPU for a specified length of time.
C$Forget Marks an area of the runtime system’s in-memory screen
image as unknown.
C$GetEnv Retrieves environment variables.
C$GetLastFileName Retrieves the last file used in a COBOL I/O statement.
C$GetLastFileOp Retrieves information about the last COBOL I/O operation.
C$GetRMInfo Retrieves RM/COBOL runtime system information.
C$GetSyn Retrieves the values of RM/COBOL synonyms from the
Windows registry file.
C$GetSysInfo Retrieves operating system information
Subprogram Function
C$GUICFG Changes the RM/COBOL graphical user interface (GUI)
properties.
C$MBar Sets the menu bar for a program.
C$MemoryAllocate Allocates dynamic memory.
C$MemoryDeallocate Deallocates (frees) dynamic memory.
C$NARG Returns the number of arguments passed to the called
subprogram.
C$OSLockInfo Returns the process ID of the process that performed the last
lock operation.
C$PlaySound Plays Windows predefined sound events or sound files.
C$RBMenu Sets the pop-up menu for a program that is displayed when
the right mouse button is pressed.
C$RERR Returns expanded completion status for the last I/O
operation.
C$SBar Sets the status bar for a program.
C$SCRD Allows the contents of the screen to be read into an
alphanumeric data item.
C$SCWR Allows the quick display of a large amount of screen data
containing various attributes.
C$SetDevelopmentMode Enables expanded error information reporting (known as
“development mode”) for many of the C$ and P$
subprograms.
C$SetEnv Sets environment variables.
C$SetSyn Sets the values of RM/COBOL synonyms in the Windows
registry file.
C$Show Sets the show state of the main RM/COBOL window.
C$ShowArgs Displays the list of arguments used to call C$ShowArgs.
C$TBar Sets the toolbar for a program.
C$TBarEn Enables and disables buttons on the toolbar.
C$TBarSeq Sets the bitmap sequence of buttons on the toolbar.
C$Title Sets the title displayed for the RM/COBOL window.
C$WRU Returns the location from which a subprogram was called.
SYSTEM Allows an arbitrary operating system command to be
executed.
To use this subprogram, the runtime system must be able to locate the c$bitmap.dll file.
The following example illustrates how to add this DLL to the Runtime Command line
with the L Option:
Calling Sequence
filename is an alphanumeric data item that contains the name of an existing Windows
bitmap (.bmp) file. The file will be located using the runtime system search path.
C$BTRV
C$BTRV is used to call Btrieve directly from an RM/COBOL program.
To use this subprogram, the runtime system must be able to locate the c$btrv.dll file. In
addition, Btrieve, available from Pervasive Software, must be installed on the computer.
Calling Sequence
opcode is any unsigned numeric data item that contains the desired Btrieve operation
code value.
Note This subprogram uses the CodeBridge parameter conversion facility for the four
numeric arguments to allow maximum flexibility in their definition. See the CodeBridge
documentation for more details.
Examples
The following is a typical DATA DIVISION description of the arguments (the data buffer
item can be any size that is appropriate for the operation being performed):
C$CARG
C$CARG returns information about the actual parameter that corresponds to a formal
parameter in the USING or GIVING phrases in the Procedure Division header of a
subprogram. This information identifies the type and length of the argument and, when
the argument is numeric, the number of digits and scale factor for the argument.
Calling Sequence
okay is a one-character alphanumeric data item into which the ASCII character Y is
stored if C$CARG successfully identifies the argument named by argument-name;
otherwise, the ASCII character N is stored in the data item.
argument-name is the name of a Linkage Section data item named in the Procedure
Division header USING list.
Note The argument-description group item will only have the correct length if
ARGUMENT-TYPE, ARGUMENT-DIGIT-COUNT, and ARGUMENT-SCALE
are allocated as two-byte binary and ARGUMENT-LENGTH is allocated as
four-byte binary. Use of the BINARY-ALLOCATION compiler configuration
keyword (see page 10-6) can change the allocation of binary numeric data items such
that this requirement is not met. For example, if BINARY-ALLOCATION=RM1,
the default allocation for a data item described with PIC 9(2) is one byte. The
example shown specifies a binary allocation override for each binary item to
guarantee the right allocation regardless of the configured binary allocation scheme.
The binary allocation override is not necessary if BINARY-ALLOCATION=RM.
The binary allocation override would also not be necessary for binary allocation
schemes RM1 and MF-RM if all three 9(2) entries were changed to 9(3) entries.
Note If a calling program passes a called program two arguments that begin at the same
location (either through redefinition, with reference modification, or because one is a
group that contains the other), when the called program asks C$CARG for the parameter
descriptions, it always receives that of the first actual argument passed.
Note A number of changes have been made to the Format 2 ACCEPT statement related
to improving the way dates and times are handled. These changes provide additional
ways of writing Y2K-compliant COBOL. New phrases include CENTURY-DATE,
CENTURY-DAY, DATE-AND-TIME, and DAY-AND-TIME. See the RM/COBOL
Language Reference Manual for more information.
Calling Sequence
value-buffer is a data item with a format of either unsigned numeric display (NSU) or
alphanumeric display (ANS).
C$ClearDevelopmentMode
C$ClearDevelopmentMode is used to disable expanded error information reporting
(known as “development mode”) for many of the C$ and P$ subprograms. (The P$
subprograms are discussed in Appendix E, Windows Printing.) When development mode
is enabled (see “C$SetDevelopmentMode” on page F-33), more verbose error reporting is
performed to assist the COBOL developer in implementing these subprogram calls.
Calling Sequence
CALL "C$CLEARDEVELOPMENTMODE"
Calling Sequence
C$Forget
C$Forget marks an area of the runtime system’s in-memory screen image as unknown.
The next COBOL output to the unknown area will not be optimized based on the screen
contents. This allows COBOL output to be displayed correctly over linked C subprogram
output, which is not stored in the in-memory screen image.
Calling Sequence
Linked C subprograms also can use C$Forget by calling RmForget() with four int
parameters specifying the area to be marked as unknown. (See the section “C Entry
Points For COBOL Functions” on page D-23 in Appendix D, Customizing RM/COBOL
for UNIX.)
C$GetEnv
C$GetEnv is used to retrieve the values of environment variables.
Calling Sequence
name is an alphanumeric data item that contains the name of the environment
variable to retrieve.
value is an alphanumeric data item that contains the value of the environment
variable upon return from the call.
return is a PICTURE 9(n) BINARY, where n can be a digit from 1 to 9. It is set to 0
if the call was successful and non-zero if it failed.
Calling Sequence
filename is an alphanumeric data item that will contain the COBOL file-name
specified in the most recently executed I-O statement. For REWRITE and WRITE
statements, the COBOL file-name associated with the specified file record-name is
provided. The alphanumeric data item should be 30 characters long. If the COBOL
file-name is longer than the length of the data item, it will be truncated on the right.
pathname is an alphanumeric data item that will contain the name of the last used
pathname (complete file-name). The value SPACES indicates that no name is
available (the last file used in an I/O operation was probably closed or no file has
been opened). The alphanumeric data item should be at least 64 characters long. If
the complete file access name is longer than the length of the data item, it will be
truncated on the right.
C$GetLastFileOp
C$GetLastFileOp is used to retrieve information about the last COBOL I/O operation
performed. The function returns the COBOL operation performed, and the line number
and the intraline number where the operation was done. The intended use of this library
subprogram is within a declarative procedure after an I/O error has occurred.
Calling Sequence
operation is an alphanumeric data item that will contain the name of the last COBOL
I/O operation performed (see the list below for possible values). The value SPACES
indicates that no operation is available (the file was probably never opened). The
• “Close” • “ReadRandom”
• “CloseUnit” • “Rewrite”
• “Delete” • “RewriteRandom”
• “DeleteFile”” • “Start”
• “DeleteRandom” • “Unlock”
• “Open” • “Write”
• “ReadNext” • “WriteRandom”
• “ReadPrevious”
prog-line is a BINARY data item with the picture PIC 9(6), which will contain the
line number of the most recent COBOL I/O operation. If the program that contains
the I/O operation was compiled with the Q Compile Command Option (see Chapter
6, Compiling), the value stored in prog-line is the segment offset of the statement.
Use the values from the Debug heading of the program listing to locate the statement.
prog-intraline is a BINARY data item with the picture PIC 9(2), which will contain
the intraline number of the I/O operation. See page 9-3 for a description of Debug
line and intraline numbers. If the program that contains the I/O operation was
compiled with the Q Option, the value stored in prog-intraline is zero.
Note The PROGRAM-ID special register may be used to obtain the program-name
of the COBOL program that performed the COBOL I/O operation. For more
information about the PROGRAM-ID special register, see Chapter 1, Language
Structure, of the RM/COBOL Language Reference Manual.
C$GetRMInfo
C$GetRMInfo is used to retrieve information about the RM/COBOL runtime system.
Calling Sequence
C$GetSyn
C$GetSyn is used to retrieve the values of RM/COBOL synonyms from the Windows
registry file.
Calling Sequence
name is an alphanumeric data item that contains the name of the synonym to retrieve.
value is an alphanumeric data item that contains the value of the synonym upon
return from the call.
program is an alphanumeric data item that indicates the name of the program whose
synonym properties are being retrieved. A value of SPACES indicates to use the
“Defaults” properties.
Calling Sequence
Calling Sequence
To use this subprogram, the runtime system must be able to locate the rmbars.dll file.
The following example illustrates how to add this DLL to the Runtime Command line
with the L Option:
Calling Sequence
menustring is an alphanumeric data item that contains the menu text, as described in
the section “Setting Menu Bar Properties” on page 3-34.
exit-code is a PICTURE 9(n) BINARY, where n can be a digit from 1 to 9.
Note Calling C$MBar with no arguments turns off the menu bar.
Calling Sequence
memory-pointer must be a pointer data item (USAGE POINTER) that will contain
the address of the allocated memory area upon successful completion of the call. A
null pointer value is returned if the call is not successful.
memory-size must be a numeric data item that specifies the size of the area to allocate
in bytes. The maximum value for memory-size is approximately 2,147,483,611,
depending on the size of overhead structures. If the maximum value is exceeded, the
allocation request will be unsuccessful and a null pointer will be returned. A null
pointer will likely be returned for much smaller values since the operating system
will be unable to satisfy the request. If the COBOL data item used to specify
memory-size supports 10 or more decimal digits, a large value in memory-size may
be truncated upon conversion internal to C$MemoryAllocate. In this case, an area
may be allocated that is smaller than the requested size or the run unit terminated
with an error in C$MemoryAllocate.
If the memory allocation is successful, the allocated memory is initialized to spaces.
The allocated memory belongs to the run unit and may be accessed by any program in the
run unit that has access to the pointer data item memory-pointer or a copy of that pointer
data item. Upon termination of the run unit, all dynamically allocated memory will be
freed.
The pointer returned by C$MemoryAllocate may be used to set the base address of a
based linkage item in a Format 5 SET statement. The memory area may then be accessed
by references to the based linkage item or data items subordinate to the based linkage
item. References to based linkage items are slower than references to Working-Storage
items, so if the program makes frequent references to the based linkage item (for
example, in a PERFORM loop), it is a good idea to move the based linkage item to a
Working-Storage item.
Calling Sequence
After memory has been deallocated, the program should not make any references to based
linkage items whose base address was set to the area of memory that was deallocated until
those based linkage items are reassigned to a new valid base address in a Format 5 SET
statement. If the program does reference the deallocated memory, an error may occur or
undefined data may be accessed, either from the original memory area while it is still on
the free memory list or after the memory has been reallocated for a different use. It is the
programmer's responsibility to manage pointer data items and the setting of based linkage
base addresses to avoid such conditions.
It is not necessary to call C$MemoryDeallocate. The runtime will free any dynamically
allocated memory upon termination of the run unit.
C$NARG
C$NARG returns the number of parameters passed in the CALL statement USING list to
the subprogram that contains the call to C$NARG. The GIVING argument is not
included in the count. Arguments specified explicitly as OMITTED in the USING list of
the CALL statement are included in the count. An RM/COBOL subprogram may be
called with a variable number of actual parameters if it does not attempt, during its
execution, to reference formal parameters for which no actual parameters exist.
C$OSLockInfo
C$OSLockInfo returns the process ID of the process that has the record locked when a
lock request fails. This subprogram should be called immediately after a lock request has
failed.
Note This subprogram is available only under UNIX and only if the system uses the
fcntl() system call to perform record locking.
Calling Sequence
Calling Sequence
sound is an alphanumeric data item that contains the name of a Windows sound event
or .wav sound file to play.
flags is a numeric data item that contains flags to use when playing the sound. The
possible values are provided below and in the 78-level entries in the WINDEFS.CPY
copy file (see page E-69), and may be combined by adding them together.
Value Meaning
SoundSync Synchronous playback of a sound event.
SoundAsync Sound is played asynchronously.
SoundNoDefault No default sound event is used.
SoundNoStop The specified sound event will yield to another
sound event that is already playing.
SoundPurge Sounds are to be stopped for the calling task.
SoundApplication The sound is played using an application-specific
association.
SoundNoWait If the driver is busy, return immediately without
playing the sound.
SoundAlias sound is a system-event alias in the Windows
registry file or the win.ini file.
SoundFilename sound is a filename.
SoundAliasId sound is a predefined sound identifier.
Example
To use this subprogram, the runtime system must be able to locate the rmbars.dll file.
The following example illustrates how to add this DLL to the Runtime Command line
with the L Option:
Calling Sequence
menustring is an alphanumeric data item that contains the menu text, as described in
the “Setting Pop-up Menu Properties” section on page 3-36.
exit-code is a PICTURE 9(n) BINARY, where n can be a digit from 1 to 9.
Note Calling C$RBMenu with no arguments turns off the pop-up menu.
C$RERR
C$RERR returns the expanded I-O completion status shown beginning on page A-11. It
returns either a four-character or an eleven-character extended status code depending
upon the length of the data item specified in the USING phrase. This status is for the last
attempted I/O operation. When the COBOL I-O status for the last operation is
represented differently under ANSI COBOL 1985 and 1974, the value returned conforms
to ANSI COBOL 1974 when the calling program is compiled in 1974 mode (that is, when
the 7 Compile Command Option is specified, as described in Chapter 6, Compiling). The
value returned conforms to ANSI COBOL 1985 when the calling program is compiled in
1985 mode.
Code Description
00 Unknown OS error.
01 File Manager Detected error.
02 MS-DOS error.
03 OS/2 error.
04 UNIX error.
05 RM/COS error.
06 Btrieve error.
07 Informix error.
08 Oracle error.
09 AmigaDos error.
10 Open File Manager error.
11 Runtime Library error.
12 MS-Windows error.
13 NetWare error.
14 VMS error.
15 RM/InfoExpress Server error.
16 RM/InfoExpress Client error.
17 RM/InfoExpress TLI error.
18 RM/InfoExpress TLISYS error.
19 RM/InfoExpress NetBIOS error.
20 RM/InfoExpress SPX error.
21 RM/InfoExpress WinSock error.
C$SBar
C$SBar is used to display a status bar in the RM/COBOL window.
To use this subprogram, the runtime system must be able to locate the rmbars.dll file.
The following example illustrates how to add this DLL to the Runtime Command line
with the L Option:
Calling Sequence
status-text is an alphanumeric data item that contains the text to be displayed on the
status line. See “Status Bar Text” property on page 3-27 for more information.
Note Calling C$SBar with no arguments turns off the status bar.
Calling Sequence
screen-buffer is an alphanumeric data item that will receive the characters read from
the terminal display screen.
buffer-size is an optional COMP-1 data item that specifies the number of
characters to be read. If the value is 0 or the parameter is omitted, the actual size
of screen-buffer is used.
screen-line is a COMP-1 data item that specifies the line where the cursor is to be
placed prior to the screen read. If omitted, a value of 1 is used. If a pop-up window
is active, screen-line is window-relative, not screen-relative.
screen-position is a COMP-1 data item that specifies the position where the cursor is
to be placed prior to the screen read. If omitted, a value of 1 is used. If a pop-up
window is active, screen-position is window-relative, not screen-relative.
Note The three optional arguments, buffer-size, screen-line, and screen-position,
may be explicitly omitted by specifying the keyword OMITTED in the corresponding
position in the USING list.
The cursor position after the call obeys the rules for the ACCEPT and DISPLAY
statements. No errors are returned.
If this function is requested to read characters past the end of the screen or window, as
many actual characters as possible are returned. The remainder of the buffer is set to
spaces.
It is not possible to retrieve attribute information from the display. Only the actual
character values are returned.
If graphic characters have been written to the display using the GRAPHICS keyword of
the CONTROL phrase of the ACCEPT and DISPLAY statements, and this call is used to
read such characters, the characters returned are the displayed characters, not the values
used by the program in the ACCEPT or DISPLAY statement that originally wrote the
C$SCWR
C$SCWR allows a COBOL program to display quickly a large amount of information
containing multiple display attributes.
Calling Sequence
DISPLAY-VERSION (required, input) is reserved for future use and must be set
to a value of 0.
DISPLAY-UNIT (required, input) is the unit number of the terminal to which
the display is directed. Under UNIX, specifying a value of 0 causes output to be
written to the terminal from which the runtime system was started. Under
Windows, this value must be set to 0.
DISPLAY-LINE (required, input) is the one-relative line number in the current
window where the text is to be displayed. If set to a value of 0, the display
begins on the current line (as described in the “Determining Line and Position”
section of the DISPLAY statement in Chapter 6, Procedure Division Statements,
of the RM/COBOL Language Reference Manual).
DISPLAY-POSITION (required, input) is the one-relative column number in the
current window where the text is to be displayed. If set to a value of 0, the
display begins at the current column (as described in the “Determining Line and
The current line and current position after the call obey the rules for the ACCEPT and
DISPLAY statements.
Colors set by this function also affect subsequent ACCEPT and DISPLAY operations if
those operations do not specify an FCOLOR or BCOLOR keyword in the CONTROL
phrase (see page 8-12).
Fatal Errors
The runtime system terminates if the C$SCWR function is called with any of the
following four conditions:
1. C$SCWR is called with other than two or four parameters, or any one of the
parameters is a simple numeric parameter.
Exception Codes
The following exception codes are stored in the DISPLAY-EXCEPTION-CODE
variable. The C$SCWR function reports three types of exception codes: error,
warning, and informational. Lower-numbered exception codes are reported before
higher-numbered exception codes. These codes and their associated definitions are
listed in Table F-3.
Note Error codes take precedence over warning and informational codes. If multiple
exceptions occur, the first occurring exception at a given level is returned. If warnings
are returned, the display is performed, but the results may not be as expected.
C$SetDevelopmentMode
C$SetDevelopmentMode is used to enable expanded error information reporting (known
as “development mode”) for many of the C$ and P$ subprograms. (P$ subprograms are
discussed in Appendix E, Windows Printing.) When development mode is enabled, more
verbose error reporting is performed to assist the COBOL developer in implementing
these subprogram calls. See also “C$ClearDevelopmentMode” on page F-7.
Calling Sequence
CALL "C$SETDEVELOPMENTMODE"
Development mode also may be set at program startup with the RM_DEVELOPMENT_MODE
environment variable:
RM_DEVELOPMENT_MODE=[Y|y|N|n]
Calling Sequence
name is an alphanumeric data item that contains the name of the environment
variable to set or clear.
value is an alphanumeric data item that contains the value to which the environment
variable is set. A value of SPACES indicates that the environment variable should be
deleted.
return is a PICTURE 9(n) BINARY, where n can be a digit from 1 to 9. It is set to 0
if the call was successful and non-zero if it failed.
C$SetSyn
C$SetSyn is used to set the values of RM/COBOL synonyms in the Windows registry file.
Calling Sequence
name is an alphanumeric data item that contains the name of the synonym to set or
clear.
value is an alphanumeric data item that contains the value to which the synonym is
set. A value of SPACES indicates that the synonym should be deleted.
program is an alphanumeric data item that indicates the name of the program whose
synonym properties is being changed. A value of SPACES indicates to use the
“Defaults” properties.
Calling Sequence
flag is a numeric data item that contains one of the values described below:
01 WIN-SHOW-STYLES.
03 SW-HIDE PIC 9(4) BINARY VALUE 0.
03 SW-MINIMIZE PIC 9(4) BINARY VALUE 6.
03 SW-RESTORE PIC 9(4) BINARY VALUE 9.
03 SW-SHOW PIC 9(4) BINARY VALUE 5.
03 SW-SHOWMAXIMIZED PIC 9(4) BINARY VALUE 3.
03 SW-SHOWMINIMIZED PIC 9(4) BINARY VALUE 2.
03 SW-SHOWMINNOACTIVE PIC 9(4) BINARY VALUE 7.
03 SW-SHOWNA PIC 9(4) BINARY VALUE 8.
03 SW-SHOWNOACTIVATE PIC 9(4) BINARY VALUE 4.
03 SW-SHOWNORMAL PIC 9(4) BINARY VALUE 1.
Value Meaning
SW-HIDE Hides the window and passes activation to another
window.
SW-MINIMIZE Minimizes the specified window and activates the
top-level window in the system’s list.
SW-RESTORE Activates and displays a window. If the window
is minimized or maximized, Windows restores
it to its original size and position (same as
SW_SHOWNORMAL).
SW-SHOW Activates a window and displays it in its current
size and position.
SW-SHOWMAXIMIZED Activates a window and displays it as a maximized
window.
SW-SHOWMINIMIZED Activates a window and displays it as an icon.
Examples
C$ShowArgs
C$ShowArgs displays the list of arguments that were used to call C$ShowArgs. This
facility is useful during development of non-COBOL subprograms.
Note This subprogram is supported only under UNIX and performs no operation when
called under Windows.
Calling Sequence
argument is any data item. C$ShowArgs will print its own name, the number of
arguments, and the initial state flag. Then, for each argument, C$ShowArgs prints
the address of the argument using hexadecimal notation, the size of the argument, the
Example
C$TBar
C$TBar is used to display a toolbar in the RM/COBOL window.
To use this subprogram, the runtime system must be able to locate the rmbars.dll file.
The following example illustrates how to add this DLL to the Runtime Command line
with the L Option:
Calling Sequence
buttonstr is an alphanumeric data item that contains the button definition. The syntax
is as follows:
buttonname["prompt"]=string
buttonname is the name of the icon stored in the filename specified by the Icon
File property (see page 3-21).
string is an ASCII text string. However, it also can contain special characters for
the Return, Tab, Escape, or Function keys. If the first character is a greater than
character (>), then the characters that follow are executed as a command. The
special characters are described in Table 3-2 on page 3-33. (These characters
are interpreted by the COBOL ACCEPT statement, as described in Table 8-2
beginning on page 8-6.)
exit-code is a PICTURE 9(n) BINARY, where n can be a digit from 1 to 9.
Note Calling C$TBar with no arguments turns off the toolbar.
C$TBarEn
C$TBarEn is used to enable and disable buttons on the toolbar.
To use this subprogram, the runtime system must be able to locate the rmbars.dll file.
The following example illustrates how to add this DLL to the Runtime Command line
with the L Option:
If the toolbar button bitmap contains three frames instead of the normal two, the third
bitmap will be displayed while the button is disabled.
Calling Sequence
buttonname is the name of the icon stored in the filename specified by the Icon File
property (see page 3-21).
flag is a numeric data item with the value of 1 for enable and 0 for disable.
To use this subprogram, the runtime system must be able to locate the rmbars.dll file.
The following example illustrates how to add this DLL to the Runtime Command line
with the L Option:
Calling Sequence
buttonname is the name of the icon stored in the filename specified by the Icon File
property (see page 3-21).
seq is a numeric data item that contains a value of 0 through 9 indicating the
sequence number to use for displaying the named button. See the “Toolbar Editor”
section on page 3-37 for more information.
C$Title
C$Title is used to set the window title for the RM/COBOL window.
To use this subprogram, the runtime system must be able to locate the c$title.dll file. The
following example illustrates how to add this DLL to the Runtime Command line with the
L Option:
C$WRU
C$WRU returns the program identification, line number, and intraline number of the
CALL statement, which called the subprogram that contains the call to C$WRU.
Calling Sequence
Calling Sequence
If the argument count is incorrect or the arguments are of the wrong type, the run unit is
stopped with the message “COBOL STOP RUN at line ? in SYSTEM ...”.
The command is executed with the system() library function call. For a null or all space
command-line, the environment variable SHELL is used to locate the shell processor. To
return to the calling COBOL program, type:
ctrl+d.
Windows Considerations
A command-line that contains either a single NULL character or all blanks starts a new
instance of the command processor.
The command-line parameter may be used to specify either a DOS or Windows program.
The execution of the calling COBOL program is suspended until the called program
terminates. For a null or all space command-line, the environment variable COMSPEC is
used to locate the command processor. To return to the calling COBOL program, type:
EXIT
The style of the window used for Windows programs is controlled with the SYSTEM
Window Type property (see page 3-28). The SYSTEM Window Type property also can
be set with the C$GUICFG non-COBOL subprogram as described on page F-16.
C:\DOS\COMMAND.COM /C DIR
This example assumes that the command processor is located on drive C: in the directory
DOS.
You can configure whether a DOS program runs in a full screen or in a window by
modifying the MS-DOS Prompt Properties. This can be done by right-clicking the
MS-DOS Prompt icon and selecting Properties from the pop-up menu.
This appendix describes the set of utilities provided for file conversion, management, and
manipulation.
Organization
The utilities described in this appendix are as follows:
3. The Map Program File utility (rmmappgm) produces a report describing the
contents of an object program file created by the RM/COBOL compiler or the
rmpgmcom utility.
4. The Map Indexed File utility (rmmapinx) produces a report describing the structure
of an indexed file created by an RM/COBOL program or by the rmdefinx utility
(described in the following item).
5. The Define Index File utility (rmdefinx) precreates an indexed file for use by
RM/COBOL programs, or modifies some of the characteristics of an existing indexed
file.
6. The Indexed File Recovery utility (recover1) is used to recover the data in an
indexed file.
The Indexed File Unload utility (recover2) is used to unload an indexed file to a
sequential file. This utility is no longer needed to recover indexed files.
The utility programs and files may be placed in one directory. Be sure that the compiler
and runtime system directory search sequences (see page 2-4 for UNIX and page 3-11 for
Windows) include the directory in which these files are placed.
General Considerations
Files with an extension of .cob were created with the RM/COBOL compiler, and are
executed with the RM/COBOL Runtime Command. Files with an extension of .cbl are
RM/COBOL source files, which are used as examples for relative file conversion and as a
copy file-driven, configurable index file conversion utility.
The programs rmmapinx, rmmappgm, rmpgmcom, and recover1 generate reports that
are written to a file named PRINTER. Under UNIX, the line printer spooler is used.
Under Windows, the runtime system assigns this by default to the Windows default
printer.
If you want to discard the report under UNIX, set an environment variable using the
following commands:
G-2 Utilities
Utilities Delivered on Media
If you want to discard the report under Windows, set the following synonym:
PRINTER=NUL
If you want the report to go to a disk file under UNIX, set an environment variable using
the following commands:
If you want the report to go to a disk file under Windows, set the following synonym:
PRINTER=filename
If you want the report to go to the console under UNIX, set an environment variable using
the following commands:
If you want the report to go to the console under Windows, set the following synonym:
PRINTER=CON
Where necessary, compile the utility programs with the RM/COBOL Compile
Command, rmcobol.
5. Available disk space for the creation of the new RM/COBOL indexed file. The new
file size typically will be smaller than or equal to the original.
RM/COBOL (74) version 2 supports a dual-file format. In the dual-file format, both the
data file and the index file (which contains both header and indexes) have the same name.
The data file has the default filename extension, and the index file always has a filename
extension of .inx. For example, if the data filename is inxfl.dat, the file that contains the
header and indexes is named inxfl.inx. This requires that you make certain you include
the .inx filename extension when specifying a version 2, dual-file indexed file format.
runcobol rmifca
The program will prompt for the information required to convert the file.
G-4 Utilities
Indexed File Conversion Utilities (rmifca and rmifcb)
2. In response to the first prompt, enter the name of the indexed file to be converted. If
you are converting a version 2 indexed file, be sure to include the .inx filename
extension as part of the filename.
If you specify a version 2 dual-file indexed file, you will be requested to enter the
filename of the data file portion of the indexed file.
3. The next prompts deal with the BLOCK and RECORD sizes. In order to answer
correctly, you may need to refer to the RM/COBOL (74) source program in which
the file is described.
b. Describe the RECORD CONTAINS clause. If the file you are converting is a
version 2 indexed file, the maximum record length will be filled in. You need
only specify the minimum record size if it is a variable-length record. If the file
you are converting is a version 1 indexed file, you must specify both the
minimum and maximum record sizes.
Once all the information has been supplied, rmifca generates the copy files necessary
to describe the conversion process to the actual conversion utility rmifcb.
4. Compile and execute rmifcb. The program displays what it is going to do and asks
for confirmation to proceed. The program attempts to estimate processing time.
rmifcb.cob can be renamed and saved for use as a standalone conversion program
for versions 1 and 2 indexed files. If you are an application developer, this should
ease the process of getting your users converted from a version 1 or version 2 system
to the current RM/COBOL environment.
The process described above applies only to copying data records from RM/COBOL
(74) version 1 or 2 to RM/COBOL indexed files on an “as is” basis. However, since
each data record is available during the execution of rmifcb, you may wish to
customize a copy of rmifcb to provide data conversions, such as changing separate
signs to combined signs on numeric USAGE display items. Comments in the source
file rmifcb.cbl suggest where customized code may be placed.
2. Edit the source program, replacing—where indicated—the record size for the
RM/COBOL (74) version 1.5 input and the RM/COBOL output relative files.
4. Under UNIX, set environment variables to assign file pathnames for the version 1.5
relative file to INPUT, and the RM/COBOL relative file to OUTPUT. For example:
Under Windows, use synonyms to assign the file pathnames. Setting synonyms is
described in Chapter 3, Installation and System Considerations for Windows.
G-6 Utilities
Relative File Conversion Utility: Version 1.5 to RM/COBOL (rmcrl1)
Relative File Conversion Utility: Version 2 to
RM/COBOL (rmcrl2)
There are two source programs for converting version 2 relative files: rmcrl2l.cbl and
rmcrl2s.cbl. These programs can be used to convert RM/COBOL (74) version 2 relative
files to RM/COBOL format. rmcrl2s.cbl converts files with record sizes less than 512
bytes. rmcrl2l.cbl converts files with larger record sizes.
Under Windows, use synonyms to assign the file pathnames. Setting synonyms is
described in Chapter 3 of this user’s guide.
runcobol rmcseq
3. Respond to the second prompt by entering the properly qualified pathname of the
RM/COBOL (74) version 2 variable-length binary sequential file to be converted.
5. The program should then execute, displaying a count of the records being converted.
If conversion terminates without error, the following message appears:
G-8 Utilities
Sequential File Conversion Utility (rmcseq)
Combine Program Utility (rmpgmcom)
The rmpgmcom utility combines multiple RM/COBOL object files into a single program
file library. RM/COBOL allows programs to be placed in the same file. This simplifies
software distribution and provides a more consistent and logical representation of
software. The rmpgmcom utility builds a Table of Contents (TOC) at the end of the
output program file library. A Table of Contents speeds up runcobol library initialization
while very slightly increasing the size of the library file.
The compiler allows several source programs to be contained in the same file. The
program file generated has as many object files as the source file defines. rmpgmcom,
on the other hand, allows source modules to be contained in separate files, and the
contents of the resulting object files to be combined into one file.
rmpgmcom.cob is required to use this utility. This file is delivered in object form.
STRIP, if present, removes COBOL symbol table and debug line table information,
produced by the compiler Y Option, from object files. This is useful to reduce the
size of a program library after debugging is complete.
out-file is the name of the new program file being created. If a filename extension is
not specified, .cob is used.
file-1, file-2, . . ., file-n are the names of the program files being combined to form
out-file. For each name, if a filename extension is not specified, .cob is used. If the
file does not exist with a filename extension of .cob, the name is used with no
filename extension.
If the argument list is not specified, rmpgmcom prompts first for whether or not to copy
the report to the PRINTER, second for the STRIP option, third for the output filename,
and then for the input filenames. rmpgmcom adds the programs in each input file to the
If the filenames are specified through the command line, the command line argument is
limited to no more than 100 characters. Combining more than 100 characters of
filenames requires direct operator input, use of input redirection, or multiple executions of
the program.
In most cases, an error does not terminate the program. If the program terminates
abnormally, assume that the output file is not in a valid state and cannot be used to
execute programs.
The same program name can occur in more than one input program file. If this is the
case, rmpgmcom uses the first one encountered and ignores subsequent programs with
the same names. This can be very useful when you want to replace one program in a
program file with a new version. Instead of having to recreate the file, you could use
commands similar to the following.
Note rmpgmcom can combine more than 500 programs, but only the first 500 are
guaranteed to have unique names. You may want to limit your program libraries to no
more than 500 programs for this reason.
For UNIX:
mv rmutil.lib, rmutil.bak
For Windows, use the Explorer or open a DOS box and use:
rmmappgm.cob is the name of the program file containing the program to be updated.
rmmappgm.cob is loaded into rmutil.lib, after which the programs in rmutil.bak (which
is the previous version of rmutil.lib) are loaded into rmutil.lib. The previous version of
rmmappgm.cob in rmutil.bak is ignored.
G-10 Utilities
Combine Program Utility (rmpgmcom)
Execution of Programs Within Libraries
To execute programs within the created library, the L Runtime Command Option is used.
For example:
Examples
2. Edit file.txt using any text editor and enter Y (Yes) or N (No) as the first line of the
file. (A response of Y requests a copy of the report to be written to the PRINTER.)
Add the library name as the second line of the file.
rmmappgm.cob is required to use the mapping utility. The file is delivered in object
form.
G-12 Utilities
Map Program File Utility (rmmappgm)
If the argument list is not specified, rmmappgm prompts first for the name of a file to be
processed and then prompts for whether or not to copy the report to the printer. This
continues after each report until you press Enter without typing a name.
The report generated by this program is always written to the screen and is also written to
the printer only if the PRINTER option is specified. The information in the report is as
follows:
SIZES Indicates the size in bytes of the memory needed for the fixed
procedure area, the data area, and the overlay area, as well as
the total of these three.
COMPILED Indicates the date and time the program was compiled, the
compiler options chosen, as well as the version of the compiler
used and the operating system under which the program was
compiled.
OBJ VERS Indicates the object version of the program (see Appendix H,
Object Versions, for details).
Examples
Note In order to report information related to a Btrieve file, use the Btrieve File
Manager (either the Windows interactive version, wbmanage.exe, or the command line
version, butil.exe). Refer to the Btrieve for Windows NT/Windows 95/Windows 98
Installation and Operation manual for complete information about the utility.
If the optional information is not specified, you are prompted for file-name, DETAIL, and
PRINTER, as follows:
Indexed File:
Detail Information (y/n)?
Copy to PRINTER (y/n)?
Enter the name of the file to be used in response to the first prompt line. A response of Y
to the second prompt requests detailed information (described in the “Detailed
Information Report” section on page G-16) for the file. A response of N requests only the
basic information (see the following paragraphs). When in prompt mode, the user is
prompted again after each file report is processed. To exit the program when in prompt
mode, press Enter without typing a name when prompted for a filename. A response of Y
to the third prompt requests a copy of the report to be written to the printer.
G-14 Utilities
Map Indexed File Utility (rmmapinx)
Basic File Information Display
Basic file information is always reported for each existing file entered, without respect to
the presence or absence of the DETAIL option.
• File status. If the file was created by the rmdefinx program (described on
page G-19) and has never been opened for output, a file status line indicating this fact
appears. Also, if this status is indicated, only the disk block size and data and key
compression status (with compression characters) appear. Detail information,
described in the next section, is reported if the detailed report is requested.
• Record length. Record length is reported in one of two formats. For fixed-length
records, it is shown as a specific value:
size is the actual record size. If variable-length records are defined for the file, this is
shown as a range of values:
min and max are the minimum and maximum record lengths.
• Disk block size. Disk block size is the number of bytes actually allocated to one
block on disk.
• User block size. User block size is the number of records or bytes specified by the
user in the FD statement used when creating this file.
• Number of keys. This is the actual number of keys (including the prime key)
defined for the file.
• Number of segments. This is the total number of segments in all keys defined for
the file. If the file has no split keys, the number of segments is equal to the number
of keys.
• Number of records. This is the actual number of data records contained in the file.
• Number of blocks. This is the actual number of logical blocks allocated to the file.
• Number of empty blocks. This is the number of unused blocks allocated to the file.
• Last error. This is the last error received when accessing the file. It includes the
date and time the error occurred. Only errors with class of 30, or a class of 98 with a
suberror greater than 2, are remembered.
• Open For Modify Count. This is a count, held in the file, of the number of times
the file is currently open. If this count is not zero, and there are actually no current
opens, it is an indication that the file may be corrupted because of an incomplete
close operation.
G-16 Utilities
Map Indexed File Utility (rmmapinx)
Key Descriptor Information Display
If the file has been opened for output, the attributes of each key are reported one key
segment per line. The information reported is as follows:
• Key number. The first key is labeled prime, with alternate keys numbered starting
with 1.
• Segment number. The segment number within the key. The first segment of a key
is number 1.
• Starting position. This is the position in the record where the key segment starts.
The leftmost position in a record is position 1.
• Segment length. This is the number of bytes that the key segment occupies in the
record.
• Key length. This is the total number of bytes that the entire key occupies in the
record. It is the sum of the segment lengths of all of the segments of the key. This
value is shown only on the final segment line of a split key since it applies to the
entire key.
• Tree height. This is the maximum number of disk accesses that could be required to
locate a record containing the key. Additional disk accesses may be required to read
or modify the record. This value is shown only on the final segment line of a split
key since it applies to the entire key.
• Duplicates permitted. This value is either yes or no. Yes indicates that the key
allows duplicate key values to be present. This value is shown only on the final
segment line of a split key since it applies to the entire key.
Additionally, a blank line is displayed between keys when any of the keys of the file is a
split key. If the file has no split keys, there is one line per key with no intervening blank
lines.
Examples
Here is sample input to rmmapinx. Each file listed is also described with
RM/COBOL SELECT and FD statements.
Detail Information:
File version number = 3.
Minimum read version number = 3.
Minimum write version number = 3.
First unused empty block = 5.
File Lock Limit = 64 GB.
Disk Block Increment Size = 512 Bytes.
Allocation Increment = 8 Blocks.
Recoverability/Performance Strategy:
Data are forced to the system only when necessary.
Force Write Data Blocks = No.
Force Write Index Blocks = No.
Force to Disk = No.
Force File Closed = No.
Key Information:
Key Segment Starting Segment Key Tree Duplicates
Number Number Position Length Length Height Permitted?
Prime 1 1 30
Prime 2 90 5 35 1 No
1 1 31 3 3 1 No
2 1 34 10
2 2 84 6
2 3 95 20 36 1 Yes
G-18 Utilities
Map Indexed File Utility (rmmapinx)
Define Indexed File Utility (rmdefinx)
The rmdefinx utility precreates an indexed file in order to alter the default characteristics
assigned by RM/COBOL programs. The utility also can modify some of those
characteristics on files created by RM/COBOL programs.
rmdefinx.cob is required to use the define indexed file utility. The file is delivered in
object form.
Note 1 When using the rmdefinx utility on an indexed file larger than 16 bytes,
rmdefinx must be executed with a configuration file with the following entry:
RUN-SEQ-FILES USE-LARGE-FILE-LOCK-LIMIT=YES
Note 2 In order to precreate a Btrieve file, use the Btrieve File Manager (either the
Windows interactive version, wbmanage.exe, or the command line version, butil.exe).
Refer to the Btrieve for Windows NT/Windows 95/Windows 98 Installation and Operation
manual for complete information about the utility.
You may omit the argument list. In this case, the program prompts for file-name in the
following manner:
Indexed File:
File Precreation
This controls the amount of space taken up by logical records in the file. If you want
logical records to be stored without compression, enter N. Otherwise, enter Y, and then
respond to the following two prompts:
These control the manner in which data compression takes place. Respond with the
decimal value of the characters to be interpreted by the compression algorithm as a space
and a zero. For example, the ASCII space and zero have decimal values of 32 and 48,
respectively; the EBCDIC space and zero have decimal values of 64 and 240,
respectively.
These queries control key compression in a manner similar to data compression, except
that only trailing spaces are compressed.
G-20 Utilities
Define Indexed File Utility (rmdefinx)
This prompt sets the version number of the file. Valid version numbers are shown in the
following chart.
Version Version Version
Feature Number 0 Number 2 Number 3
This prompt is shown only if the file version number has been set to 3. It allows you to
specify the location of the largest lock to be placed on this file. For more information,
see Chapter 10, Configuration, for descriptions of the LARGE-FILE-LOCK-LIMIT
keyword (RUN-FILES-ATTR configuration record) and the DEFAULT-FILE-
VERSION-NUMBER keyword (RUN-INDEX-FILES configuration record).
File Modification
When the file specified already exists, the utility allows you to change the allocation
increment, described previously, and offers you the option to alter the key compression,
the recoverability/performance strategy, the file version number, and the file lock limit.
If you enter Y, you are prompted for whether the key compression should be enabled and
for the value of the key compression space character, as described on the previous page.
If the key compression or the key compression space character is changed, the file is
marked as needing recovery. After you run the Indexed File Recovery utility (recover1),
described on page G-23, the indexed trees are built with the requested key compression.
If the current key compression and key compression space character are unchanged, you
are not forced to recover the index structure.
If you enter Y, you are prompted for the four options discussed previously. If you enter
N, the strategy is unchanged.
If you enter Y, you are prompted for the file version number discussed on page G-20. If
you specify the file version number as 3, you are prompted for the file lock limit. If the
version number is changed from 0 to another version, or changed from another version
to 0, the file is marked as needing recovery, and the Indexed File Recovery utility
(recover1) must be run before the file can be used. After you run the Indexed File
Recovery utility (recover1), the empty block list is built with the correct algorithm. If the
file version number is unchanged, you are not forced to recover the empty block list.
If you attempt to change the file version number to 0 of a file that contains split keys or
duplicate prime keys, a message is displayed indicating that you cannot do so; files using
these features cannot be converted to version number 0 files. Also, files with a version
number of 3 may have grown too large to be changed back to version 0 or 2. For more
information on indexed file version numbers, see Chapter 8.
After all questions have been answered, the following prompt appears:
OK (y/n)?
If you enter Y, the file is updated and the program either terminates (if a filename was
specified on the command line) or prompts you for another filename.
Note The rmdefinx utility does not cause the file to “exist” in the COBOL sense. An
OPEN OUTPUT (or OPEN I-O or EXTEND if SELECT OPTIONAL is used) must be
successfully executed before other open modes become valid.
Example
G-22 Utilities
Define Indexed File Utility (rmdefinx)
Indexed File Recovery Utility (recover1)
The recover1 utility recovers data stored in an RM/COBOL indexed file. It is a
standalone program; that is, it does not require use of the Runtime Command (runcobol)
to be executed.
Note 1 In order to recover data stored in a Btrieve file, use the Btrieve File Manager
(either the Windows interactive version, wbmanage.exe, or the command line version,
butil.exe). Refer to the Btrieve for Windows NT/Windows 95/Windows 98 Installation
and Operation manual for complete information about the utility.
Note 2 Unless specifically stated otherwise, the name recover1 refers to both the UNIX
(recover1) and Windows (recover1.exe) versions of the recover1 program.
Note 3 If the output window of the Windows version of the recover1 program
disappears upon successful completion and you want that window to remain visible, set
the Persistent property to TRUE for the recover1.exe program (see page 3-24 for details).
file-2 is the name of the file where recover1 places any unrecoverable records found
in the indexed file (see page G-25).
The -i option causes recover1 to test only the file integrity and then stop. The file
will not be modified in any way. Specifying -i causes both the -t and -z options to be
ignored. If no problems are discovered, the return code is set to 0. If a problem is
discovered, the return code is set to 1.
Note The integrity scan is a quick test of the file and is not comprehensive. Some
problems, such as records with invalid duplicate keys, will not be detected. Files
with no errors detected by the integrity scan may still receive “98” errors or other
errors.
The -k option is used to indicate that the Key Information Block (KIB) should be
assumed to be invalid. If no file-3 is specified, the user will be prompted either for a
The -l option is used to write information about errors encountered while recovering
the file to the log file file-4. Only the first 100 errors will be logged. If file-4
specifies a synonym name, the synonym will be resolved before opening the log file;
this allows the use of the name PRINTER to send the log information to the print
device. The default value of file-4 is PRINTER.
The –m option specifies the number of megabytes of memory to allocate to the sort
algorithm used in phase 4, build node blocks (see page G-25). Allocating more
memory generally results in faster execution of recover1 and causes fewer node
blocks to be built. If this option is not specified, a suitable number will be computed.
The minimum value is 0 which requests that a minimum amount of memory be used.
The maximum value is 100. Note Specifying a number that is too large for your
system may result in very poor system performance.
The -t option is used to indicate that unused space should be truncated, and returned
to the operating system. Note Some versions of UNIX do not support the operating
system call required to truncate a file.
The -q option causes recover1 to perform its work without displaying information or
asking the operator questions. If the file is marked as needing recovery, or has a non-
zero Open For Modify Count (see “Basic File Information Display” on page G-15),
then it will be recovered. Otherwise, no action occurs. This behavior can be
modified by using the -y option.
The -y option causes recover1 to assume that the operator wants to answer “y” to all
possible questions and therefore does not stop to wait for a response. Using the “-y”
option will cause a file to be recovered even if it is not marked for recovery.
The -z option is used to reset the Open For Modify Count to zero (see “Basic File
Information Display” on page G-15), without performing a full recovery. If the file is
marked as needing recovery, this option is ignored. Note Use the -z option with
caution. Resetting the Open For Modify Count to zero without performing a full
recovery may leave the file in a corrupted state.
If the recover1 program is successful, the exit code is set to 0. If the recover1 program
is canceled by the operator, the exit code is set to 2. Otherwise, the exit code is set to 1.
G-24 Utilities
Indexed File Recovery Utility (recover1)
The recover1 program attempts to recover the indexed file in place; that is, the program
rebuilds the internal file structure in the actual file being recovered. If necessary, the Key
Information Block (KIB) is rebuilt and any corrupted data blocks are repaired. Corrupt
data blocks may result in loss of some data records. Because of this feature, it is strongly
recommended that you either backup the file or copy the indexed file to be recovered to
some other directory or pathname as additional security. Any records that cannot be
successfully reindexed into the file due to invalid duplicate key values, or invalid record
sizes, are decompressed (if compression is selected for the file), converted to the native
code set, and then written to file-2. recover1 should be able to handle most kinds of
indexed file corruption problems, but some fatal errors may still cause the recovery to
fail. Any fatal error is displayed and causes the program to terminate. Broken hardware
should be suspected in many of these cases.
file-2 can be in fixed- or variable-length format; this is set by recover1 based on whether
file-1 is fixed- or variable-length format. Records placed in file-2 were those undergoing
change at the time of the system failure that required recovery or have invalid record
sizes. Investigate any records appearing in file-2 and make the appropriate corrections to
file-1.
The recover1 program's processing consists of up to four separate phases, which are run
in the following order:
1. Integrity Scan. If the -q option or -y option is specified, the Integrity Scan phase is
disregarded unless it is forced to occur by the specification of the -i option or -l
option. This phase reads the entire file in a forward direction checking for simple
errors, and produces a summary report showing the state of the file and an estimate of
the number of records recover1 can recover. The indexed file is not modified during
this phase.
2. Repair Blocks. The Repair Blocks phase, which is always run, reads and writes the
file in a backward direction repairing corrupt data blocks, converting non-data blocks
to empty blocks, and rebuilding some internal file structures.
3. Move Data Blocks. The Move Data Blocks phase is run only when the truncate
file option (-t) is specified. This phase reads and writes parts of the file moving
high-numbered data blocks (near the end of the file) to lower-numbered available
blocks to maximize the amount of space at the end of the file that can be truncated
and returned to the operating system when recover1 finishes.
4. Build Node Blocks. The Build Node Blocks phase, which is always run, reads data
blocks and writes node blocks in the file in a forward direction rebuilding the entire
node structure for each key of the file.
Note 2 After the Integrity Scan phase, if most of the blocks are invalid, the Disk Block
Size or the Disk Block Increment may have been incorrectly specified or the KIB may be
corrupt.
Note 3 During the Repair Blocks phase, a count of blocks which could be read but not
written may be displayed. This count may indicate the presence of a hardware problem
with your disk.
The recover1 utility compares its version number and product code with those in the
message file. If they do not match, one or both of the following messages appears:
When any of the above messages appear, the recover1 utility terminates with the
following message:
The recover1 utility message file may have the wrong name or be in the wrong directory.
The recover1 utility message file must have the name rec.msg (REC.MSG under
UNIX). The recover1 utility attempts to find the message file in the directory that
contains the recover1 executable file, the current directory, or through the PATH
directory search sequence (see page 2-4 for UNIX or page 3-11 for Windows).
G-26 Utilities
Indexed File Recovery Utility (recover1)
Example
An example run through the Indexed File Recovery utility is described in Figures G-1
through G-4. The recovery session is started in this example by the following command:
Figure G-1 on page G-28 shows information about the file master.inx.
Under the name of the file to be recovered, a description of the state of the file is
displayed. Any of the following messages may appear:
• The Open For Modify Count for this file is not zero: count
• KIB is corrupt. Enter a template filename (press Enter for manual entry).
If the KIB is corrupt, and a template filename is not entered, recover1 will prompt the
user for the required KIB information before continuing.
If more keys exist than can appear on this screen, as many as possible appear, after which
you are asked if you want to see the remaining key descriptors. This continues until all
keys are shown. You are then asked to verify that this is the file you want to recover.
Entering N terminates the program. Entering Y continues the program.
G-28 Utilities
Indexed File Recovery Utility (recover1)
Figure G-2 shows a summary of the information that is gathered during the file integrity
scan. You are then asked if you would like to proceed with the recovery process.
Entering N terminates the program. Entering Y continues the program.
The "Average record length" is computed by adding the length of all the records in the
file and dividing by the number of records. The "Average data size" is computed by
adding the size that the record actually occupies in the file and dividing by the number of
records. This size allows you to determine how much your data can be compressed.
G-30 Utilities
Indexed File Recovery Utility (recover1)
Figure G-4 shows the information that is displayed after recover1 terminates
successfully. The two lines regarding truncation are shown only when the -t option is
specified.
Recovery successful.
Note Entering incorrect information about how many keys, or which keys, can have
duplicate values may cause unpredictable results.
G-32 Utilities
Indexed File Recovery Utility (recover1)
Figure G-6 shows an example of entering the remainder of the KIB information.
Underlined characters have been entered by the user.
Force Write Data Blocks (y/n)? n Force Write Index Blocks (y/n)? n
After the key and KIB information has been successfully entered, the recovery process
proceeds the same as before, beginning with , as illustrated in Figure G-1 on page G-28.
If a template file had been specified on the command line or a template filename had been
entered when prompted, the screens prompting for the key and KIB information would
not have been displayed. A template file must be specified if the KIB is corrupt and the
file uses either an enumerated code set or an enumerated collating sequence.
recover1 was unable to initialize the RM/COBOL file management system for the reason
indicated by status. The usual cause for this error is that a buffer pool has been
configured that is too large to be allocated. See the BUFFER-POOL-SIZE keyword of
the RUN-FILES-ATTR configuration record on page 10-26 for instructions on changing
the buffer pool size.
recover1 detected that the truncated function was not supported on the system when the
user requested file truncation. Truncation of the file is not possible.
recover1 detected corruption in the indexed file and no records could be recovered. In
this case, recover1 terminates at the end of the integrity scan to protect the user from
erroneously deleting all the records from the file. This error may indicate that the block
size, the block size increment, or the number of keys that allow duplicates has been
incorrectly specified or the KIB may be corrupt.
recover 1 detected an error in the KIB of the template file specified by the user. The user
may enter another template file, may enter the KIB information manually, or may enter a
Ctrl-C to terminate recover 1.
recover1 detected that blocks near the end of the file can be read but not written, but
other blocks of the file may be both read and written. This error may indicate that the
operating system file size limit (ulimit) may be smaller than the size of the file. Correctly
set the file size limit or use an account with sufficient privileges and run recover1 again.
G-34 Utilities
Indexed File Recovery Utility (recover1)
Standalone Use of the Recover2 Program
The recover2 utility program can be used to unload an indexed file to a sequential file.
The recover2 program is no longer needed to recover indexed files. It is invoked by
entering the command:
file-1 is the filename of the indexed file to be unloaded. recover2 does not use the
directory search sequence to locate file-1.
file-2 is the filename of the sequential file into which recover2 unloads the indexed
file records.
option can be either SUB or NOSUB, depending on whether or not you want
recover2 to trust the overhead information in the file. NOSUB indicates that the
overhead information in the indexed file (record size, block size, and so forth) is
correct and can be used to unload the file. SUB indicates that the overhead
information may not be correct and needs to be verified and possibly altered. The
overhead information appears and you are given the opportunity to alter the
information before processing of the file begins. You must enter the value for the
"Number of Keys that allow Duplicates".
file-1, file-2 and option can be omitted, and recover2 prompts you for a value.
causes recover2 to prompt you for the file-2 filename. Entering the command:
runcobol recover2 K A='file-1, file-2'
recover2 also produces a log duplicating the overhead information appearing on the
screen to the printer specified with the synonym, PRINTER.
If an error occurs, recover2 displays a message, then continues to attempt to recover the
file. The exit code is set to 1.
If no errors occur, the recovery is successful and the exit code is set to 0.
Note When using the SUB Option, the value for the number of keys that allow
duplicates must be entered by the user since there is no default.
G-36 Utilities
Indexed File Recovery Utility (recover1)
Figure G-8 shows the OK prompt you see during the second attempt. Responding N to
this prompt causes the program to restart the prompts for file information. Responding Y
indicates that secondary data recovery should start.
recover2 was unable to open the indexed file for the reason indicated by status. The
execution of recover2 terminates.
recover2 encountered the error indicated by status while reading the indexed file. If the
NOSUB Option was chosen, execution terminates. If the SUB Option was chosen, the
operator is given the option to continue execution.
recover2 encountered the end of file in an unexpected place while reading the indexed
file, and recover2 may reasonably recover. If the SUB Option was chosen, the operator
may be given the option to continue. Otherwise, execution terminates.
The indexed file has never been opened for output and therefore cannot contain any data
records.
The overhead structures in the indexed file are not consistent. If the NOSUB Option was
chosen, execution terminates. If the SUB Option was chosen, the operator may continue
execution. Values that appear for block size and record size should be carefully verified.
The block size specified is larger than 65280 bytes, which is the largest block size
supported by recover2. Execution terminates.
recover2 has encountered a compressed data record that is inconsistent with the version
of recover2 being executed or with the compressed data record length. The indicated
record and subsequent records in the block are not written to the unload file. Processing
continues with the next block.
The minimum record size is greater than the maximum record size or the block size is too
small for the worst-case record size (due to data compression). It is checked when the
NOSUB Option is chosen. Execution terminates.
recover2 has encountered a data block with inconsistent overhead structures. No records
from the block are written to the unload file. Processing continues with the next block.
recover2 has encountered a data record with inconsistent overhead structures. Any
records in the block subsequent to the indicated record are not written to the unload file.
Processing continues with the next block.
G-38 Utilities
Indexed File Recovery Utility (recover1)
File: index-filename - Record size {< minimum | > maximum}
for block/record block number/record label.
recover2 has encountered a data record that does not conform to the constraints of
minimum or maximum record length but is otherwise consistent. The indicated record is
written to the unload file. Processing continues with the next record.
File: unload-filename - Record Size is too big for recovery program.
The maximum record length specified is too large for recover2. The maximum record
length is 65280 bytes. Execution terminates.
File: unload-filename Error: status.
The indicated error was encountered during an I/O operation on the unload file.
Execution terminates.
• compiler (rmcobol.exe)
Note The rmattach utility will work only with the Windows version of RM/COBOL.
input-exe-file is the name of the command processor file to be configured. This file
will not be modified.
Note The RUNPATH directory search sequence is not used to open this file. If
input-exe-file is not in the current directory, the entire pathname must be entered.
config-file is the name of a line sequential file containing the desired configuration
records (see Chapter 10). If a configuration file is already attached to input-exe-file,
it will be replaced by the contents of config-file.
rmattach does no syntax checking of the configuration file. The .exe file will diagnose
errors during its initialization.
G-40 Utilities
Initialization File to Windows Registry Conversion Utility (ini2reg)
By default, the ini2reg utility program converts text in the initialization file from the
OEM character set to the ANSI character set. If the initialization file already used an
ANSI character set, use the -q option to disable this conversion.
file-name is the name of the initialization file to be merged into the Windows registry
database. If no file is specified, an Open File dialog box appears in order to browse
the file system for the proper file. file-name must be specified with a proper path.
This utility does not search the PATH or RUNPATH environment variables.
A modified version of the rmconfig property sheet can be displayed for a single COBOL
program by right-clicking the program icon, Registry Configuration, and choosing
Properties.
-1 indicates that you will be configuring properties to be used while recovering data
files with recover1.exe (see page G-23).
G-42 Utilities
RM/COBOL Configuration Utility (rmconfig)
Appendix H: Object Versions
This appendix lists the new object features that are incompatible with earlier releases of
RM/COBOL-8X and RM/COBOL.
Level Numbers
The object version level number in a RM/COBOL object file identifies the earliest release
of the RM/COBOL product that supports the features required by the program. The set of
features available in the first release of the product, RM/COBOL-8X, has been assigned
object version 1. When new features have been added in subsequent releases of
RM/COBOL, these have been assigned successive object version numbers. The
RM/COBOL compiler marks each object file with the object version number of the latest
features actually used in the source program.
Every release of the RM/COBOL runtime system supports features up to some object
version level. Object files with a higher object version level number cannot be run.
When a program is named in the Runtime Command or in a CALL statement, the runtime
system searches for an object file containing a program with the specified name. If during
this search, the runtime system finds an object program that has an object version level
number which exceeds that accepted by the runtime system, that object program is not
considered valid and the runtime system continues its search. If no valid program with
the specified name is found, the ON EXCEPTION phrase of the CALL statement is taken
or the Runtime Command fails.
The RM/COBOL compiler has an object version level option to control the object version
level number placed in the object file. When the option is specified, any language
features used in the source program requiring a higher object version cause a source
diagnostic, and the program is not compiled. The object version level number placed in
the resulting object file is no higher than the value specified in the compiler option. If the
object version level option is not specified, the default value is the highest value accepted
by the compiler, thus allowing all features supported by the compiler. Since the compiler
marks the object program with the value of the latest feature actually used in the source
program, the resulting object program may still be executable on earlier releases of the
runtime system.
Table H-1 enumerates past RM/COBOL product releases and the highest object version
level number they accept.
Object
Product Platform Releases Level Number
RM/COBOL-8X DOS 1.nn 1
RM/COBOL DOS 2.nn 2
UNIX 2.0n 2
RM/COBOL AS/400 3
RM/COBOL DOS 4.nn 4
UNIX 4.0n 4
RM/COBOL DOS 5.nn 5
UNIX 5.nn 5
RM/COBOL DOS 5.2n 6
UNIX 5.2n 6
RM/COBOL UNIX 6.nn 7
Windows 6.nn 7
RM/COBOL UNIX 7.nn 8
Windows 7.nn 8
In most cases, the object version is of no concern to the user. However, when compiling
programs intended for distribution to other users, the object version may be of concern. If
these other users do not have the current release of the runtime system, Compile
Command Option Z (see page 6-14) should be specified to restrict the object version
level. The object version level number specified to the compiler should be the highest
value that does not exceed the level accepted by any of the runtime systems used by the
intended recipients. When the object version level number is limited by use of Option Z,
the compiler suppresses any optimizations and diagnoses all source language features not
supported by earlier runtime systems.
The features associated with each object version are described in the following sections.
Object Version 1
The RM/COBOL-8X compiler and runtime system versions 1.nn support features in
object version 1. These product releases implement the high subset of ANSI COBOL
1974.
If the object version level number is limited to 1 by use of Compile Command Option Z,
the resulting object program is executable on any released RM/COBOL-8X or
RM/COBOL runtime system.
Several new language features were added in object version 2 that are not supported by
previous versions. Unless the object version is limited to 1 by Compile Command
Option Z, programs with the following features will not execute on runtime systems with
a version number less than 2:
A simple INSPECT statement is one with single-character control operands and only
a single CHARACTERS, ALL, LEADING or FIRST phrase per TALLYING or
REPLACING phrase. A simple INSPECT statement may have both a TALLYING
and REPLACING phrase and both a BEFORE and AFTER INITIAL phrase.
The RM/COBOL version 2.nn and later compilers generate optimized code for
simple INSPECT statements. The optimized code is not supported by earlier runtime
systems. If the Compile Command options specify object version 1, the previous
unoptimized code is generated for a simple INSPECT statement.
2. A source program with a NUMERIC class condition which has an unsigned numeric
display operand.
The RM/COBOL version 2.nn and later compilers generate optimized code for a
NUMERIC class condition the operand of which is an unsigned numeric display data
item. The optimized code is not supported by earlier runtime systems. If the
Compile Command options specify object version 1, the previous unoptimized code
is generated for such a class condition.
3. In COBOL-85 compatibility mode, FILE STATUS clauses imply that ANSI COBOL
1985 I-O status values are expected. RM/COBOL-8X version 1.nn runtime systems
never produce ANSI COBOL 1985 I-O status values.
If the Compile Command options specify object version 1 and do not specify ANSI
COBOL 1974 compatibility mode, FILE STATUS clauses are diagnosed as an object
version incompatibility and are ignored.
Note Several important language features added in the version 2.0n releases of
RM/COBOL do not generate object version 2 code for their implementation. Examples
of such features are EVALUATE, INITIALIZE and the NOT conditional phrases (NOT
AT END, NOT ON SIZE ERROR, and so forth). These new language features may be
used whether or not the object version is restricted to object version 1 without affecting
the object version of the resulting object program.
Two language features were added in object version 3 that are not supported by the earlier
versions. These are as follows:
2. Nested programs, including the PROGRAM IS COMMON clause, the GLOBAL file
description entry clause, the GLOBAL data description entry clause and the
GLOBAL phrase of the USE statement.
Note Programs with either of these two features will not execute on runtime
version 1.nn or 2.nn systems. Since these features required new runtime system support,
you cannot compile them if the object version level is restricted to 1 or 2 with Compile
Command Option Z. If the object version level is restricted to 1 or 2, the RM/COBOL
compiler diagnoses these features as an object version incompatibility.
The new language feature CALL . . . USING BY CONTENT does not generate new
object code. Programs using this feature can be compiled when the object version level is
restricted to 1 or 2 on Compile Command Option Z.
When compiling a sequence of programs not separated by END PROGRAM headers, you
must restrict the object version level to 1 or 2. Versions 3.00 and later of the
RM/COBOL compiler interpret such a sequence as nested programs.
Object Version 4
The RM/COBOL compiler and runtime system versions 4.nn support object
version 4. These product releases extend the high subset of ANSI COBOL 1985 with the
X/Open Screen Section. The RM/COBOL version 4.nn runtime systems support the
language features of object versions 1 through 4.
2. ACCEPT statements that specify the FROM ESCAPE KEY or the FROM
EXCEPTION STATUS phrase.
Note Programs with any of these four features will not execute on runtime version 3.nn
or earlier systems. Since these features required new runtime system support, you cannot
compile them if the object version level is restricted to 3 or less with Compile Command
Option Z. If the object version level is restricted to 3 or less, the RM/COBOL compiler
diagnoses these features as an object version incompatibility.
Object Version 5
The RM/COBOL compiler and runtime system versions 5.nn support object
version 5. The RM/COBOL version 5.nn runtime systems support the language features
of object versions 1 through 5.
Two language features were added in object version 5 that are not supported by the earlier
versions. These are as follows:
1. A READ statement that specifies the PREVIOUS phrase for a relative or indexed
organization file.
Note Programs with either of these two features will not execute on runtime
version 4.nn or earlier systems. Since these features required new runtime system
support, you cannot compile them if the object version level is restricted to 4 or less with
Compile Command Option Z. If the object version level is restricted to 4 or less, the
RM/COBOL compiler diagnoses these features as an object version incompatibility.
Two language features were added in object version 6 that are not supported by earlier
versions. These are as follows:
2. A START statement that specifies an identifier in the SIZE phrase. Even though the
SIZE phrase is supported only by the 5.2n compiler, a literal specified in the SIZE
phrase of the START statement is supported by all RM/COBOL runtime system.
Note Programs with either of these two features will not execute on runtime
version 5.1n or earlier systems. Since these features require new runtime system support,
you cannot compile them if the object version level is restricted to 5 or less with Compile
Command Option Z. If the object version level is restricted to 5 or less, the
RM/COBOL compiler diagnoses these features as an object version incompatibility.
1. Adding a literal value in the range –128 to +127 to an integer binary data item that is
within the first 65280 bytes of the program local data area. The addition can be the
result of an ADD statement, an INSPECT statement TALLYING phrase, a
PERFORM statement VARYING or AFTER phrase, a SEARCH statement
VARYING phrase or an UNSTRING statement TALLYING phrase.
2. Subtracting a literal value in the range –127 to +128 from an integer binary data item
that is within the first 65280 bytes of the program local data area. The subtraction
can be the result of a SUBTRACT statement or a PERFORM statement VARYING
or AFTER phrase.
3. PERFORM statement with the TIMES phrase when the local data area for the
program, including compiler-generated temporary data items, is less than 65280
bytes in length.
4. Subscripted operands 255 characters or less in length that are elements of tables
within the first 65280 bytes of the program local data area that are specified in
5. Operands, subscripted or not, 255 characters or less in length that are within the first
65280 bytes of the program local data area specified in ACCEPT, CALL, CALL
PROGRAM, CANCEL, DISABLE, DISPLAY, ENABLE, INITIALIZE, INSPECT,
MOVE, READ, RECEIVE, RELEASE, RETURN, REWRITE, SEND, SET,
START, STOP, STRING, UNSTRING and WRITE statements or in class or relation
conditions.
6. Nonnumeric relations where the subject and object operands are different length data
items, neither operand is subscripted or reference modified other than by literals,
both operands are 255 characters or less in length, and both operands are within the
first 65280 bytes of the program local data area.
Note The program local data area is the area of storage reserved for File Section,
Working-Storage, Communication, and Screen Section data items not described with the
external attribute. Linkage Section data items and data items described with the
EXTERNAL clause are not part of the program local data area.
Object Version 7
The RM/COBOL compiler and runtime system versions 6.nn support object
version 7. In addition, runtime system version 6.nn supports the language features of
object versions 1 through 7.
New language features were added in object version 7 that are not supported by earlier
versions. These are as follows:
3. The compiler and runtime system provide support for the START statement to
specify the FIRST or LAST KEY phrase. For example, START file-name KEY IS
FIRST key-name.
4. The compiler and runtime system provide support for duplicate prime record keys
(WITH DUPLICATES may be specified for the RECORD KEY phrase).
6. The compiler and runtime system provide support for multiple record locks in the
same file. The LOCK MODE clause of the file control entry may now specify the
LOCK ON MULTIPLE RECORDS phrase.
Note Programs that use any of these features will not execute on runtime versions 5.n
or earlier systems. Since these features require new runtime system support, you cannot
compile them if the object version level is restricted to 6 or less with Compile Command
Option Z. If the object version level is restricted to 6 or less, the RM/COBOL compiler
diagnoses these features as an object version incompatibility.
Object Version 8
The RM/COBOL compiler and runtime system versions 7.nn support object
version 8. In addition, runtime system version 7.nn supports the language features of
object versions 1 through 8.
New language features were added in object version 8 that are not supported by earlier
versions. These are as follows:
2. Pointer data items (USAGE POINTER), the figurative constant NULL (NULLS), the
ADDRESS special register, and Formats 5 and 6 of the SET statement for
manipulating pointer data items.
5. The OMITTED option for an argument in the USING phrase of a CALL statement.
The RM/COBOL version 7.00 and later compilers generate code to reference the
data item on which the linkage record is based, that is, the actual argument passed by
the calling program or the area of memory referenced by a SET ADDRESS OF
statement. This new code is not supported by earlier runtime systems. If the
Compile Command options specify object version 7 or lower, then the previous code
is generated that uses the description of the data item in the linkage section of the
called program.
7. A source program may now use more than 64K of name space (unique spellings of
user-defined words), but object versions less than 8 support a maximum of 64K of
name space for the object symbol table. If the Compile Command Option Y is
specified to place the symbol table in the object file for debugging purposes and
more than 64K of name space has been used, object version 8 is required and will be
generated regardless of the maximum object version setting specified in the Compile
Command Option Z. The compiler generates a diagnostic message in this event.
Note 1 Programs that use any of these features will not execute on runtime versions 6.n
or earlier systems. Since these features require new runtime system support, you cannot
compile them if the object version level is restricted to 7 or less with Compile Command
Option Z. If the object version level is restricted to 7 or less, the RM/COBOL compiler
diagnoses these features as an object version incompatibility.
Note 2 Several important language features added in the version 7.0 releases of
RM/COBOL do not generate object version 8 code for their implementation. These
include level-number 78 constant-name declarations, constant-name references, the
DATE-COMPILED option in the ACCEPT statement, in-line comments, a numeric literal
specified in the VALUE clause for a numeric edited data item, and the COUNT,
COUNT-MAX, COUNT-MIN, LENGTH, and PROGRAM-ID special registers. A
binary allocation override that specifies two-, four-, or eight-byte allocation may be used
for any object version. A binary allocation override that specifies sixteen-byte allocation
may be used for object version 7.
The extension language elements are RM/COBOL extensions to the American National
Standard COBOL X3.23-1985. Extensions such as the ACCEPT and DISPLAY screen
control syntax simplify the use of COBOL in an interactive environment. Other
extensions relax some of the rules of COBOL to simplify program writing.
The obsolete language elements are language features declared obsolete in ANSI COBOL
1985. The standard has declared certain features as obsolete to indicate that they will be
removed in the next full revision of COBOL. The features declared obsolete are ones,
such as the ALTER statement, that have been identified as contributing to poor
programming practices. Obsolete features should be avoided in new programs and
removed from existing programs when they are revised.
The subset language elements are language features that are required only when more
than the minimum COBOL language is implemented. Above minimum COBOL, there
are two additional subsets defined by the standard: intermediate and high. In addition,
RM/COBOL supports two standard optional modules: segmentation and communication.
Each of these optional modules is further divided into a level 1 and level 2 subset, where
the level 2 subset includes the level 1 subset.
Compile Command Option F (see page 6-15) contains a flagging option to cause flagging
of the occurrence of any of the items in the following lists. Each of the lists is preceded
by an explanation of the flagging message produced for items on that list.
is produced for each of the following language elements if they appear in a source
program compiled with the F=EXTENSION Compile Command Option (see page 6-15).
Each item on the list is an RM/COBOL extension to the American National Standard
COBOL X3.23-1985 language features and may, therefore, not be available in other
COBOL implementations.
Many extensions noted for RM/COBOL-8X do not appear below. These extensions have
not been deleted, but have been incorporated as standard features in the American
National Standard COBOL X3.23-1985.
10. Reserved words used as system-names (the ASSIGN clause in the file control
entry, the VALUE OF clause in the file description entry, and the ENTER
statement).
11. Use of an index-name in subscripting a table other than the one with which it is
associated.
41. ALTERNATE RECORD KEY clause that specifies that split-key-name option.
45. CODE-SET clause that refers to an alphabet-name defined with the literal phrase.
47. LINAGE clause integer operand with a positive sign explicitly specified.
51. DEPENDING phrase specified in OCCURS clause that omits [TO integer-2].
53. PICTURE character-string that ends in a comma or period and is not immediately
followed by a period space separator.
54. REDEFINES of last name on same level, even though it is also a REDEFINES.
60. VALUE clause in a data description entry that specifies the WHEN SET TO
FALSE phrase.
62. VALUE clause in a data item data description entry in an external record in the
Working-Storage Section record that is included in the source program as the
result of a COPY statement.
63. VALUE clause that specifies a numeric literal for a numeric edited data item.
64. Procedure Division header that specifies the GIVING or RETURNING phrase.
66. END PROGRAM header that specifies a nonnumeric literal for the program-name.
76. ACCEPT . . . FROM SYSIN when SYSIN not defined as a mnemonic-name in the
SPECIAL-NAMES paragraph.
86. ACCEPT with screen control (LINE, POSITION, SIZE, CURSOR, CONTROL,
ERASE, TAB, UNIT, PROMPT, UPDATE, ECHO, BLINK, REVERSE, HIGH,
LOW, OFF, CONVERT, NO BEEP, ON EXCEPTION, NOT ON EXCEPTION,
END-ACCEPT, BEFORE TIME).
92. CLOSE statement that specifies the NO REWIND phrase with either the REEL or
UNIT phrase.
98. DISPLAY with screen control (LINE, POSITION, SIZE, CONTROL, ERASE,
UNIT, BLINK, REVERSE, HIGH, LOW, CONVERT, BEEP).
106. INSPECT statement that refers to a group data item as a control operand.
109. OPEN EXTEND statement that refers to a file described with the LINAGE clause.
114. READ statement that specifies the WITH NO LOCK or WITH LOCK phrase.
119. SET statement (Format 1) that specifies more than one TO phrase.
120. SET statement (Format 2) that specifies more than one UP/DOWN BY phrase.
122. SET statement that specifies more than one instance of the TO TRUE phrase.
123. SET statement (Formats 5 and 6) that refers to a pointer data item.
124. START statement with LESS THAN, LESS THAN OR EQUAL, or equivalent
relations.
126. START statement in which the FIRST or LAST option is specified in the KEY
phrase.
127. STOP statement that specifies an identifier instead of the literal phrase.
Obsolete Elements
The warning message:
is produced for each of the following language elements if they appear in a source
program compiled with the F=OBSOLETE Compile Command Option (see
page 6-15). Each item on the list is identified in the American National Standard COBOL
X3.23-1985 as being an obsolete language element which will be deleted
from the next full revision of the COBOL standard.
1. ALL literal, where literal has a length greater than 1 if associated with a numeric
or numeric edited data item.
4. RERUN clause.
7. VALUE OF clause.
9. ALTER statement.
Subset Elements
The warning message:
is produced for each of the following language elements if they appear in a source
program compiled with the appropriate F Compile Command Option (see page 6-15).
The keyword which causes the language element to be flagged is shown in parentheses
after each element description. Note that HIGH elements will be flagged if
F=INTERMEDIATE or F=HIGH is specified, COM2 elements will be flagged if
F=COM1 or F=COM2 is specified, and SEG2 elements will be flagged if F=SEG1 or
F=SEG2 is specified.
If obsolete element flagging is also enabled, any obsolete element from the following
list will only be flagged as obsolete even when the other keyword is also specified in
the F Compile Command Option. That is, obsolete flagging takes precedence over
subset flagging.
3. Symbolic-character (HIGH).
6. Qualification (HIGH).
56. Procedure Division header USING phrase with more than five operands (HIGH).
66. CALL statement USING phrase with more than five operands (HIGH).
Abbreviation Meaning
ACK Acknowledgment
BEL Bell
BS Backspace
CAN Cancel
CR Carriage Return
DC1 Device Control 1
DC2 Device Control 2
DC3 Device Control 3
DC4 Device Control 4
DEL Delete
DLE Data Link Escape
EM End of Medium
ENP Enable Presentation
ENQ Enquiry
EOT End of Transmission
ESC Escape
ETB End of Transmission Block
ETX End of Text
FF Form Feed
FS File Separator
GS Group Separator
HT Horizontal Tab
IFS Interchange File Separator
IGS Interchange Group Separator
INP Inhibit Presentation
IRS Interchange Record Separator
IUS Interchange Unit Separator
LF Line Feed
NAK Negative Acknowledgment
Abbreviation Meaning
NL New Line
NUL Null
RS Record Separator
SEL Select
SI Shift In
SO Shift Out
SOH Start of Heading
STX Start of Text
SUB Substitute
SYN Synchronous Idle
US Unit Separator
VT Vertical Tab
X-2 Index
B
Block size, 10-26
B (Breakpoint) Command, Debug option, 9-21
indexed files, xlvii, 8-53, 8-56
B Compile Command Option, 6-8, 10-15
relative files, 8-48
B keyword, RUN-OPTION configuration
sequential files, 8-42
record, 10-33
BLOCK-SIZE keyword
B Runtime Command Option, 7-4, 8-20, 10-33
RUN-FILES-ATTR configuration
Backspace key, 8-3
record, 10-26
BACKSPACE value, ACTION keyword,
RUN-INDEX-FILES configuration
10-41, 10-45
record, 10-31
BCOLOR keyword
RUN-REL-FILES configuration record, 10-34
CONTROL phrase, ACCEPT and DISPLAY
RUN-SEQ-FILES configuration record, 10-34
statements, 2-21, 3-31, 8-12, 8-24, 10-40
Boolean, 2-10, 2-12, 2-19–2-20, 3-17
TERM-ATTR configuration record, 10-36
Bourne Shell script, xlvii, D-1
BEEP keyword
BPS keyword, TERM-UNIT configuration
CONTROL phrase, DISPLAY statement, 8-24
record, 10-49
RUN-ATTR configuration record, 10-24
Btrieve MicroKernel Database Engine (MKDE).
BEEP phrase
See Btrieve, system considerations for
ACCEPT and DISPLAY statements, 10-24
Btrieve, system considerations for, xliv, 4-1
DISPLAY statement, 8-23
C$BTRV subprogram, xxviii, F-3
BEFORE TIME phrase, ACCEPT
components
statement, 8-21
Btrieve MicroKernel Database Engine
CHARACTER-TIMEOUT keyword,
(MKDE), 4-4, 4-5
TERM-ATTR configuration record, 10-36
configuration and installation, 4-7
BELL phrase. See BEEP phrase
limitations with RM/COBOL indexed
Binary allocation, 10-6, 10-9, C-18, C-21
files, 4-19
Binary sequential files
types of
configuring, 10-15, 10-35
client-based, 4-4
record delimiting technique, 6-8, 8-42
server-based, 4-4
BINARY-ALLOCATION keyword,
Btrieve requester for Windows
COMPILER-OPTIONS configuration
NT/Windows 95/Windows 98,
record, 10-6, C-18, C-21, F-6
4-4, 4-5
BINARY-ALLOCATION-SIGNED keyword,
NetWare, 4-4
COMPILER-OPTIONS configuration RM/COBOL development system, 4-4, 4-5
record, 10-9, C-18 RM/COBOL runtime system, 4-4, 4-5
BLINK keyword RM/COBOL-to-Btrieve Adapter (rmbtrv32)
CONTROL phrase, DISPLAY statement, 8-24 program, xliv, 4-1, 4-4, 4-5, 4-7, 10-20
RUN-ATTR configuration record, 10-24 dynamic link libraries, 4-5, 4-18
BLINK phrase file management system, RM/COBOL, 4-6
ACCEPT and DISPLAY statements, 10-24 files
DISPLAY statement, 8-23 split keys, 4-7
Blinking attribute, 2-20, 8-23 system considerations, 4-7
BLOCK CONTAINS clause, file description versus RM/COBOL indexed file
performance, 4-8
entry, xlvii, 8-42, 8-48, 8-53, 8-56
X-4 Index
COBOL-74 keyword, COMPILER-OPTIONS Compatibility between RM/COBOL (74) 2.n and
configuration record, 10-9 RM/COBOL-85, 6-14, 6-16
Cobol-CGI, 1-3 Compatibility with earlier version of
Cobol-RPC, 1-3 RM/COBOL, object versions, H-1
Cobol-WOW, 1-3 Compilation. See also Compile Command;
CODE keyword, TERM-INPUT configuration Compiler
record, 10-41 Compile Command, 6-3
CodeBridge, xxvi, 1-2, F-4. See also libraries, 6-3
CodeBridge documentation listings, 6-18
CODE-SET clause, 8-37, 8-44, 8-49, 8-54 process, 6-1
Code-set translation tables, J-1 system files
character abbreviations, J-15 listing, 6-2, 6-18, 10-19, 10-20
CodeWatch, xxvi, 1-2, 3-4, 6-13. See also object, 6-2
CodeWatch documentation source, 6-2
COLLATING SEQUENCE clause, 8-37, Compile Command, 6-3
8-54, 8-55 error marker and diagnostics, 6-31
Color terminal support, 8-24 error recovery, 6-32
TERM-ATTR configuration record error threading, 6-33
BCOLOR keyword, 10-36 format of, 6-4
FCOLOR keyword, 10-39 invoking, 6-1
USE-COLOR keyword, 10-40 messages
with ACCEPT and DISPLAY statements, banner, 6-33
2-21, 3-31, 8-11–8-13 compiler configuration errors, 6-35, 6-42
with pop-up windows, 2-21, 8-24 compiler exit codes, 6-44
COLUMN and COL phrases. See POSITION compiler status, 6-34
phrase options, 6-5
COLUMNS keyword allocation map (A), 6-9, 6-22, 9-1,
PRINT-ATTR configuration record, 10-21 9-9, 10-12
TERM-ATTR configuration record, 10-37 alternate usage of COMP data items (U),
Combine Program utility (rmpgmcom), 3-4, 6-3, 6-7, 10-10
6-13, 10-11, 10-16, G-9 and the negation character ~, 6-5
Combined sign ANSI COBOL 1974 or 1985 semantics (7),
leading, C-10 6-14, 10-9, F-22
trailing, C-9 binary sequential files (B), 6-8, 10-15
Comma, EDIT-COMMA keyword, 10-24 compiler configuration (G), 6-6, 10-1, A-38
Commands compiler configuration supplement (H),
compile, 6-3 6-6, 10-1, A-38
debug, 9-2 compiler memory (W), 6-7, 10-16
runtime, 7-1 create smaller COBOL object files (Q),
Commit File function, 10-27 6-13, 9-1, 11-3, A-2, F-11, F-40
Communications descriptor (CCD), 8-68 cross reference map (X), 6-11, 6-28, 10-13
COMP. See COMPUTATIONAL language element flagging (F), 6-15, 10-12,
I-2, I-8, I-9
X-6 Index
COMPILER-OPTIONS configuration Configuration files
record (Cont.) ini2reg utility, xliii, 3-4, 3-16, G-40
LISTING-TIME-SEPARATOR recover1.ini, 3-16
keyword, 10-14 rmcobol.ini, 3-16
OBJECT-PATHNAME keyword, 10-14 runcobol.ini, 3-16
OBJECT-VERSION keyword, 10-14 Configuration records, 6-5, 10-3
RESEQUENCE-LINE-NUMBERS attached configuration file, xlv, 10-2, G-39
keyword, 10-14 built-in configuration file, xlv, 10-2, D-5
RMCOBOL-2 keyword, 10-15 COMPILER-OPTIONS, 10-6
SEPARATE-SIGN keyword, 10-15 DEFINE-DEVICE, 10-16
SEQUENTIAL-FILE-TYPE keyword, 10-15 errors, 10-3
SUPPRESS-NUMERIC-OPTIMIZATION EXTENSION-NAMES, 10-19
keyword, 10-15 EXTERNAL-ACCESS-METHOD,
SYMBOL-TABLE-OUTPUT keyword, 10-16 xlvii, 4-9, 10-20
WORKSPACE-SIZE keyword, 10-16 list of, 10-3
Compressed files, UNIX installation, 2-2 PRINT-ATTR, 10-20
Compression. See DATA-COMPRESSION RUN-ATTR, 10-23
keyword; KEY-COMPRESSION keyword RUN-FILES-ATTR, xlii, 10-26
COMPUTATIONAL data format, 6-16 RUN-INDEX-FILES, 4-16, 10-31
type option, Compile Command, 6-7 RUN-OPTION, 10-33
COMPUTATIONAL-1 data format, 6-16 RUN-REL-FILES, xlii, 10-34
COMPUTATIONAL-3 data format, 6-16 RUN-SEQ-FILES, xlii, 10-34
COMPUTATIONAL-AS-BINARY keyword, RUN-SORT, 10-36
COMPILER-OPTIONS configuration TERM-ATTR, 10-36
record, 10-9 TERM-INPUT, 10-41
COMPUTATIONAL-TYPE keyword, TERM-INTERFACE, 10-49
COMPILER-OPTIONS configuration TERM-UNIT, 10-49
record, 10-10, C-12, C-13 Constant-name, user-defined word type, 6-27
COMPUTATIONAL-VERSION keyword, Control characters, DEFINE-CONTROL-
COMPILER-OPTIONS configuration CHARACTERS keyword, 10-50
record, 10-10, C-13, C-17 CONTROL phrase
Condition-name, user-defined word type, 6-24 ACCEPT and DISPLAY statements, 8-11
config.sys BUFFERS command, 8-60 BCOLOR keyword, 8-12
config.sys FILES command, 8-60 DISPLAY statement, 8-24, 8-26
Configuration errors, 6-35, 6-42, 10-3, A-1, A-37 FCOLOR keyword, 8-12
Configuration file options, 6-5 GRAPHICS keyword, 8-13, 8-17
negating, 6-5 MASK keyword, 8-2, 8-3, 8-14
Configuration file structure, 10-1 PASS-THRU keyword, 8-17
termcap default configuration example, 10-51 PROMPT keyword, 8-18
terminfo default configuration example, 10-54 REPAINT-SCREEN keyword, 8-18
Windows default configuration example, SCREEN-COLUMNS keyword, 8-18
10-57 TAB keyword, 8-17
with the Compile Command options, 6-5 terminfo strings, 2-21
X-8 Index
DATA keyword, TERM-INPUT configuration Debug (Cont.)
record, 10-42 error messages, 9-13
DATA-CHARACTERS keyword, TERM-ATTR general concepts, 9-2
configuration record, 10-37 breakpoints, 9-3
DATA-COMPRESSION keyword, RUN- data types, 9-4
INDEX-FILES configuration record, 10-31 debug values, 9-4
Data-name, user-defined word type, 6-24 execution counts, 9-3
Date intraline numbers, 9-3, F-11, F-40
listing format configuration, 10-13 line numbers, 9-3
listing separator configuration, 10-14 statements, 9-2
DBCS characters, xlii, 8-15, 10-37 stepping, 9-3
DBCS-CHARACTERS keyword, TERM-ATTR traps, 9-3
configuration record, xlii, 10-37 invoking, 9-1
Debug output debugging information (Y Compile
command summary, 9-2 Command Option), xxxiii, 6-13, G-9
commands regaining control, 9-11
clear breakpoints (C), 9-22 screen positions, 9-5
clear data traps (U), 9-40 DEBUG keyword, COMPILER-OPTIONS
display set breakpoints (B), 9-21 configuration record, 10-11
display the value of a data item (D), 9-23. Debugging, symbolic
See also Data address development configuration, 10-16
end a Debug session (E), 9-27 Y Compile Command Option, xxxiii, 6-13, G-9
modify the value of a specified data DEBUG-TABLE-OUTPUT keyword,
item (M), 9-28 COMPILER-OPTIONS configuration
resume program execution at a specified record, xxxiii, 10-11
location (R), 9-34, A-2 Decimal point, EDIT-DECIMAL keyword, 10-25
set a breakpoint and clear once DEFAULT-FILE-VERSION-NUMBER
satisfied (A), 9-20 keyword, RUN-INDEX-FILES
set a breakpoint and do not clear once configuration record, 10-31
satisfied (B), 9-21 DEFAULT-TYPE keyword, RUN-SEQ-FILES
specify a screen line for Debug configuration record, 10-35
displays (L), 9-28 Define Indexed File utility (rmdefinx), 3-4, 8-50,
step through individual statements (S), 9-35 8-56, 8-64, 8-65, A-31, G-19
stop program execution (Q), 9-33 DEFINE-CONTROL-CHARACTERS keyword,
trap a data item when its value TERM-UNIT configuration record, 10-50
changes (T), 9-36 DEFINE-DEVICE configuration record, 10-16
data address development, 9-6 DEVICE keyword, 10-16
address-size format, 9-9 ESCAPE-SEQUENCES keyword, 3-25,
alias format, 9-11 10-17, E-38
identifier format, 9-6 PATH keyword, 10-17
debug references PIPE keyword, 10-17
in the data item, 9-5 RAW keyword, 3-26, 10-17, E-43
in the program area, 9-5 Windows printers, 10-18
X-10 Index
DISPLAY statement E
CONTROL phrase (Cont.)
E (End) Command, Debug option, 9-27
GRAPHICS keyword, 2-21, 3-41,
E Compile Command Option, 6-9, 6-20, 10-13
8-13, 8-17
EBCDIC code-name, translation, J-5–J-14
HIGH keyword, 8-24
character abbreviations, J-15
LOW keyword, 8-24
ECHO phrase, ACCEPT statement, 2-23
MASK keyword, xlii, 8-14
Edit keys
NO BEEP keyword, 8-24
backspace, 8-3
NO BLINK keyword, 8-24
delete character, 8-3
NO ERASE keyword, 8-24
erase entire, 8-4
NO REVERSE keyword, 8-24
erase remainder, 8-4
PASS-THRU keyword, 8-17
insert character, 8-4
REPAINT-SCREEN keyword, 8-18, D-23
left arrow, 8-3
REVERSE keyword, 8-24
masked input processing, 8-3
SCREEN-COLUMNS keyword, 8-18
right arrow, 8-3
CONVERT phrase, 2-23, 2-25
EDIT-COMMA keyword, RUN-ATTR
ERASE phrase, 8-19, 8-24
configuration record, 10-24
HIGH phrase, 8-17, 8-19, 8-25
EDIT-CURRENCY-SYMBOL keyword,
LINE phrase, 8-25
RUN-ATTR configuration record, 10-24
LOW phrase, 8-17, 8-19, 8-25
EDIT-DECIMAL keyword, RUN-ATTR
pop-up windows, creating, 8-22
configuration record, 10-25
POSITION phrase, 8-25
EDIT-DOLLAR keyword, RUN-ATTR
REVERSE phrase, 8-20, 8-25
configuration record, 10-25
SIZE phrase, 2-23, 2-25, 8-17, 8-20
ENABLE statement, 8-65, 8-69
UNIT phrase, 8-26
ENABLE-LOGGING keyword, RUN-OPTION
DISPLAY-INTENSITY keyword, RUN-ATTR
configuration record, 10-33
configuration record, 10-24
ENABLE-OLD-DOS-FILENAME-HANDLING
DLL. See Dynamic link libraries
keyword, RUN-FILES-ATTR configuration
Dollar sign, EDIT-DOLLAR keyword, 10-25.
record, 10-27
See also Currency symbol
Enhancements to RM/COBOL
Double-byte character set characters, xlii, version 6.5, xliii
8-15, 10-37 version 6.6, xli
DUPLICATES phrase, RECORD KEY version 7, xxv
clause, H-8 Enterprise CodeBench, 1-3, D-4
Dynamic link libraries, 3-12, 8-35 Environment variables
16-bit and 32-bit implementations, xliii for NetWare search paths, 3-13
Btrieve requester for Windows, 4-5 HOME, 2-3
RM/COBOL-to-Btrieve Adapter (rmbtrv32) PATH, 2-4, 3-12, 6-35, 6-41, 8-36, G-26
program, 4-18 resolution of program names, xlvii
RMPATH, 2-4, 3-11–3-13, 3-30, 8-32
RUNPATH, 2-4, 3-11–3-13, 3-30, 4-10, 8-35
TERM, 2-11, 8-18
TERMCAP, 2-10
TERMINFO, 2-11
X-12 Index
File allocation, in indexed files, 8-56 File types and structure
File buffering, 6-43, 8-40, 8-49, 8-54, indexed files (Cont.)
8-60, 10-26 file allocation increment, 8-56, 10-31,
File control entry G-16, G-20
CODE-SET clause, 8-37, 8-49, 8-54 file size estimation, 8-56
COLLATING SEQUENCE clause, 8-37, 8-55 file version number, 8-56, 10-31,
RECORD KEY clause, H-8 G-16, G-22
File description entry RECORD clause, 8-52
BLOCK CONTAINS clause, 8-42, 8-48, 8-53 RESERVE clause, 8-54
CODE-SET clause, 8-37, 8-44, 8-49, 8-54 WITH NO LOCK phrase, 8-55
LINAGE clause, 8-43 relative files, 8-47
RECORD clause, 8-42, 8-48, 8-52 BLOCK CONTAINS clause, 8-48
File lock facility, 2-8 CODE-SET clause, 8-49
File lock limit, xlii, 10-28, G-16 RECORD clause, 8-48
File management system, RM/COBOL, 4-6 RESERVE clause, 8-49
File naming conventions, RM/COBOL, WITH NO LOCK phrase, 8-49
1-4, 10-19 sequential files, 8-41
File organization ADVANCING mnemonic-name
indexed, 8-50 phrase, 8-45
relative, 8-47 ADVANCING ZERO LINES phrase, 8-45
sequential, 8-41 binary sequential, 6-8, 8-42, 10-15, 10-35
File performance, indexed files, 8-59 BLOCK CONTAINS clause, 8-42
File sharing, 8-38 CODE-SET clause, 8-44
FILE STATUS clause, file control entry, device support, 8-46
10-27, 10-30 LINAGE clause, 8-43
File status data item line sequential, 6-8, 8-41, 10-15, 10-35
indexed file, 8-55 printer support, 8-46
relative file, 8-50 RECORD clause, 8-42
sequential file, 8-44 REEL and UNIT phrases, 8-45
File type options, Compile Command, 6-8 RESERVE clause, 8-44
File types and structure, 8-40 REVERSED phrase, 8-44
indexed files, 8-50 tape support, 8-47
and Btrieve, 4-1, 4-4, 4-8 WITH NO LOCK phrase, 8-44
BLOCK CONTAINS clause, 8-53, 8-62, WITH NO REWIND phrase, 8-45
10-31, G-15, G-20 File version number, in indexed files, xlii, 8-56,
block sizes, xlvii, 8-56 8-64, 10-31, G-16, G-22
CODE-SET clause, 8-54 FILE-CONTROL-PARAGRAPH
COLLATING SEQUENCE clause, 8-55 indexed file control entry, 8-54
data compression, 8-50, 8-63, 10-31, relative file control entry, 8-49
10-32, G-15, G-20 sequential file control entry, 8-44
data recoverability, 8-51, 8-63, 10-32, FILE-HANDLE-LIMIT keyword, RUN-FILES-
G-16, G-20 ATTR configuration record, 10-27
X-14 Index
Initialization File to Windows Registry Internal data formats
Conversion utility (ini2reg), xliii, 3-4, nonnumeric data items, C-2
3-16, G-40 numeric computational data items, C-5
Input sequence specification, 10-44 signed numeric COMPUTATIONAL, C-13
Input/output control signed numeric COMPUTATIONAL-1, C-14
redirection of, 2-22, 8-1, 10-25 signed numeric COMPUTATIONAL-3, C-16
standard error device, 2-25, 6-7, 10-25 signed numeric COMPUTATIONAL-4, C-21
standard input device, 2-22, 10-25 unsigned numeric COMPUTATIONAL, C-11
standard output device, 2-24–2-25, 6-11, 6-18, unsigned numeric COMPUTATIONAL-3,
6-33, 6-41, 10-13, 10-25, 10-39 C-15
Insert Character key, 8-4 unsigned numeric COMPUTATIONAL-4,
INSERT-CHARACTER value, ACTION C-18
keyword, 10-41, 10-46 unsigned numeric COMPUTATIONAL-6,
Insertion mode C-24
ANSI, 10-45 numeric DISPLAY data items, C-5
RM, 10-45 signed numeric DISPLAY (LEADING
single-character, 10-45 SEPARATE), C-8
Installation signed numeric DISPLAY (LEADING), C-10
UNIX, 2-1–2-3 signed numeric DISPLAY (TRAILING
system considerations, 2-3–2-25. See also SEPARATE), C-7
Configuration records signed numeric DISPLAY (TRAILING), C-9
system requirements, 2-1 unsigned numeric DISPLAY (NSU), C-6
system verification, 5-1 Internal subprogram library, F-1
Windows, 3-1–3-7
registering the runtime, 3-5 K
system considerations, xliv, 3-7–3-45.
K Compile Command Option, 6-7, 6-18, 10-13
See also Configuration records
K keyword, RUN-OPTION configuration
system removal, 3-7
record, 10-33
system requirements, 3-1
K Runtime Command Option, 7-3, 10-33,
system verification, 5-3
A-41–A-42
Installing the utility programs, G-3
KEEP-FLOPPY-OPEN keyword, RUN-FILES-
Instrumentation
ATTR configuration record, 10-28
data analysis, 11-4
Key compression, 8-63, 10-32
ANALYSIS program, 11-4
KEY phrase
listing files processed by, 11-5
DISABLE statement, 8-69
suppression of, 11-7
ENABLE statement, 8-69
data collected, 11-2
KEY-COMPRESSION keyword, RUN-INDEX-
method of, 11-3
FILES configuration record, 10-32
sample data structure, 11-2
Keys
invocation of, 11-1
cursor types, 2-9, 3-43
Interactive Debugger. See Debug
defined, 8-2
INTERMEDIATE-FILES keyword, RUN-SORT
edit, 8-3
configuration record, 10-36
generate field termination codes, 8-5
X-16 Index
LISTING-TIME-SEPARATOR keyword, MCS. See Message Control System
COMPILER-OPTIONS configuration Memory available for a run unit, 2-7, 3-41
record, 10-14 MEMORY-SIZE keyword, RUN-SORT
Local area networks (LANs), 4-1, 4-4, 4-9, D-2 configuration record, 10-36
Locating RM/COBOL files Message Control System (MCS), 8-65, D-5
directory search sequences Message file processing errors, A-39
under UNIX, 2-4 Message files, 3-12
under Windows, 3-11 Messages. See also Runtime messages
file access names compiler
under UNIX, 2-5 banner, Compile Command, 6-33
under Windows, 3-13, 3-29 configuration errors, 6-35, 6-42
file locations within operating system error marker and diagnostic format, 6-31
pathnames error recovery, 6-32
under UNIX, 2-3, 10-27 error threading facility, 6-33
under Windows, 3-10, 10-27 exit codes, 6-44
NetWare search paths, 3-13 initialization errors, 6-43
Windows systems print jobs, 3-15 input/output errors, 6-35
LOG-PATH keyword, RUN-OPTION status, 6-34
configuration record, 10-33 syntax errors, 6-31
LOW keyword, CONTROL phrase, DISPLAY debug errors, 9-13
statement, 8-24 program exit codes, 7-8, 8-33
LOW phrase recover1, G-26, G-34
ACCEPT and DISPLAY statements, redirection of input and output, 2-22
8-17, 8-19 runtime errors, 7-7, A-1
DISPLAY statement, 8-25 Microsoft Windows
Low-intensity attribute, 2-20, 8-12, 8-25 32-bit implementation, xliii
LOWLIGHT. See LOW phrase CALL "SYSTEM", 3-45, 6-44, 7-8,
D-20, F-41
M configuration
creating a shortcut, 3-7
M (Modify) Command, Debug option, 9-28
filename extension associations, 3-9
M Compile Command Option, 2-23, 6-11, 10-6
prompting for a filename, 3-9
M keyword, RUN-OPTION configuration
Control menu, 3-43
record, 10-34
Copy option, 3-44
M Runtime Command Option, 2-25, 7-4, 10-34
Copy table option, 3-44
Makefile. See Customizing RM/COBOL for
icon, 3-42
UNIX
Paste option, 3-24, 3-44
Map Indexed File utility (rmmapinx), xlvi, 3-4,
Properties option, 3-44
8-61, G-14
default configuration example, 10-57
Map Program File utility (rmmappgm), 3-4, G-12
file sharing, 8-38
MASK keyword, CONTROL phrase,
ini2reg utility, xliii, 3-4, 3-16, G-40
ACCEPT and DISPLAY statements, xlii,
initialization files, 3-16
8-2, 8-3, 8-14
Masked input processing, xlii, 8-2, 8-14, 8-16
X-18 Index
N OFF phrase, ACCEPT statement, 8-17, 8-20
ON EXCEPTION phrase
N Compile Command Option, 6-11
ACCEPT statement, 2-22–2-24, 8-5, 8-21
NAME keyword, EXTERNAL-ACCESS-
CALL statement, 8-35
METHOD configuration record, 10-20
ON OVERFLOW phrase, CALL statement, 8-35
Named pipe support, 8-47
Online services, xxxix
NetWare, 3-10, 4-4
OPEN OUTPUT
search paths, 3-13
block sizes in indexed files, xlvii, 8-56
system requirements, 3-1–3-2
sequential files in a shared environment, 8-38
Network file access, 2-8
OPEN statement
NO BEEP keyword
REVERSED phrase (sequential I-O), 8-44
CONTROL phrase, DISPLAY statement, 8-24
WITH LOCK phrase, 8-38
RUN-ATTR configuration record, 10-24
OPTIONS keyword, EXTERNAL-ACCESS-
NO BLINK keyword
METHOD configuration record, 10-20
CONTROL phrase, DISPLAY statement, 8-24
Organization of this guide, xxxiv
RUN-ATTR configuration record, 10-24
Overlay file, compiler, 2-5, 3-12
NO ERASE keyword, CONTROL phrase,
DISPLAY statement, 8-24
NO REVERSE keyword
P
CONTROL phrase, DISPLAY statement, 8-24 P Compile Command Option, 6-10, 6-18, 6-33,
RUN-ATTR configuration record, 10-25 6-41, 10-13
Nonnumeric data items, C-2 P$ChangeDeviceModes subprogram, E-37, E-44
NO-TERMINAL-DISPLAY value, LISTING- P$ClearDialog subprogram, E-15
ATTRIBUTES keyword, 10-13 P$ClearFont subprogram, E-24, E-29
Number of files a run unit can open, 2-8 P$DisplayDialog subprogram, 3-15, E-16
Number of region locks, 2-8 P$DrawBitmap subprogram, E-7, E-19
Numeric computational data items, C-5 P$DrawBox subprogram, E-20, E-22, E-23
Numeric DISPLAY data items, C-5 P$DrawLine subprogram, E-20, E-23
P$EnableDialog subprogram, 3-15, 3-25, E-16
O P$EnableEscapeSequences subprogram, E-38
P$GetDeviceCapabilities subprogram,
O Compile Command Option, 6-12, 10-14
E-39, E-44
Object file, 6-2, 6-3, 7-1
P$GetDialog subprogram, E-17, E-44
default extension, 10-19
P$GetHandle subprogram, E-41
OBJECT keyword, EXTENSION-NAMES
P$GetPosition subprogram, E-21, E-28
configuration record, 10-19
P$GetPrinterInfo subprogram, E-41, E-44
Object program options, Compile
P$GetTextExtent subprogram, E-25
Command, 6-11
P$GetTextMetrics subprogram, E-25, E-29, E-44
Object versions, G-13, H-1–H-10
P$GetTextPosition subprogram, E-28
OBJECT-PATHNAME keyword, COMPILER-
P$LineTo subprogram, E-21, E-23
OPTIONS configuration record, 10-14
P$MoveTo subprogram, E-22
Objects, external, 8-36
P$SetBoxShade subprogram, E-22, E-34
OBJECT-VERSION keyword, COMPILER-
P$SetDefaultAlignment subprogram, E-28
OPTIONS configuration record, 10-14
P$SetDefaultMode subprogram, E-7, E-8, E-35
X-20 Index
PRINT-ATTR configuration record, 10-20 Printing, from Windows
AUTO-LINE-FEED keyword, 10-21 examples, code fragments (Cont.)
COLUMNS keyword, 10-21 print multiple copies, E-13, E-75
FORM-FEED-AVAILABLE keyword, 10-21 print multiple text outputs on the
LINAGE-INITIAL-FORM-POSITION same line, E-78
keyword, 8-43, 10-21 print text at the corners of a page, E-82
LINAGE-PAGES-PER-PHYSICAL-PAGE print text at the top of a page, E-81
keyword, 8-43, 10-22 set alignment of text, E-84
LINES keyword, 10-22 set text position, E-84
TOP-OF-FORM-AT-CLOSE keyword, 10-23 set the point size for a specific font, E-83
WRAP-COLUMN keyword, 10-23 set the printer device, display the Windows
WRAP-MODE keyword, 10-23 Print dialog box, and check the return
Printer code value, E-76
DEFINE-DEVICE configuration P$ subprogram functions, E-1–E-9
record, 10-17 bypass printer drivers and enable printing
file access names, 2-7 with escape sequences, E-85
support on sequential files, 8-46 change the current printer, E-43
PRINTER? printer device, 10-19, 3-15, E-4, change the orientation of the paper, E-37
E-16, E-41, E-43 change the paper source, E-37
Printing, from Windows, xxvi, 3-15, 3-25, 3-26, clear all font description values and return
10-18, E-1 them to their default (unset) state, E-24
copy files, E-44 clear values of the Windows Print dialog
escape sequences, RM/COBOL-specific, box to their default (unset) state, E-15
E-43, E-85 compute the printable area of the page to be
raw mode-byte I/O, E-43, E-85 printed, E-39
examples, code fragments concatenate lines while printing, E-31
change a font while printing, E-77 display Windows Print dialog box
change the orientation of the page, E-75 automatically when predefined
change the orientation of the paper, E-79 printer device (PRINTER?) is next
change the pitch of a font, E-79 opened, E-16
change the print resolution, E-75 draw a line starting at the current position,
draw a box around text, E-73 E-21
draw a box using relative positioning, E-73 draw boxes, E-20
draw a ruler, E-74 draw boxes around text, E-25
draw a shaded box with colors, E-73 draw lines, E-20
list of, E-71 enable a set of RM/COBOL-specific escape
open and write to separate printers, E-80 sequences, E-38
print a watermark, E-73 enable printing with RM/COBOL-specific
print a word in boldface type, E-78 escape sequences and bypass printer
print a word in italics, E-78 drivers, E-43
print a word underlined, E-78 font, returning to normal, E-6
print bitmap files, E-77 generate columns of text, E-36
X-22 Index
Q
Registry file, xliii, 3-16
Q (Quit) Command, Debug option, 9-33
C$GUICFG subprogram, F-16
Q Compile Command Option, 6-13, 9-1, 11-3,
Initialization File to Windows Registry
A-2, F-11, F-40
Conversion utility (ini2reg), xliii, 3-4,
3-16, G-40
R Load Registry On CALL property, 3-22, 3-30
R (Resume) Command, Debug option, 9-34, A-2 Load Registry On RETURN property,
R Compile Command Option, 6-10, 10-15 3-22, 3-30
RAW keyword, DEFINE-DEVICE configuration RM/COBOL Configuration utility (rmconfig),
record, 3-26, 10-17, E-43 xliii, 3-4, 3-16, G-41
READ statement Relative File Conversion utility
WITH NO LOCK phrase (indexed I-O), 8-55 rmcrl1, G-6
WITH NO LOCK phrase (relative I-O), 8-49 rmcrl2, G-7
WITH NO LOCK phrase Relative files, 8-40, 8-47. See also File types
(sequential I-O), 8-44 and structure
RECEIVE statement, 8-65 Relativity, 1-3
RECORD clause, 8-42, 8-48, 8-52 Removing pop-up windows, 8-26
Record delimiting techniques Renaming executables, 1-4
binary sequential, 6-8, 8-42 REPAINT-SCREEN keyword, CONTROL
configuring, 10-15, 10-34 phrase, ACCEPT and DISPLAY
line sequential, 6-8, 8-41 statements, 8-18, D-23
RECORD KEY clause, file control entry, REPAINT-SCREEN value, ACTION
DUPLICATES phrase, H-8 keyword, 10-41, 10-46
Record locking, 2-8, H-9 REPLACING LINE phrase, SEND
time-out settings, 10-27, 10-30 statement, 8-69
Redirection of input and output control, 2-22, RESEQUENCE-LINE-NUMBERS keyword,
6-18, 8-1, 10-25 COMPILER-OPTIONS configuration
REDRAW-ON-CALL-SYSTEM keyword, record, 10-14
TERM-ATTR configuration record, 10-39, RESERVE clause, 8-44, 8-49, 8-54
D-20 Reserved words, dereserve, 6-16, 10-12
REEL phrase, CLOSE statement RESET-ANSI-INSERTION value, ACTION
(sequential I-O), 8-45 keyword, 10-41, 10-46
Region lock facility, H-9 Resolution of program names, xlvii, 8-34
under UNIX, 2-8 RESOLVE-LEADING-NAME keyword,
Registering the runtime, 3-5 RUN-FILES-ATTR configuration
Registration, xxxix record, 2-6, 3-15, 10-29
RESOLVE-SUBSEQUENT-NAMES
keyword, RUN-FILES-ATTR
configuration record, 2-6, 3-15, 10-30
RETURN-CODE special register, 7-8, 8-33
Reverse attribute, 2-20
X-24 Index
RM/COBOL indexed files and Btrieve RM/Panels, 1-3
MicroKernel Database Engine Load Registry On CALL property, 3-22
limitations (Cont.) Load Registry On RETURN property, 3-22
support for Btrieve internal data formats, 4-24 pop-up menus, 3-36
support for RM/COBOL internal data formats, three-dimensional controls, 3-24
4-23 RM/plusDB, 10-20, D-3
using existing Btrieve files with RM/COBOL, rmattach utility, xlv, 10-2, G-39
4-21 rmbtrv32 program. See RM/COBOL-to-Btrieve
variable-length records, 4-7, 4-15, 4-23 Adapter (rmbtrv32) program; Btrieve
verification of maximum record and block rmcobol (Compile Command), 6-1, 6-3
length, 4-23 RMCOBOL-2 keyword, COMPILER-OPTIONS
RM/COBOL Open File Manager, 10-20, D-2 configuration record, 10-15
RM/COBOL-to-Btrieve Adapter (rmbtrv32) rmconfig utility, xliii, 3-4, 3-16, G-41
program. See also Btrieve rmdefinx utility, 3-4, 8-50, 8-56, 8-64, 8-65,
Btrieve MicroKernel Database Engine A-31, G-19
(MKDE), 4-4, 4-5 rmmapinx utility, xlvi, 3-4, 8-61, G-14
Btrieve software requirements, 3-2 rmmappgm utility, 3-4, G-12
COBOL application programs, 4-5 RMPATH environment variable, 2-4, 3-11–3-13,
concepts, 4-1 3-30, 8-32
configuration options, 4-9, 10-20 rmpgmcom utility, 3-4, 6-3, 6-13, 10-11,
EXTERNAL-ACCESS-METHOD record 10-16, G-9
B rmbtrv32 MKDE page size, 4-10 ROWS keyword, TERM-ATTR configuration
C create, 4-10 record, 3-26, 10-39
D duplicates, 4-11 RUN-ATTR configuration record, 10-23
I initial display, 4-12 ACCEPT-FIELD-FROM-SCREEN keyword,
L lock, 4-13 8-1, 10-23
M mode, 4-14 ACCEPT-INTENSITY keyword, 10-23
O owner, 4-15 ACCEPT-PROMPT-CHAR keyword, 10-24
P rmbtrv32 page size, 4-8, 4-15, 4-23 BEEP keyword, 10-24
T diagnostic trace filename, 4-15 BLINK keyword, 10-24
RUN-INDEX-FILES record DISPLAY-INTENSITY keyword, 10-24
BLOCK-SIZE, 4-16 EDIT-COMMA keyword, 10-24
DATA-COMPRESSION, 4-16 EDIT-CURRENCY-SYMBOL
dynamic link libraries, 4-5, 4-18 keyword, 10-24
enhancements, xliv EDIT-DECIMAL keyword, 10-25
file management system, RM/COBOL, 4-6 EDIT-DOLLAR keyword, 10-25
indexed files, 4-1, 4-5 ERROR-MESSAGE-DESTINATION
RUNPATH environment variable, 4-10 keyword, 2-25
starting, 4-18 REVERSE keyword, 10-25
system considerations for Btrieve files, 4-7 SCROLL-SCREEN-AT-TERMINATION
RM/InfoExpress, xlvii, 1-3, 10-20, D-2 keyword, 10-25
TAB keyword, 10-26
UNDERLINE keyword, 10-26
X-26 Index
Runtime Command S
options (Cont.)
S (Step) Command, Debug option, 9-35
maximum size for ACCEPT and DISPLAY
S Compile Command Option, 6-7, 6-16, 10-15,
buffers (B), 7-4, 8-20, 10-33
C-7, C-9
memory to be used for a sort
S Runtime Command Option, 7-4, 11-7
operation (T), 7-4, A-7, A-36
Scan suppression, 6-32
object or non-COBOL program libraries
Screen field, initial contents, 8-1
(L), 7-2, 7-6, 8-34, A-40, G-11
Screen width, 8-18
pass an argument to the main
SCREEN-COLUMNS keyword, CONTROL
program (A), 7-5
phrase, ACCEPT and DISPLAY
supplemental runtime configuration
statements, 8-18
file (X), 7-3, 10-1, A-38
SCREEN-CONTENT-OPTIMIZE keyword,
switch set and reset (S), 7-4, 11-7
TERM-ATTR configuration record, 10-39
samples of valid and invalid, 7-6
SCREEN-ESCAPE value, ACTION
types of options
keyword, 10-41, 10-47
configuration, 7-3
SCREEN-HOME value, ACTION
debug and test, 7-3
keyword, 10-41, 10-47
environment, 7-4
SCREEN-PREVIOUS-FIELD value, ACTION
program, 7-5
keyword, 10-41, 10-47
Runtime messages
SCREEN-TERMINATE value, ACTION
error message format, A-1
keyword, 10-41, 10-47
error message types, 7-7, A-1
SCROLL-SCREEN-AT-TERMINATION
COBOL normal termination, A-1, A-42
keyword, RUN-ATTR configuration
configuration, A-1, A-37
record, 10-25
data reference, A-1, A-3
SECURE phrase, ACCEPT statement, 8-17,
input/output, A-1, A-11
8-20. See also OFF phrase
internal error, A-1, A-36
Segmentation, 6-1
message control, A-1, A-37
SELECT clause, use of, 3-14
operator-requested termination, A-1, A-3
SEND statement, 8-65, 8-69
procedure, A-1, A-6
Separate sign
runcobol initialization messages, A-1, A-39
compiler option, 6-7
initialization errors, A-39
configuration, 10-15
main program loading errors, A-40
leading, C-8
message file processing errors, A-39
trailing, C-7
option processing errors, A-40
SEPARATE-SIGN keyword, COMPILER-
registration error messages, A-41
OPTIONS configuration record, 10-15
runcobol banner message, A-41
Sequential File Conversion utility (rmcseq), G-8
runcobol usage message, A-41
Sequential files, 8-40, 8-41. See also File types
sort-merge, A-1, A-36
and structures
traceback, A-1, A-3
SEQUENTIAL-FILE-TYPE keyword,
COMPILER-OPTIONS configuration
record, 10-15
X-28 Index
T
Termcap, 8-2
T (Trap) Command, Debug option, 9-36
database, 2-10–2-22
T Compile Command Option, 6-11, 6-18, 6-33,
default configuration, 10-51
6-41, 10-13
changing, D-2
T Runtime Command Option, 7-4, A-7, A-36
terminal input and output, 2-9
TAB keyword
TERMCAP environment variable, 2-10
CONTROL phrase, ACCEPT statement, 8-17
TERMCAP keyword, TERM-INTERFACE
RUN-ATTR configuration record, 10-26
configuration record, 10-49
TAB phrase, ACCEPT statement, 8-17
Terminal attributes, 2-9
Tab stops
configuring, 10-36
configuring, 10-35
Terminal input and output
source files (BDS), 6-2
cursor types, 2-9
Table of Contents (TOC)
terminal attributes, 2-9
rmmappgm utility, G-12
terminal interfaces, 2-9
rmpgmcom utility, G-9
Terminal interfaces, 2-9, D-2
TAB-STOPS keyword, RUN-SEQ-FILES
TERMINAL-LISTING value, LISTING-
configuration record, 10-35
ATTRIBUTES keyword, 10-13
Tape
Terminate. See SCREEN-TERMINATE value
DEFINE-DEVICE configuration
Terminfo, 8-2
record, 10-17
database, 2-10–2-22
file access names, 2-7
default configuration, 10-54
support on sequential files, 8-47
changing, D-2
Technical support services, xxxix
terminal input and output, 2-9
TEMP, locating temporary files, 8-59
TERMINFO environment variable, 2-11
Temporary files, locating, 8-59
TERMINFO keyword, TERM-INTERFACE
TERM environment variable, 2-11, 8-18
configuration record, 10-49
TERM-ATTR configuration record, 10-36
TERM-INPUT configuration record, 10-41
BCOLOR keyword, 10-36
ACTION keyword, 10-41
CHARACTER-TIMEOUT keyword,
field editing actions
8-21, 10-36
BACKSPACE value, 10-45
COLUMNS keyword, 10-37
CONTROL-BREAK value, 10-45
DATA-CHARACTERS keyword, 10-37
DELETE-CHARACTER value, 10-45
DBCS-CHARACTERS keyword, xlii, 10-37
ERASE-ENTIRE value, 10-46
FCOLOR keyword, 10-39
ERASE-REMAINDER value, 10-46
PASS-THRU-ESCAPE keyword, 8-17, 10-39
ESCAPE-TO-COMMAND value, 10-46
REDRAW-ON-CALL-SYSTEM
ESCAPE-TO-OS value, 10-46
keyword, 10-39, D-20
FIELD-HOME value, 10-46
ROWS keyword, 3-26, 10-39
INSERT-CHARACTER value, 10-46
SCREEN-CONTENT-OPTIMIZE
LEFT-ARROW value, 10-46
keyword, 10-39
REPAINT-SCREEN value, 10-46
SUPPRESS-NULLS keyword, 10-40
RESET-ANSI-INSERTION value, 10-46
USE-COLOR keyword, 10-40
RIGHT-ARROW value, 10-47
X-30 Index
Unsigned numeric COMPUTATIONAL-3, C-15 Utilities (Cont.)
Unsigned numeric COMPUTATIONAL-4, C-18 Relative File Conversion
Unsigned numeric COMPUTATIONAL-6, C-24 rmcrl1, G-6
Unsigned numeric DISPLAY (NSU), C-6 rmcrl2, G-7
UPDATE phrase, ACCEPT statement, 8-1 RM/COBOL Configuration (rmconfig),
UPON/FROM CONSOLE phrase, ACCEPT and xliii, 3-4, 3-16, G-41
DISPLAY statements, 2-22–2-25 Sequential File Conversion (rmcseq), G-8
USAGE clause, 10-10, C-5
data description entry, 10-8 V
USE-COLOR keyword, TERM-ATTR
V Compile Command Option, 6-8, 6-16, 10-15
configuration record, 10-40
VanGui Interface Builder, 1-3, D-5
USE-LARGE-FILE-LOCK-LIMIT keyword
Variable-length records, 4-7, 4-15, 4-23
RUN-REL-FILES configuration
Verification procedures
record, xlii, 10-34
for UNIX, 5-1
USE-LARGE-FILE-LOCK-LIMIT keyword,
for Windows, 5-3
RUN-SEQ-FILES configuration
Version number, file, xlii, 8-56, 8-64, 10-31,
record, xlii, 10-35
G-16, G-22
USE-PROCEDURE-RECORD-LOCK-
Video display attributes, 2-9
TIMEOUT keyword, RUN-FILES-ATTR
configuration record, 10-30
User-defined words, 6-22
W
Utilities W Compile Command Option, 6-7, 10-16
Attach Configuration (rmattach), xlv, WANs. See Wide Area Networks (WANs)
10-2, G-39 WCB-BORDER-CHAR parameter, 8-28
Combine Program (rmpgmcom), 3-4, 6-3, WCB-BORDER-SWITCH parameter, 8-28
6-13, 10-11, 10-16, G-9 WCB-BORDER-TYPE parameter, 8-28
Define Indexed File (rmdefinx), 3-4, 8-50, WCB-FILL-SWITCH parameter, 8-29
8-56, 8-64, 8-65, A-31, G-19 WCB-HANDLE parameter, 8-28
delivered media, G-2 WCB-LOCATION-REFERENCE
Indexed File Conversion (rmifca parameter, 8-28
and rmifcb), G-4 WCB-NUM-COLS parameter, 8-28
Indexed File Recovery (recover1), xlii, xlvi, WCB-NUM-ROWS parameter, 8-28
2-5, 3-4, 3-12, 3-16, 3-18, 8-51, 8-64, WCB-TITLE parameter, 8-29
8-65, 10-31, A-13, A-31, G-23 WCB-TITLE-JUSTIFICATION parameter, 8-29
recover2, xlii, G-35 WCB-TITLE-LENGTH parameter, 8-29
recovery, xlii WCB-TITLE-LOCATION parameter, 8-29
Initialization File to Windows Registry Web site, xxxix
Conversion (ini2reg), xliii, 3-4, Wide area networks (WANs), D-2
3-16, G-40 WINDOW-CREATE keyword, pop-up windows
installation, 2-2, G-3 CONTROL phrase, 8-22
Map Indexed File (rmmapinx), xlvi, 3-4, WINDOW-REMOVE keyword, pop-up windows
8-61, G-14 CONTROL phrase, 8-26
Map Program File (rmmappgm), 3-4, G-12
X
X Compile Command Option, 6-11, 6-28, 10-13
X Runtime Command Option, 7-3, 10-1, A-38
Y
Y Compile Command Option, xxxiii, 6-13, 9-1,
9-5, 9-6, 10-11, 10-16, G-9, H-10
Year 2000 subprogram, xlvi, F-7
Z
Z Compile Command Option, 6-14, H-2
Zoned sign
leading, C-10
trailing, C-9
X-32 Index
Liant Software Corporation
License Agreement
THIS LICENSE AGREEMENT SETS FORTH THE TERMS AND CONDITIONS OF THE LICENSE AND THE
LIMITED WARRANTY FOR THE SOFTWARE ON THE ENCLOSED MAGNETIC AND/OR CD-ROM MEDIA.
CAREFULLY READ THE FOLLOWING LICENSE AGREEMENT BEFORE BREAKING THE SEAL ON ANY
OF THE MEDIA. BY BREAKING THE SEAL YOU ACCEPT THE TERMS OF THIS AGREEMENT. IF YOU
DO NOT ACCEPT THE TERMS OF THIS AGREEMENT, DO NOT OPEN ANY OF THE MEDIA; PROMPTLY
RETURN THE ENTIRE PACKAGE TO YOUR DEALER FOR A FULL REFUND.
DEFINITIONS
The following definitions apply to the terms as they appear in this agreement.
• Liant means Liant Software Corporation, a Delaware corporation.
• You and Your refer to any person or entity that acquires or uses this Package.
• Package means the Software, user's manual(s), and other items accompanying this
agreement.
• Software refers to the computer program contained in this Package, together with all codes,
techniques, software tools, formats, designs, concepts, methods, and ideas associated with
that computer program. The term also includes all copies of any part of the Software, as well
as the user manual(s), other printed materials, and any "online" or electronic documentation,
contained in this Package.
• Media means magnetic disks, tape, and/or CD-ROM containing the Software.
• LAN means a local area network of computers interconnected to each other or to a hub or
concentrator by metallic or fiber-optic circuits. Computers or networks connected over public
common carrier circuits or over a public switched-circuit network, are not considered to be a
single LAN.
• Usage Level means the number of simultaneous uses of the Software on a single computer
or LAN, permitted under this agreement as indicated on the Media.
PERMITTED USES
Liant grants You a non-exclusive license to use the Software in this Package according to the
terms set forth below.
You may:
• Install the Software on one computer at a time.
• Make one backup copy of the Software, which automatically becomes the property of Liant
and is subject to this agreement.
• Operate the Software on one computer or LAN at a time.
• In the case of LAN installations, operate the Software on as many computers on a single LAN
as is permitted by the Software's Usage Level.
• In the case of a multiuser computer, operate the Software to service up to the number of
concurrent program executions permitted by the Software's Usage Level.
PROHIBITED USES
You may not:
• Allow the Software to become available to any person or entity other than Your employees.
You may, however, after written notification to Liant, transfer all (but no lesser portion) of the
Software to another person or entity who is not otherwise prohibited by this agreement to use
the Software, provided such person or entity agrees in writing to be subject to all terms of this
agreement.
• Modify the Software or merge it with another program, except for Your personal use on a
single computer. The program resulting from any modification or merger of the Software is
subject to this agreement.
• Reverse engineer, disassemble, decompile, or make any attempt to discover the source code
to the Software.
• Translate or create derivative works based on the Software.
• Remove, obscure, or alter any notice of the patent, copyright, or other proprietary rights
related to the Software.
• Sub-license, sell, lend, rent, or lease any portion of the Software, directly or indirectly.
• Copy any portion of the Software, except to make a backup copy, as described above under
Permitted Uses.
• Transfer the Software or any direct, modified or merged product thereof to any person or
entity in violation of the United States Export Administration Act.
• Operate the Software on more than one computer or LAN at a time, except as described
above under Permitted Uses.
The Software involves valuable proprietary rights of Liant and others. There is no transfer to
You of any title to or ownership of the Software or any patent, copyright, trade secret, trade name,
trademark, and other proprietary rights related to the Software, regardless of the form that original
or other copies exist in. You may not violate these rights, and You must take all appropriate steps
to protect Liant's rights. Liant may at any time replace, modify, alter, improve, enhance, or change
the Software without prior notice.
Both the license and Your right to use the Software terminate automatically if You violate any
part of this agreement. In the event of termination, You must immediately destroy all copies of the
Software or return them to Liant.
LIMITED WARRANTY
For a period of ninety (90) days from the date You received the Software, Liant warrants that, upon
delivery by Liant and acceptance by You, the media on which the Software is distributed will be
materially free from defects in materials and workmanship and that the Software will substantially
conform to the specifications established by Liant. This warranty gives You specific legal rights,
and You may also have other rights that vary from state to state.
If any of the Software fails to comply with the warranties set forth above, Liant will replace the
Media or, at Liant's option, make a reasonable effort to correct the program errors. You must,
however, return all copies of the Software, along with a copy of Your paid invoice, to an authorized
Liant dealer within ninety (90) days of the date You received the Software. If Liant is unable to
correct defective Media or program errors, Liant will refund all or a fair portion of the price You paid
for this Package, at Liant's option. The refund will fully satisfy Your claims for Software or Media
failure. Any replacement software will be warranted for the rest of the original 90-day warranty
period or for thirty (30) days from the date You received the replacement, whichever is longer.
Liant WILL NOT BE LIABLE FOR ANY:
• BUG, ERROR, OMISSION, DEFECT, DEFICIENCY, OR NONCONFORMITY IN ANY SOFTWARE.
• IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
• IMPLIED WARRANTY RELATING TO COURSE OF PERFORMANCE, COURSE OF DEALING, OR
USAGE OF TRADE OR ANY OTHER IMPLIED WARRANTY OF ANY TYPE WHATSOEVER.
• CLAIM OF INFRINGEMENT.
• CLAIM IN TORT, WHETHER OR NOT ARISING IN WHOLE OR IN PART FROM Liant's FAULT,
NEGLIGENCE, STRICT LIABILITY, OR PRODUCT LIABILITY.
• CLAIM FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES,
COVER, OR LOSS OF DATA, REVENUE, CUSTOMERS, GOODWILL OR USE.
Any written or oral information or advice given by Liant dealers, distributors, agents, or employees
will in no way increase or modify the scope of this warranty. Nor may You rely on any such written
or oral communication.
GENERAL
Under this agreement, Liant is not responsible for maintaining or helping You to use the Software.
This agreement constitutes the entire agreement and supersedes any prior agreement
between Liant and You concerning this Package. Liant is not bound by any provision of any
purchase order, receipt, acceptance, confirmation, correspondence, or otherwise. This agreement
cannot be amended, modified, or waived, unless the change is written, specifically identified as an
amendment and signed by an authorized Liant representative and You.
U.S. GOVERNMENT RESTRICTED RIGHTS
The Software and accompanying documentation are provided with RESTRICTED RIGHTS. Use,
duplication, or disclosure by the Government is subject to restrictions as set forth in subparagraph
(c)(1)(ii) of the Rights in Technical Data and Computer Software clause at 48 DFARS 252.227-
7013, or in subparagraph (c)(1) and (2) of the Commercial Computer Software–Restricted Rights
clause at 48 CFR 52.27-19, as applicable. The contractor/manufacturer is Liant Software
Corporation, 8911 Capital of Texas Highway North, Suite 4300, Austin, Texas 78759-7267.