Introduction

The Purpose of This Manual

The VOS COBOL Programmer's Guide (R077) documents VOS COBOL. While this manual does discuss standard COBOL, it adds to the discussion by bringing in the additional flexibility and the extensions of VOS COBOL.

Audience

This manual is intended for the experienced programmer who is unfamiliar with COBOL. The material is basic so that any programmer should be able to find it useful.

This manual is also intended to assist the COBOL programmer who needs to know how VOS COBOL differs from ANSI COBOL. The manual discusses these differences throughout its sections and provides information on how to best use VOS COBOL.

This manual is not a tutorial for a person who is not familiar with a programming language. Such a person should obtain one of the many tutorials available on COBOL before reading this manual.

This manual is not an exhaustive study of COBOL. Refer to the VOS COBOL Language Manual  for additional information on COBOL.

This manual discusses VOS COBOL. VOS COBOL includes the features of ANSI COBOL, yet has relaxed many restrictions required in ANSI COBOL, and has added numerous extensions. Extensions make VOS COBOL more versatile and more powerful than ANSI COBOL. For a list of VOS COBOL extensions, refer to the VOS COBOL Language Manual .

The examples in this manual illustrate language features and constructs. They use terminal I/O extensively and are not examples of realistic applications.

Revision Information

This is Revision 0 of the VOS COBOL Programmer's Guide (R077). It documents VOS COBOL with VOS Release 5.0.

Manual Organization

This manual has 12 sections and a glossary.

Chapter 1 provides an overview of the concepts of the COBOL language.

Chapter 2 looks at a program's organization and major components. It discusses figurative constants, literals, separators, and the format_cobol_source command. Refer to Chapter 2 for an in-depth look at program structure and the first working example in the manual.

Chapter 3 provides information on data objects, the Data Division, and defining data. It includes a discussion of file and record descriptions, level numbers, condition-names, the redefines and renames clauses, categories of data, the usage and value clauses, and an introduction to tables.

Chapter 4 discusses VOS I/O and how to retrieve and store data. This section includes information on file organization, access modes, ports, I/O objects, and locking. It discusses open modes, file processing, and file error handling. Read Chapter 4 to become familiar with the different file types and to study many working programs illustrating the different aspects of files in COBOL.

Chapter 5 covers data manipulation. This section discusses COBOL's move statement and includes information on elementary and group moves. It discusses string manipulation via reference modification, the string and unstring statements, the inspect statement, and alphanumeric intrinsic functions. Variable-length data is also included.

Chapter 6 discusses arithmetic operations. This section lists the arithmetic statements, associated phrases, and numeric functions. It includes the add, subtract, multiply, divide, and compute statements. The section also discusses the giving, size error, and rounded phrases. It includes discussion of result fields and precision. Various numeric intrinsic functions are also mentioned. Read Chapter 6 for an overview of COBOL arithmetic handling capabilities.

Chapter 7 covers the various conditional statements. This section discusses the if statement and nesting. It includes relation, complex, abbreviated, class, sign, condition-name, and switch-status conditions. It mentions error conditions.

Chapter 8 discusses logical flow and program termination. It includes the go to, alter, perform, exit, and stop statements. The perform statement discussion includes iterative and nested performs. Read Chapter 8 to learn how to alter or stop the logical flow in a program.

Chapter 9 covers table handling. This section tells how to create a table and reference it using subscripts or indexes. It discusses varying length tables, the set statement, index data items, two dimensional tables, and the search and search all statements. It also discusses the use of perform varying, and the value and redefines clauses.

Chapter 10 provides information for sorting and merging files. This section includes the sort and merge statements. It discusses using more than one key, input and output procedures, and collating sequences.

Chapter 11 discusses how to call other programs in COBOL and other languages. It includes the call statement, COBOL to COBOL calls, entry point calls, pointer and entry data, the on exception phrase, and the cancel statement. It also discusses COBOL to PL/I calls, and function and operating system subroutine calls.

Chapter 12 discusses the library facility. This section covers the copy statement, library files, and the replacing phrase. Refer to Chapter 12 to learn how to copy commonly-used portions of code into a COBOL program.

Notation

Stratus documentation uses computer font to represent text that would appear on your CRT screen or on a line printer. (Such text is referred to as literal text.) For example:

The size error phrase can also be used with the compute statement.

Slanted font is used to represent general terms that are to be replaced by literal values. In the following example, the term source_file_name shows that the user must supply an actual program source file name.

The source_file_name identifies a COBOL source module.

Italics are used for new terms when they are introduced and defined. For example:

A sequential file consists of records that are stored consecutively and retrieved serially.

Boldface is used to emphasize words within the text. For example:

A switch is identified by its number and has an on and off position.

Related Manuals

Refer to the following Stratus manuals for related documentation.

VOS COBOL Subroutines Manual 

VOS Commands Reference Manual 

VOS Commands User's Guide 

VOS COBOL Language Manual 

How to Comment on This Manual

You can comment on this manual by using the command comment_on_manual, described in the VOS System Administrator's Guide (R012). Type comment_on_manual, press , and then complete the form that appears on your screen. You must fill in this manual's part number, R077. When you have completed the form, press . Your comments are sent to Stratus over the Remote Service Network. Note that VOS includes your name with your comments.

Stratus welcomes any corrections and suggestions for improving this manual.