COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references...

169
COBOL 128 Software System By K. A. Alexander Published by Abacus ;mHHHI Software

Transcript of COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references...

Page 1: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

COBOL 128 Software System

By K. A. Alexander

Published by

Abacus ;mHHHI Software

Page 2: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Copyright Notice

Abacus Software makes this package available for use on a single computer only. It is unlawful to copy any portion of this software package onto any medium for any purpose other than backup. It is unlawful to give away or resell copies of this package. Any unauthorized distribution of this product deprives the authors of their deserved royalties. For use on single-site multiple computers, please contact Abacus Software to make arrangements.

Wananty

Abacus Software makes no warnings, expressed or implied, as to the fitness of this software package for any particular purpose. In no event will Abacus Software be liable for consequential damages. Abacus Software will replace any copy of this software which is unreadable, if returned within 30 days of purchase. Thereafter, there will be a nominal charge for replacement.

First printing Printed in U.S.A. Copyright © 1984 Copyright© 1986

July 1986

K.A. Alexander, Visionary Software Abacus Software, Inc. P.O. BOX 7219 Grand Rapids, MI. 49510

ISBN# 0-916439-78-X

Page 3: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

( COBOL 128 Supplement )

Page 4: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL
Page 5: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 128

I COBOL 64 AND COBOL 128 - DIFFERENCES

The manuals for COBOL 64 and COBOL 128 are the same. There are a few minor differences in the two versions:

COBOL64 COBOL128

CORD program overlay in memory COED IT program overlay in memory COSYN program overlay in memory COSYNP program overlay in memory load procedure RUN "VSLOADER" monitor or television 40 or 80 column monitor/TV

Any references to COBOL 64 throughout this manual also apply to COBOL 128.

II CONVERTING COBOL 64 CODE TO COBOL 128

To convert a COBOL 64 programs to run on the Commodore 128 using COBOL 128, follow the procedures listed below.

1. With COBOL 64 on a C-64 (C-128 in C-64 mode), create a sequential file of the program by using the CRUNCH option from the MAIN MENU. The filename is prefixed by the letters cs (for COBOL Sequential).

2. Load and run COBOL 128. Replace the COBOL 128 distribution diskette with a diskette containing the sequential file.

3. Enter CRIP <RETURN> (for CRUNCH input).

4. Now enter the filename without the cs prefix followed by <RETURN>.

Page 6: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 128

5. The crunched file is then converted to a format compatible to COBOL 128.

III CONVERTING COBOL 128 CODE TO COBOL 64

To convert a COBOL 128 programs to run on the Commodore 64 using COBOL 64, follow the procedures listed below.

1. With COBOL 128 on a C-128, create a sequential file of the program by using the CRUNCH option from the MAIN

MENU. The filename is prefixed by the letters cs (for COBOL Sequential).

2. Load and run COBOL 64. Replace the COBOL 64 distribution diskette with a diskette containing the sequential file.

3. Enter CRIP <RETURN> (for CRUNCH input).

4. Now enter the filename without the cs prefix followed by <RETURN>.

5. The vs ED IT program overlay will now run. When VSEDIT is done, press any key to continue.

6. The crunched file is then converted to a format compatible toCOBOL64.

Page 7: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

PREFACE

It is assumed that the readers of this manual are familiar with the Commodore 64 computer and general programming techniques.

The names used in this publication are not of individuals living or otherwise. Any similarity or likeness of the names used in this publication with the names of any individuals, living or otherwise, is purely coincidental and not intentional.

Abacus Software believes that the information described in this manual is accurate and reliable, and much care has been taken in its preparation. However, no responsibility, financial or otherwise, is accepted for any consequences arising out of the use of this material. The information contained herein is subject to change.

ACKNOWLEDGEMENT

COBOL is an industry language and is not the property of any company or group of companies, or of any organization or group of organizations.

No warranty, expressed or implied, is made by any contributor or by the CODASYL Programming Language Committee as to the accuracy and functioning of the programming system and language. Moreover, no responsibility is assumed by any contributor, or by the committee, in connection therewith.

The authors and copyright holders of the copyrighted material used herein,

Flow-matic (trademark of Sperry Rand Corporation). Programming for the UNIVAC I and II, Data Automation Systems copyrighted 1958, 1959, by Sperry Rand Corporation; IBM Commercial Translator Form Number F 28-8013, copyrighted 1959 by IBM;FACT, DSI 27A5260-2760, copyrighted 1960 by Minneapolis-Honeywell,

have specifically authorized the use of this material in whole or in part, in the COBOL specifications. Such authorization extends to the reproduction and use of COBOL specifications in programming manuals or similar publications.

Page 8: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL
Page 9: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

TABLE OF CONTENTS

Chapter 1 - Introduction Chapter 2 - The Nature of COBOL IN GENERAL Chapter 3 - COBOL Advantages Chapter 4 - COBOL 64 Implementation Notes Chapter 5 - Hardware Consideration Chapter 6 - COBOL 64 Source Language

Section 1--Program Organization Section 2--Language Concepts Section 3--Editing Format Section 4--IDENTIFICA TION DIVISION Section 5--ENVIRONMENT DIVISION Section 6--DAT A DIVISION Section 7--PROCEDURE DIVISION

ACCEPT ACCEPT-1-KEY ADD CLOSE DEBUG-BREAK DEBUG-TRACE-OFF DEBUG-TRACE-ON DISPLAY DIVIDE EXIT FILTER-NUMERIC GOTO IF MOVE MULTIPLY OPEN PERFORM READ SET STOP RUN SUBTRACT WRITE

Chapter 7 -- Start Up/Operating Instructions

1 2 4 5 6 7 7 9

29 32 34 47 75 85 86 87 89 89 89 90 90 91 93 93 95 96 98

102 103 105 108 110 112 113 115

119

Page 10: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Chapter 8 -- Main Menu 120 CRUNCH 121 DEBUG 122

START-PROO 123

"""' RESUME-PROO 124 SINGLE-ON 124 SINGLE-OFF 124 EXIT 124 BREAK 1 125 BREAK2 125 BREAK3 125 OPTIONS 125 TRACE-ON-LINE 125 TRACE-OFF-LINE 125 TRACE-FAST 126 TRACE-SLOW 126 TRACE-ON 126 TRACE-OFF 127 RESET-OPTIONS 127

EDIT 128 COBOL 64 Statements 128 ...,,, DIRECTORY 129 LIST 130 DELETE 130 SYNTAX 131 AUTO 132 SAVE 132 RESEQUENCE 133 PRINT-ON 133 PRINT-OFF 133 EXIT 133

GET 134 NEW-NAME 134 NEW-PROO/EDIT 134 PRINT-ON 135 PRINT-OFF 135 RUN 135 SAVE 136

APPENDIX A - Sample Program/Exercises 137 """" APPENDIX B - Reserved Words 143 APPENDIX C - Language Summary 144 APPENDIX D - Sample Programs 146

Page 11: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

CHAPTERl

INTRODUCTION

This manual provides a complete description of the COBOL 64 System as implemented for use on the Commodore 64 computer or equivalent. The COBOL 64 programming language is designed along the guidelines of the American National Standards Institute (ANSI) X3.23-1974.

The language is an easy to learn subset of the ANSI 1974 standard Level 1 with appropriate extensions to utilize COMMODORE 64 features as well as providing high level program debugging capabilities. With COBOL 64 there is no need for the user to be concerned with machine language, memory addressing or hexadecimal notation. All debugging is performed at the source language (symbolic) level as opposed to the machine language level.

The COBOL 64 software system is a combination of an Editor, Compiler, Interpreter and Symbolic Debugger. These features have been designed with ease of learning and ease of use in mind to provide a powerful programming development tool for general business applications.

Commodore 64 is a registered trademark of Commodore Business Machines, Inc.

1

Page 12: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

CHAPTER2

THE NATURE OF COBOL IN GENERAL

COBOL is the most widespread commercial programming language in use today. The reasons for its vast success will be discussed below.

The word COBOL is an abbreviation for .Common B.usiness Qriented Language. It is a Business Oriented computer language designed for commercial applications. The rules governing the use of the language make it applicable for commercial problems.

COBOL is a computer language that is common to many computers. That is most computers can process a COBOL program with minor variations.

The universality of COBOL, therefore, allows computer users greater flexibility. A company is free to use computers of different manufacturers while retaining a single programming language. "'111 Similarly, conversion from one model computer to a more advanced or newer one presents no great problem. Computers of a future generation will also be equipped to use COBOL.

Since its creation in 1959, the COBOL language has undergone extensive refinement in an effort to make it more standardized The American National Standards Institute (ANSI), an association of computer manufacturers and users, has developed an industry-wide standard COBOL.

Thus the meaning of the word COBOL suggests two of its basic advantages. It is common to most computers, and it is commercially oriented. There are, however, additional reasons why it is such a popular language.

COBOL is an English-like language. All instructions are coded using English words rather than complex codes. To add two numbers together, for example, we use the word ADD. Another example of a COBOL statement is:

2

Page 13: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

MULTIPLY HOURS-WORKED BY HOURLY-WAGE GIVING GROSS-WAGES

The rules for programming in COBOL conform to many of the

rules for writing in English, making it a relatively simple language

~ to learn. It, therefore, becomes significantly easier to train

programmers. In addition, COBOL programs are written and

tested in far less time than programs written in other computer

languages.

Thus the English-like quality of COBOL makes it easy to write programs. Similarly, this quality makes COBOL programs easier

to read. Such programs can generally be understood by non-data

processing personnel. The business executive who knows little

about computers can better understand the nature of a programming

job simply by reading a COBOL program.

3

Page 14: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

CHAPTER3

COBOL ADVANTAGES

The long list of COBOL advantages is derived chiefly from its intrinsic quality of permitting the programmer to state the problem solution in English prose, and thus provide automatic program and system documentation. When users adopt well-chosen data-names before attempting to program a system, maximum documentational advantages of the language described herein are obtained.

To a computer user, COBOL 64 offers the following major advantages:

1. Expeditious means of program implementation providing a high degree of programmer productivity.

2. Accelerated programmer training and simplified retraining requirements.

3. Reduced conversion costs when changing from a computer of one manufacturer to that of another.

4. Significant ease of program modification/enhancements due to the high level of readability.

5. Documentation which facilitates nontechnical management participation in data processing activities.

6. A comprehensive source program diagnostic capability which includes tracing, break points and single step features.

4

Page 15: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

CHAPTER4

COBOL 64 IMPLEMENTATION NOTES

A program written in COBOL 64, called a source program, is accepted as input by the COBOL 64 software system. The system verifies that each source statement is syntactically correct, and then converts them into an intermediate condensed representation.

The intermediate program can then be executed on the Commodore 64 System using the COBOL 64 Interpreter. The interpreter causes the system hardware to perform the operations specified by the intermediate program and thus the source program.

5

Page 16: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

CHAPTERS

HARDWARE CONSIDERATIONS

COMMODORE 64 Computer or equivalent (BASIC V2) One to four Commodore 1541 disk drives or equivalent One optional Commodore 1525 printer or equivalent

6

Page 17: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

CHAPTER6

SECTION 1 PROGRAM ORGANIZATION

COBOL 64 SOURCE PROGRAM DIVISIONS

Every COBOL 64 source program must contain these four di visions in the following order:

IDENTIFICATION ENVIRONMENT DATA PROCEDURE

The IDENTIFICATION DIVISION identifies the program. In addition to required information, the programmer may include such optional pieces of information as the date written and programmer's name for documentation purposes. This division is completely machine-independent.

The ENVIRONMENT DIVISION specifies the equipment being used. It contains computer descriptions and some information about the files the program will use.

The DATA DIVISION contains not only file and record descriptions describing the data files that the program manipulates or creates, but also the individual logical records which comprise these files. The characteristics or properties of the data are described in relation to a standard data format rather than an

equipment-oriented format. Therefore, this division is to a large extent, computer-independent. While compatibility among

computers cannot be absolutely assured, careful planning in the data layout will permit the same data descriptions, with minor

modification, to apply to more than one computer.

The PROCEDURE DIVISION specifies user-supplied steps for computer execution. These steps are expressed in terms of

meaningful English words, statements, sentences, and paragraphs.

This division of a COBOL 64 program is often referred to as the

7

Page 18: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

"program". In reality, it is only part of the total program, and alone is insufficient to describe the entire program. This is true because repeated references must be made (either explicitly or implicitly) to information appearing in the other divisions. This division, more than any other, allows the user to express thoughts in meaningful English. Concepts of verbs to denote actions, and sentences to describe procedures are basic, as is the use of conditional statements to provide alternative paths of action.

REQUIRED HEADERS

The standard for COBOL 64 requires that a program consist of certain divisions, sections, and fixed paragraph names known as headers.

The following elements are the minimum required for a COBOL 64 program:

IDENTIFICATION DIVISION. PROGRAM-ID. MINIMUM.

ENVIRONMENT DIVISION. CONFIGURATION SECTION.

SOURCE-COMPUTER C64. OBJECT-COMPUTER C64.

DATA DIVISION. PROCEDURE DIVISION. STARTUP.

STOP RUN.

8

Page 19: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

SECTION 2 LANGUAGE CONCEPTS

GENERAL

As stated in Section 1, COBOL 64 is a language based on English and is composed of words, statements, sentences, and paragraphs. The following paragraphs define the rules to be followed in the creation of this language. The use of the different constructs formed from the created words is covered in subsequent sections of this document.

LANGUAGE DESCRIPTION NOTATION

A nearly universal form of notation exists for COBOL reference manuals. This manual uses that notation as described in the paragraphs that follow.

The apostrophe ( ' ) is used to delimit characters with specific meaning. Other than its use in this manual as a delimiter, it has no specific use in the COBOL language.

KEYWORDS

All underlined upper-case words are key words and are required when utilizing related functions. Omissions of key words will cause error conditions at compilation time. An example of key words follows:

IF data-name IS [NOT] {NUMERIC }

ALPHABETIC

The key words are I F , N o T , N u ME R I c , and

ALPHABETIC.

9

Page 20: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

OPTIONAL WORDS

All upper case words not underlined are optional words included for readability only and may be included or ...__.. excluded in the source program. In the preceding example, .,, the optional word is IS.

GENERIC TERMS

All lower-case words represent generic terms which are used to represent COBOL w~rds, literals, PI CT URE character-strings, comment-entries, or a complete syntactical entry that must be supplied in that format position by the programmer. Where generic terms are repeated in a general format, a number or letter appendage to the term serves to identify that term for explanation or discussion.

Identifier-1 and identifier-2 are generic terms in this example:

MOVE identifier-1 TO identif ier-2

BRACES

The following symbols are braces: { } . When words or phrases are enclosed in braces, a choice of one of the entries must be made. In the previous example in the subsection titled Keywords, either NUMER I c or ALPHABETIC must be included in the statement.

BRACKETS

The following symbols are brackets: [ ] . Words and phrases enclosed in brackets represent optional portions of a statement. A programmer wishing to include the optional """'11 feature may do so by including the entry shown between brackets. Otherwise, the optional portion may be omitted. [NOT J in the example titled Keywords, is optional.

10

Page 21: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

LEVEL-NUMBERS

When specific level-numbers appear in data description

entry formats those specific level-numbers are required when such entries are used in a COBOL 64 program. In

this document, the form O 1, O 2, ... , O 9 is used to

indicate level-numbers 1 through 9.

ELLIPSIS

The presence of the ellipsis (three consecutive

periods( ... ) within any format indicates the position at

which repetition may occur at the programmer's option.

The portion of the format that may be repeated is defined in the following paragraph.

The ellipsis applies to the words between the determined

pair of delimiters. Given the ellipsis in a clause or statement format, scanning right to left, determine the right

bracket or right brace immediately to the left of the ... ;

continue scanning right to left and determine the logically

matching left bracket or left brace.

11

Page 22: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

CHARACTER SET

The COBOL 64 character set for the COBOL 64 System consists of the following 46 characters:

O through 9 A through Z

blank or space + plus sign - minus sign or hyphen * asterisk I slash $ currency sign . period or decimal point " quotation mark ( left parenthesis ) right parenthesis

CHARACTERS USED FOR WORDS

The character set for words consists of the following 3 7 characters:

0 through 9 A through z - (hyphen)

PUNCTUATION CHARACTERS

The following characters may be used for program punctuation:

" quotation mark ( left parenthesis ) right parenthesis

space or blank . period

12

Page 23: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

EDITING CHARACTERS

The COBOL 64 System accepts the following characters in editing:

$ currency sign

* asterisk (check protect)

' comma I slash B space or blank insert 0 zero insert + plus sign

minus sign CR credit DB debit z zero suppress

period

LANGUAGE STRUCTURE

The individual characters of the language are concatenated to form character-strings and separators. A separator may be concatenated with another separator or with a character-string.

A character-string may only be concatenated with a separator. The concatenation of character-strings and separators forms the text of a source program.

SEPARATORS

A separator is a string of one or more punctuation characters. The rules for formation of separators are:

1. The punctuation character space is a separator. Anywhere a space is used as a separator, more than one space may be used.

2. The punctuation character period is a separator when immediately followed by a space.

13

Page 24: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

3. The punctuation character quotation mark is a separator. An opening quotation mark must be immediately preceded by the separator space, a closing quotation mark must be immediately followed by one of the separators space or "'11111 period followed by a space. Quotation marks may appear only in balanced pairs delimiting nonnumeric literals except when the literal is continued.

4. The punctuation characters right and left parentheses are separators. Parentheses may appear only in balanced pairs of left and right parentheses delimiting subscripts or indices. The right parentheses must be followed by a space.

5. The separator space may optionally immediately follow any separator except the opening quotation mark. In this case, a following space is considered as part of the nonnumeric literal and not as a separator.

Any punctuation character which appears as part of the specification of a PI CT URE character-string or numeric literal is not considered as a punctuation character, but rather as a symbol used in the specification of that PICTURE character-string or numeric literal. PICTURE character-strings are delimited only by the separators space or period followed by a space.

The rules established for the formation of separators do not apply to the characters which comprise the contents of nonnumeric literals, comment-entries, or comment lines.

CHARACTER-STRINGS

A character-string is a character of sequence of contiguous characters which forms a COBOL 64 word, literal, PICTURE character-string, or comment-entry. A character-string is delimited by separators.

14

Page 25: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

DEFINITION OF WORDS

A COBOL 64 word is created from a combination of not more than 30 characters, selected from the following:

O through 9 A through z - (hyphen)

A word is ended by a valid separator. A word may not begin or end with a hyphen. (A literal constitutes an exception to these rules, as explained in a paragraph entitled Literals in this section.) A word must begin with an alphabetic character.

A user-defined word is a COBOL 64 word that must be supplied by the user to satisfy the format of a clause or statement

TYPES OF WORDS

COBOL 64 contains the following word types:

nouns (user-defined words) verbs reserved words.

15

Page 26: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software

NOUNS

Nouns are divided into special categories:

File-name Record-name Data-name Program-name Index-name Paragraph-name

COBOL 64

The length of a noun must not exceed 30 characters. For purposes of readability, a noun may contain one or more hyphens. However, the hyphen must neither begin nor end the noun (this does not apply to literals).

All nouns within a given category must be unique, because no other noun in the same source program has identical spelling or punctuation. All user-defined words must begin with an alphabetic character.

File-Name

A file-name is a noun assigned to designate a set of data items. The contents of a file are divided into logical records made up of any consecutive set of data items.

Record-Name

A record-name is a noun assigned to identify a logical record. A record can be subdivided into a set of data items, each distinguishable by a data-name.

Data-Name

A data-name is a noun assigned to identify elements within 'tfllll a record or work area and is used in COBOL 64 to refer to an element of data, or to a defined data area containing data elements.

16

Page 27: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Index-Name

An index-name is a word that names an index associated with a specific table (refer to Indexing in this section). An index is a register, the contents of which represent the character position of the first character of an element of a table with respect to the beginning of the table.

Paragraph-Name

Verbs

A paragraph-name is a word which names a paragraph in the PROCEDURE DIVISION.

A verb in COBOL 64 is a single word that denotes action, such as ADD, WRITE, or MOVE. All allowable verbs in COBOL 64, with the exception of the word IF, are English verbs. The usage of the COBOL 64 verbs takes place within the PROCEDURE DIVISION.

17

Page 28: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

RESERVED WORDS

A reserved word is a COBOL 64 word that is one of a specified list of words which may be used in COBOL 64 source programs, but must not appear in the programs as user-defined words. Refer to Appendix B, Reserved Words.

These rules apply to the entire COBOL 64 source program; no exceptions exist for specific divisions or statements.

There are two types of reserved words:

KEY WORDS

Key words Optional words

A key word is a word whose presence is required in a source program. Within each format, such words are upper-case and underlined.

Key words are of three types:

1. Verbs such as ADD and READ.

2. Required words which appear in statement and entry formats.

3. Words which have a specific functional meaning such as SECTION.

OPTIONAL WORDS

Optional words are included in the COBOL 64 language to improve the readability of the statement formats. These optional words may be included or omitted. For example, IF A IS GREATER THAN B •.• is equivalent to IF A GREATER B ••• ; the inclusion or omission of the words Is and THAN does not influence the logic of the statement.

18

Page 29: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

LITERALS

A literal is an item of data whose value is implied by an ordered set of characters of which the literal is composed. There are two classes of a literal: numeric and nonnumeric.

NUMERIC LITERAL

A numeric literal is a character-string whose characters are selected from the digits O through 9, the plus sign (+),the minus sign (-), and/or the decimal point. Numeric literals may be from 1 to 18 digits in length. The rules for the formation of numeric literals are as follows:

1. A numeric literal must contain at least one digit

2. A numeric literal must not contain more than one sign character. If a sign is used, it must appear as the leftmost character of the literal. If the literal is unsigned, the literal is positive.

3. A numeric literal must not contain more than one decimal point. The decimal point is treated as an assumed decimal point, and may appear anywhere within the literal except as the rightmost character. If the literal contains no decimal point, the literal is an integer. An integer is a numeric literal which contains no decimal point.

If a literal conforms to the rules of the formation of numeric literals, but is enclosed in quotation marks, it is a nonnumeric literal and is treated as such by the system.

4. The value of a numeric literal is the algebraic quantify represented by the characters in the numeric literal. Every numeric literal belongs to category numeric. Refer to the P I c Tu RE clause in Section 6 for additional information. The size of a numeric literal in standard data format characters is equal to the number

19

Page 30: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

of digits specified by the user. The following are examples of numeric literals:

NONNUMERIC LITERAL

51678 .005 +2.629 -.8479

6287.92

A nonnumeric literal may be composed of any allowable character. The beginning and ending of a nonnumeric literal are both denoted by a quotation mark. Any character enclosed within quotation marks is part of the nonnumeric literal. Subsequently, all spaces enclosed within the quotation marks are considered part of the literal. Two consecutive quotation marks within a nonnumeric literal cause a single quotation mark to be inserted into the literal string.

All other punctuation characters are part of the value of the nonnumeric literal rather than separators; all nonnumeric literals belong to category alphanumeric. Refer to the PICTURE clause in Section 6.

A nonnumeric literal cannot exceed 120 characters. Examples of nonnumeric literals are:

Literal on Source Program Level Literal Stored by System

"THE TOTAL PRICE" "-2080.479" "A""B"

THE TOTAL PRICE -2080.479 A"B

Literals that are used for arithmetic computation must be expressed as numeric literals and must not be enclosed in quotation marks as nonnumeric literals. For example, _...... " 4 . 4 " and 4 . 4 are not equivalent. The system stores the ..._,, nonnumeric literal as 4 . 4, whereas the numeric literal would be stored as 0044 ifthe PICTURE were 999V9,

20

Page 31: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

with the assumed decimal point located between the two fours.

'-" LOGICAL RECORD AND FILE CONCEPTS

The purpose of defining file information is to distinguish between the physical aspects of the file and the conceptual characteristics of the data contained within the file.

PHYSICAL ASPECTS OF A FILE

The physical aspects of a file describe the data as it appears on the input or output media and include such features as:

1. The grouping of logical records within the physical limitations of the file medium.

2. The means by which the file can be identified.

CONCEPTUAL CHARACTERISTICS OF A FILE

The conceptual characteristics of a file are the explicit definition of each logical entity within the file itself. In a COBOL 64 program, the input or output statements refer to one logical record.

It is important to distinguish between a physical record and a logical record. A COBOL 64 logical record is a group of related information, uniquely identifiable, and treated as a unit.

A physical record is a physical unit of information whose size and recording mode are adapted to a particular computer for the storage of data on a input or output device. The size of a physical record is hardware dependent and has no direct relationship to the size of the file of information contained on a device.

The concept of a logical record is not restricted to file data but is carried over into the definition of working storage.

21

Page 32: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Working storage may be grouped into logical records and defined by a series of record description entries.

RECORD CONCEPTS

The record description consists of a set of data description entries which describe the characteristics of a particular record. Each data description entry consists of a level-number followed by a data-name, if required, followed by a series of independent clauses, as required.

CONCEPT OF LEVELS

A level concept is inherent in the structure of a logical record. This concept arises from the need to specify subdivisions of a record for the purpose of data reference. Once a subdivision has been specified, it may be further subdivided to permit more detailed data referral.

DATA DESCRIPTION CONCEPTS

The most basic subdivisions of a record, those not further subdivided, are called elementary items; consequently, a record is said to consist of a sequence of elementary items, or the record itself may be an elementary item.

In order to refer to a set of elementary items, the elementary items are combined into groups. Each group consists of a named sequence of one or more elementary items. Groups, in tum, may be combined into groups of two or more groups. An elementary item may belong to more than one group.

22

Page 33: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

LEVEL-NUMBERS

A system of level-numbers shows the organization of elementary items and group items. Since records are the most inclusive data items, level-numbers for records start at 01. Less inclusive data items are assigned higher (not necessarily successive) level-numbers not greater in value than 10. There is a special level-number 77 which is an exception to this rule. Separate entries are written in the source program for each level-number used.

A group includes all group and elementary items following it until a level-number less than or equal to the level-number of that group is encountered. All items which are immediately subordinate to a given group item must be described using identical level-numbers greater than the level-number used to describe that group item. Refer to Section 6 under LEVEL-NUMBER for additional information.

CONCEPT OF CLASSES OF DATA

The five categories of data items (refer to the PICTURE

clause in Section 6) are grouped into three classes: alphabetic, numeric, and alphanumeric. For alphabetic and numeric, the classes and categories are synonymous. The alphanumeric class includes the categories of alphanumeric edited, numeric edited, and alphanumeric (without editing). Every elementary item, except for an index data item, belongs to one of the classes and also to one of the categories. The class of a group item is treated as alphanumeric regardless of the class of elementary items subordinate to that group item. Table 2-1 shows the relationship of the class and categories of data items.

23

Page 34: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Table 2-1. Classes of Data

LEVEL OF ITEM

Elementary

Nonelementary (Group)

ALGEBRAIC SIGNS

CLASS

Alphabetic

Numeric

Alphanumeric

Alphanumeric

CATEGORY

Alphabetic

Numeric

Numeric Edited Alphanumeric Edited Alphanumeric

Alphabetic Numeric Numeric Edited Alphanumeric Edited Alphanumeric

Algebraic signs fall into two categories: operational signs, ""1IJI which are associated with signed numeric data items and signed numeric literals to indicate algebraic properties; and editing signs, which appear on edited reports to identify the sign of the item.

Operational signs are represented as defined under symbol 's' of the p ICTURE clause. Refer to the p ICTURE clause, General Rule 8, the ' s ' symbol in Section 6.

Editing signs are inserted into a data item through the use of the sign control symbols of the PICTURE clause.

24

Page 35: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

STANDARD ALIGNMENT RULES

The standard rules for positioning data within an elementary item depend on the category of the receiving item. These rules are:

1. If the receiving data item is described as numeric:

a. The data is aligned by decimal point and is moved to the receiving character positions with zero fill or truncation on either end as required.

b. When an assumed decimal point is not explicitly specified, the data item is treated as if it had an assumed decimal point immediately following the rightmost character and is aligned as in step la above.

2. If the receiving data item is a numeric edited data item, the data moved to the edited data item is aligned by decimal point with zero fill or truncation at either end as required within the receiving character positions of the data item, except where editing requirements cause replacement of the leading zeros.

3. If the receiving data item is alphanumeric (other than a numeric edited data item), alphanumeric edited or alphabetic, the sending data is moved to the receiving character positions and aligned at the left-most character position in the data item with space fill or truncation to the right, as required.

25

Page 36: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

SUBSCRIPTING

Subscripts can be used only when reference is made to an individual element within a list or table of like elements that have not been assigned individual data-names (refer to the ~ OCCURS clause in Section 6).

The subscript can be represented either by a numeric literal that is an integer or by a data-name. The data-name must be a numeric elementary item that represents an integer. When the subscript is represented by a data-name, the data-name may not be subscripted.

The subscript may be signed and, if signed, must be positive. The lowest possible subscript value is 1. This value points to the first element of the table. The next sequential elements of the table are pointed to by subscripts whose values are 2, 3, and so forth. The highest permissible subscript value, in any particular case, is the maximum number of occurrences of the item as specified in the OCCURS clause.

At the time of execution of a statement which refers to a subscripted table element, each subscript specified is validated. That is, its value must not be less than one or more than the maximum number of occurrences as specified by the corresponding OCCURS clause. If the subscript value is not within this range, an abnormal termination of the program occurs.

The subscript or set of subscripts that identifies the table element is delimited by the balanced pair of separators, left parenthesis and right parenthesis, following the table element data-name. The table element data-name appended with a subscript is called a subscripted data-name or an identifier.

When more than one subscript is required, they are written in the order of successively less inclusive dimensions of the data organization. The maximum number of subscripts is 3.

26

Page 37: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

General Format:

data-name ( subscript-1 [ subscript-2 [ subscript-3 J J )

Example:

I n the following record description, to reference the first year, TOTAL-PER-YEAR (1) is written. If data-name YE AR contains the number of the year desired, TOTAL-PER-YEAR (YEAR) is written. If the data item MONTH contains the specific month desired within the year specified by YEAR, TOTAL-PER-MONTH (YEAR MONTH) is written.

01 YEAR-TABLE. 02 TOTAL-PER-YEAR OCCURS 10 TIMES.

05 TOTAL-PER-MONTH OCCURS 12 TIMES PIC 999.

77 YEAR PIC 99.

77 MONTH PIC 99.

~ INDEXING

References can be made to individual elements within a table of like elements by specifying indexing for that reference. An index is assigned to that level of the table by using the INDEXED BY phrase in the definition of a table. A name given in the INDEXED BY phrase is known as an index-name and is used to refer to the assigned index. The value of an index corresponds to the occurrence number of an element in the associated table. An index-name can be given a value by the execution of a SET statement

The advantage to indexing is derived by faster execution time when multiple references to the same table element is required. In subscripting a multiply function is needed each time a reference is made. In indexing the multiply only occurs during execution of the SET statement and not each time a reference is made.

27

Page 38: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

An index-name has the same internal representation as an index data item. If a value to be stored in an index-name or in an inde~ data item exceeds the largest value that can be held in that index-name or index data item, the value is truncated according to the rules for the occurrence of a size """1111 error condition in an arithmetic statement without a s I z E . . ERROR phrase.

An index-name assigned to one table may not be used to index another table.

Direct indexing is specified by using an index-name in the form of a subscript. When more than one index-name is required, they are written in the order of successively less inclusive dimensions of the data organization as in subscripting.

At the time of execution of a statement which refers to an indexed table element, the value of each direct index must not be less than a value which corresponds to the beginning of the first occurrence of the table element. Also, the index must not be greater than a value which · corresponds to the beginning of the last occurrence of the """1111 table element as specified by the corresponding OCCURS clause. If the index value is not within this range, the execution of the program is terminated.

Subscripting is permitted where indexing is permitted.

28

Page 39: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

SECTION 3 EDITING FORMAT

The rules for spacing given in the following description of the reference format take precedence over all other rules for spacing.

FIELD DEFINITIONS

The same format is used for all four divisions of a COBOL 64 program. These divisions must appear in proper order: IDENTIFICATION, ENVIRONMENT, DATA, and PROCEDURE. The following paragraphs describe the various fields of this coding form.

SEQUENCE AREA (Record Positions 1-6)

A sequence number, consisting of six digits in the sequence area, must be used for each source program line.

INDICATOR AREA (Record Position 7)

Column 7 has the following functions:

1. If column 7 contains an asterisk(*), the remainder of the record is considered to be a comment and, is not compiled.

2. If column 7 contains a slash {/ ), the printout is advanced to the top of the next page before printing, and the record is considered to be a comment record. This feature is not available at this time.

3. The presence of a hyphen (-) indicates that the last nonnumeric literal on the previous record is not complete and is continued on this record beginning in Area B (positions 12 through 80).

29

Page 40: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

N onnumeric literals can be split into two or more records. On the initial record starting from the quotation mark, all information through position 80 is taken as part of the literal, and on the next record a quotation mark must be used to indicate the start of the second part of the literal. ..,,,,,

AREA A (Positions 8-11)

DIVISION, SECTION, and PARAGRAPH headers must begin in AREA A. A division header consists of the division name (IDENTIFICATION, ENVIRONMENT, DATA, or PROCEDURE), followed by a space, then the word DIVISION followed by a period.

In the ENVIRONMENT and DATA DIVISIONS, a section header consists of the section-name, followed by a space, and then the word SECTION followed by a period.

A paragraph header consists of the paragraph-name followed by a period. The first sentence of the paragraph may appear on the same line as the paragraph header. ..,,,,

Within the IDENTIFICATION and ENVIRONMENT divisions, the section and paragraph headers are fixed and only the headers shown in this manual are permitted. Within the PROCEDURE DIVISION, the paragraph headers are defined by the user.

Within the DATA DIVISION, the level indicator FD and the level numbers 01 and 77 must each begin in Area A, followed by the associated name and appropriate descriptive information.

30

Page 41: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

AREA B (Positions 12-80)

All entries which are not DIV Is I ON' SE c TI ON' or PARAGRAPH headers; level numbers 01 and 77, or level indicator FD must start in Area B.

When level-numbers are to be indented, each new level-number may begin any number of spaces to the right of AreaA.

BLANK LINES

A blank line is one that contains no entries in the Indicator Area, Area A, and Area B. A blank line may appear anywhere in the source program except immediately preceding a continuation line.

PUNCTUATION

The following rules of punctuation apply in COBOL 64 source programs:

1. A sentence must be terminated by a period followed by a space. A period must not appear within a sentence unless it is within a nonnumeric literal or is a decimal point in a numeric literal or PICTURE string.

2. Two or more names in a series must be separated by a space.

3. A space must never be embedded in a name; hyphens are to be used instead. A hyphen must not start or terminate a name. For example:

PAY-DAY -PAYDAY

31

(correct) (wrong)

Page 42: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

SECTION 4 IDENTIFICATION DIVISION

GENERAL

The first division of the COBOL 64 source program is the IDENTIFICATION DIVISION whose function is to identify the source program and the resultant output. In addition, the date the program was written and other pertinent information can be included in the IDENTIFICATION DIVISION.

IDENTIFICATION DIVISION STRUCTURE

The structure of this division follows:

IDENTIFICATION DIVISION.

[PRQGEAM-ID. program-name.

[AUTHOR. [comment-entry] ... ]

[INSTALLATION. [comment-entry] ... ]

[DATE-WRITTEN. [comment-entry] ... ]

[SECURITY. [comment-entry] ... ]

The following rules must be observed in the formation of theIDENTIFICATION DIVISION:

1. The IDENTIFICATION DIVISION must begin with the reserved words IDENTIFICATION DIVISION followed by a period and a space.

2. All paragraph-names must begin in positions 8 through 11 (Area A).

3. The comment-entry must be on the same line as the paragraph name.

32

Page 43: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

4. The comment-entry can consist of any combination of words and literals allowed by the COBOL 64 Editor.

~ PROGRAM-ID PARAGRAPH

The PROGRAM-ID paragraph gives the name by which a program is identified.

PROGRAM-ID. program-name.

The following rules must be observed to form PROGRAM-ID paragraphs.

1. The program-name must conform to the rules for formation of a user-defined word.

2. The PROGRAM- ID paragraph contains the name of the program and must be present in every program.

3. The program-name identifies the source program and all listings pertaining to a particular program.

4. The program-name must be followed by a period and a space.

33

Page 44: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

SECTION 5 ENVIRONMENT DIVISION

GENERAL

The ENVIRONMENT DIVISION is the second division of a COBOL 64 source program. Its function is to specify the computer being used for the program compilation, specify the computer to be used for program execution, and associate files with the computer hardware devices. Furthermore, this di vision is also used to specify input-output areas to be utilized for each file declared in a program.

ENVIRONMENT DIVISION ORGANIZATION

The ENVIRONMENT DIVISION consists of two sections. The CONFIGURATION SECTION contains the overall specifications of the computer. The INPUT-OUTPUT SECTION deals with files to be used in the object program. .,,,.,

ENVIRONMENT DIVISION STRUCTURE

The structure of this division follows:

ENVIRONMENT DIYISTON,

CONFIGURATION SECTION,

SOURCE-COMPUTER. source-computer-entry

OBJECT-COMpUTEB, object-computer-entry

[SPECIAI,-NAMES. special-names-entry]

[INPUT-OUTPUT SECTION,

FIT.E-CONTBOL, {file-control-entry } .. , J

34

Page 45: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

The following rules must be observed in the formulation of the ENVIRONMENT DIVISION.

1. The ENVIRONMENT DIVISION must begin with the reserved words ENVIRONMENT D IVI s ION followed by a period and a space.

2. All entries must begin in Area A (columns 8 through 11).

CONFIGURATION SECTION

The CONFIGURATION SECTION contains information concerning the system to be used for program compilation (SOURCE-COMPUTER), the system to be used for program execution (OBJECT-COMPUTER), and the SPECIAL-NAMES paragraph. The SPECIAL-NAMES paragraph is used to define a special currency sign or decimal point in place of commas.

SOURCE-COMPUTER PARAGRAPH

The SOURCE-COMPUTER paragraph identifies the computer upon which the program is to be compiled.

General Format:

SOURCE-COMPUTER. computer-name.

Syntax Rule:

1. The computer-name must be equal to c 6 4 followed by a period and a space.

'-". Example:

SOURCE-COMPUTER. C64.

35

Page 46: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

OBJECT-COMPUTER PARAGRAPH

The OBJECT-COMPUTER paragraph identifies the computer on which the program is to be executed. "'111

General Format:

OBJECT-COMPUTER. computer-name.

Syntax Rules:

1. Computer-name must be equal to c 6 4 followed by a period and a space.

SPECIAL-NAMES PARAGRAPH

The s PE c I AL-NAME s paragraph provides a means of defining a special currency sign or the decimal point in ..,,,, place of commas.

General Format:

[CURRENCY SIGN .IS. literal]

[DECIMAL-POINT .IS. COMMA] .

36

Page 47: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

SPECIAL-NAMES

"-"' Syntax Rules:

1. The literal which appears in the CURRENCY SIGN IS literal clause is used in the P I c Tu RE clause to represent the currency symbol. The literal is limited to a single character enclosed in quotation marks and must not be one of the following characters:

a. Digits 0 through 9.

b. Alphabetic characters: A B c D L P R s v x z space

c. Special characters: * + - , . ; ( ) " I =

If the CURRENCY SIGN IS clause is not present, the default value dollar sign ( $) is used in the PI CT URE clause.

Forexample: CURRENCY SIGN IS "E"

2. The clause DECIMAL-POINT IS COMMA means that the functions of the comma and period are exchanged in the character-string of the PICTURE clause and in the FILTER-NUMERIC verb. This does not apply to numeric literals.

37

Page 48: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

INPUT-OUTPUT SECTION

The INPUT-OUTPUT section contains information concerning files to be used by the program, and the manner """1JIJ of recording used.

FILE CONCEPTS

In the following paragraphs, concepts of File Types, Organization, Access Mode, I-0 Status, INVALID KEY and AT END are discussed pertaining to Sequential and Relative files.

SEQUENTIAL 1-0

Sequential I -o provides a capability to access records of a file in established sequence. The sequence is established as a result of writing the records to the file.

Sequential I-0 provides full facilities for the FI LE-CONTROL and FD entries as specified in the formats of this manual. Within the PR o c ED u RE DIVISION, Sequential I-0 provides full capabilities for the CLOSE, OPEN, READ and WRITE statements.

RELATIVE 1-0

Relative I-0 provides the capability to access records of a disk file in either a random or sequential manner. Each record in a relative file is uniquely identified by an integer value greater than zero which specifies the record's logical ordinal position in the file.

Relative I-0 has full facilities for the FILE-CONTROL and FD entries as specified in the formats of this manual. """1111 Within the PROCEDURE DIVISION, the I-0 provides full capabilities for the CLOSE, OPEN, READ, and WRITE statements.

38

Page 49: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

ORGANIZATION

Sequential Files are organized such that each record in the file except the first has a unique predecessor record, and each record except the last has a unique successor record. These predecessor-successor relationships are established by the order of WRITE statements when the file is created. Once established, the predecessor-successor relationships do not change except in the case where records are added to the end of the file.

Relative File organization is permitted only on disk storage devices. A Relative File consists of records which are identified by relative record numbers. The file may be thought of as composed of a serial string of areas, each capable of holding a logical record. Each of these areas is denominated by a relative record number. Records are stored and retrieved based on this number. For example, the tenth record is the one addressed by relative record number 10 and is in the tenth record area, whether or not records have been written in the first through the ninth record areas. The maximum size of a relative logical record is 254 characters.

ACCESS MODE

The ACCESS MODE clause specifies the manner in which records are accessed in a file. Sequential and Relative File access methods are discussed in the following paragraphs.

SEQUENTIAL FILES

In the sequential access mode, the sequence in which records are accessed is by the ascending order of ordinal location within the file.

39

Page 50: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

RELATIVE FILE

In the sequential access mode, the sequence in which records are accessed is the ascending order of the relative ""'111 record numbers of all records which currently exist within the file.

In the random access mode, the sequence in which records are accessed is controlled by the programmer. The desired record is accessed by placing its relative record number in a relative key data item.

I-0 STATUS

If the FILE STATUS clause is specified in a file control entry, a value is placed into the specified two-character data item during the execution of an OPEN, CLOSE, READ, or WRITE statement to indicate to the COBOL 64 program the status of that input-output operation.

The usage of this feature is strongly recommended. The testing of 1-0 status after each 1-0 statement will avoid a good deal of confusion when debugging.

STATUS KEY 1

The leftmost character position of the FILE STATUS data item is known as status key 1 and is set to a value which indicates one of the following conditions upon completion of the input-output operation.

VALUE

0 1 2 3 9

CO ND ID ON

Successful Completion At End Invalid Key Permanent Error COBOL 64-Defined Condition:

The above conditions are defined in following text.

40

Page 51: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

SUCCESSFUL COMPLETION

The input-output statement was successfully executed.

AT END

The sequential READ statement is unsuccessfully executed as a result of an attempt to read a record when no next logical record exists in the file.

INVALID KEY

The input-output statement was unsuccessfully executed as a result of one of the following:

1. A READ statement when the contents of the ACTUAL KEY data item are less than 1 or greater than the ordinal number of the last record ever written to the file, or trying to READ a relative file record which was never written to.

2. A WRITE statement when the contents of the ACTUAL KEY data item are less than 1 or greater than the last record allowed to be written because of the specification of a maximum file size.

PERMANENT ERROR

The input-output statement was unsuccessfully executed as the result of a boundary violation for a sequential file or as the result of an input-output error, such as data check parity error.

41

Page 52: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

STATUS KEY 2

The rightmost character position of the FILE STATUS data item is known as status key 2 and is used to further "1111 describe the results of the input-output operations. This .. character contains a value as follows:

1. If no further information is available concerning the input-output operation, then status key 2 contains a value of 0.

2. When status key 1 contains a value of 2 indicating an INVALID KEY condition, status key 2 is used to designate the case of that condition as follows:

a. A value of 3 in status key 2 indicates no record found. An attempt is made to access a record, identified by a key, but that record does not exist in the file.

b. A value of 4 in status key 2 indicates a boundary violation. An attempt was made to write beyond W the externally defined boundaries of the file.

3. When status key 1 contains a value of 9 indicating a COBOL 64-defined condition, the value of status key 2 indicates the condition as follows:

42

Page 53: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

STATUSKEY2

VALUE CONDIDON

0 This is a Commodore exception which is displayed on the screen. See your Commodore User's Guide for additional information.

1 Attempted to OPEN or CLOSE when file was already opened or closed.

2 Device not present or powered on.

3 Attempted READ or WRITE when file was not opened or not opened properly. A READ must be opened INPUT or 1-0. A WRITE must be opened OUTPUT or 1-0.

4 Attempted READ when previous READ resulted in an end of file condition.

VALID COMBINATIONS OF STATUS KEYS 1 and 2

The valid permissible combinations of the values of status key 1 and status key 2 are shown in Table 5-1.

TABLE 5-1. STATUS KEY COMBINATIONS

STATUS KEYl

0 1 2 2 3 9 9 9 9 9

STATUS KEY2

0 0 3 4 0 0 1 2 3 4

Successful completion AT END INVALID KEY, no record found INVALID KEY, boundary violation Permanent error Commodore error OPEN CLOSE error Devise not present/ready READ or WRITE with OPEN error READ after end of file

43

Page 54: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

FILE-CONTROL PARAGRAPH

The F ILE - c ONT RO L paragraph names each file and allows specification of other file-related information.

General Format:

FIJ.E-CONTROI .• {file-control-entry }

FILE CONTROL ENTRY

The file control entry names a file and may specify other file-related information.

INPUT-OUTPUT SECTION

FILE-CONTROL

~ filename

~TO

lc OBGANIZAIION IS SEOUENITAI]

~ = MODE IS SEOI!ENTI8!, ~

ORGANIZATION rs REI.ATTYE

PRINTER-J525

{ SEOUENTJAJ[REI.ATiyE KEY rs data-name-~}

~MODE rs .BANUQM REI.ATTYE KEY rs data-name-2

[FILE ~ IS data-name-1 J .

44

Page 55: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Syntax Rules:

1. The SELECT clause must be specified first in the file control entry. The clauses which follow the SELECT clause may appear in any order.

2. Each file described in the DATA DIVISION must be named only once with a file-name in the FILE-CONTROL paragraph. Each file specified in the file control entry must have a file description entry in the DATA DIVISION.

3. If the ACCESS MODE clause is not specified, the ACCESS MODE IS SEQUENTIAL clause is implied.

4. Data-name-1 must be defined in the DAT A DI v Is I ON as a two-character data item of the category alphanumeric and must not be defined in the FILE SECT ION or the COMMUN I CAT I ON SECTION.

5. If no ORGANIZATION IS clause is specified, the ORGANIZATION IS SEQUENTIAL clause is implied.

6. The RELATIVE KEY phrase may be specified only for disk storage files.

7. Data-name-2 must not be defined in a record description entry associated with that file-name.

8. The data item referenced by data-name-2 must be defined as an unsigned integer.

45

Page 56: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

General Rules:

1. The AS s I GN clause specifies the association of the file referenced by file-name to a storage medium. For ..,,, Relative and Indexed Files, the storage medium must be DISK-1541.

2. The ORGANIZATION clause specifies the logical structure of a file. The file organization is established at the time a file is created and cannot subsequently be changed.

3. When the access mode of a Relative File is sequential, records in the file are accessed in the order of ascending relative record numbers of existing records in the file.

4. When the FILE STATUS clause is specified, a value is moved by the COBOL 64 system into the data item specified by data-name-1 after the execution of every statement that references that file either explicitly or ..,,., implicitly. This value indicates the status of execution of the statement. Refer to I-0 Status in this section for additional information.

5. If the access mode of a Relative File is random, the value of the RELATIVE KEY data item indicates the record to be accessed.

6. All records stored in a Relative File are uniquely identified by relative record numbers. The relative record number of a given record specifies the record's logical ordinal position in the file. The first logical record has a relative record number of 1, and subsequent logical records have relative record numbers of 2, 3, 4, and so forth.

7. In a Relative File, the data item specified by data-name-2 is used to communicate a relative record number between the program and the COBOL 64 system.

46

Page 57: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

SECTION 6 DAT A DIVISION

GENERAL

The DATA DIVISION describes the data that the object program is to accept as input, to manipulate, to create, or to produce as output. Data to be processed belongs to these three categories:

1. That which is contained in files and enters or leaves the internal memory of the computer from a specified area or areas.

2. That which is developed internally and placed into intermediate or working storage, or placed into specific format for output reporting purposes.

3. Constants which are defined by the user.

DATA DIVISION ORGANIZATION

The DATA DIVISION, which is one of the required divisions in a program, is subdivided into sections. These are FILE and WORKING-STORAGE.

The FILE SECTION defines the structure of data files. Each file is defined by a file description entry and one or more record descriptions. Record descriptions are written immediately following the file description entry.

The WORKING-STORAGE SECTION describes records and noncontiguous data items which are not part of external data files but are developed and processed internally. It also describes data items whose values are preassigned in the source program.

47

Page 58: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

DATA DIVISION STRUCTURE

The following structure shows the general format of the sections of the DATA DIVISION, and defines the order of presentation in the source program.

~ DIVISION.

[

I.11.E SECT ION .

[file-description-entry [record-description-entry]

WORKING-STORAGE SECTION.

[ 77-level-description-entrJ record-description-entry J ...

FILE SECTION

... ] ..]

In a COBOL 64 program, the file description entry (FD) represents the highest level of organization in the FI LE SECTION. The FILE SECTION header is followed by a file description entry consisting of a level indicator (FD), a file-name, and a series of independent clauses. The FD clauses specify the size of the logical records, the presence or absence of label records and the value of label items. The entry is terminated by a period.

RECORD DESCRIPTION

A record description consists of a set of data description entries which describe the characteristics of a particular record. Each data description entry consists of a level-number followed by a data-name (if required), followed by a series of independent clauses as required.

48

Page 59: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Examples:

01 DATA-ITEM-ONE 03 LINE-COUNTER

PICTURE IS X(lO). PIC 999.

A record description has a hierarchical structure and, therefore, the clauses used with an entry may vary considerably, depending upon whether or not it is followed by subordinate entries. The structure of a record description is defined in Concepts of Levels, Section 2, while the elements allowed in a record description are shown in the data description structure.

FILE DESCRIPTION STRUCTURE

The file description entry furnishes information concerning the physical structure and identification pertaining to a given file.

[[!2, file-name

[VALUE QI. FILE-ID IS literal-1)

{record-description-entry } ... )

49

Page 60: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

LABEL RECORDS

The LABEL RECORDS clause specifies whether labels are present.

Syntax Rules:

This clause is required. The clause is treated as documentation only.

VALUE OF

The VALUE OF clause specifies the file identification of a disk file.

Syntax Rules:

Literal-1 must be a nonnumeric literal not greater than 19 characters. The first three characters must be @ O : if the "replace" feature is desired. Note that relative files cannot be "replaced". See your Commodore user's guide for more detailed information.

General Rules:

1. For an input file, the appropriate label routine checks to see if the disk drive contains a file name equal to the value of literal-1.

For an output file, at the appropriate time, the value of literal-1 is used to create the disk file name.

Example: VALUE OF FILE-ID IS "MY-FILE"

50

Page 61: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

DATA DESCRIPTION STRUCTURE

A data description entry specifies the characteristics of a particular item of data.

General Format:

level-number { data-name-1}

FILLER

[ {

PICTURE} J PIC IS character-string

[ ~ IS l !fillliL

OCCURS integer-2 TIMES

[INDEXED BY index-name-1 [index-name-2)

[~ IS literal-1 J

[~ IS ~ literal-2] .

51

Page 62: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Syntax Rules:

1. The level-number may be any number from 01 through 10 or 77.

2. The clauses may be written in any order with one exception: the data-name-1 or FILLER clause must immediately follo~ the level-number.

3. The P I c TURE clause must be specified for every elementary item except an index data item, in which case, use of this clause is prohibited. The PICTURE clause and character-string must be on the same line.

General Rules:

1. The PICTURE clauses must not be specified except for an elementary data item.

DATA-NAME OR FILLER

A data-name specifies the name of the data being described. The word FILLER specifies an elementary item of the logical record that cannot be referred to explicitly.

General Format:

{data-name}

FILLER

52

Page 63: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Syntax Rules:

1. In the FILE and WORKING-STORAGE SECTIONS, a data-name or the key word FILLER must be the first word following the level-number in each data description entry.

General Rules:

1. The key word FILLER may be used to name an elementary item in a record. Under no circumstances can a FILLER item be referred to explicitly.

2. The key word FILLER is not allowed with a level 77 item or with a VALUE clause.

LEVEL-NUMBER

The level-number shows the hierarchy of data within a logical record. In addition, it is used to identify entries for working storage items.

General Format:

level-number

Syntax Rules:

1. A level-number is required as the first element in each data description entry.

2. Data description entries subordinate to an FD must have level-numbers with the values 01 through 10. Refer to the FD file description in the paragraph entitled File Description Structure.

3. Data description entries in the WORKING-STORAGE SECTION must have level-numbers with the values 01 through 10.

53

Page 64: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

General Rules:

1. The level-number 01 identifies the first entry in each record description. Less inclusive groupings are given higher numbers (not necessarily successive) up to a "1111 limit of 10.

2. A special level-number has been assigned to entries where there is no real concept of level: the level-number 77 is assigned to identify noncontiguous working storage data items.

3. Multiple level 01 entries subordinate to any given level indicator (FD) represent implicit redefinitions of the same area.

Examples:

The following is an example of record layout which corresponds to Figure 6-3 showing a record description -........ and the use of level numbers. "119"'

STUDENT NO.

01

STUDENT RECORD

NAME LAST FIRST

STUDENT-REC. 03 STUDENT-NO 03 STUDENT-NAME.

05 LAST-NAME 05 FIRST-NAME

03 GRADE 03 BIRTH-DATE.

05 BIRTH-MONTH 05 BIRTH-DAY 05 BIRTH-YEAR

GRADE BIRTH DATE mth day yr

PIC 9 ( 6) .

PIC x (8) •

PIC x (5) . PIC 99.

PIC 99. PIC 99. PIC 99.

Figure 6-3 Level Numbers

54

Page 65: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

OCCURS

The OCCURS clause eliminates the need for separate entries for repeated data items and supplies information required for the application of subscripts or indices.

General Format:

~ integer-2 TIMES

[TNQEXEQ BY index-name-1 [ index-name-2) ... ]

Syntax Rules:

1. An INDEXED BY phrase is required if the subject of this entry, or an entry subordinate to this entry, is to be referred to by indexing.

2. The OCCURS clause cannot be specified in a data description entry that has an 01or77 level-number.

3. Index-name-1, index-name-2,... must be unique words within the program.

4. Integer-2 cannot be zero and cannot be greater than 9,999.

General Rules:

1. The OCCURS clause is used in defining tables and other homogeneous sets of repeated data items. Whenever the OCCURS clause is used, the data-name which is the subject of this entry must be either subscripted or indexed whenever it is referred to in a statement. Further, if the data-name associated with the OCCURS clause is the name of a group item, then all data-names belonging to the group must be subscripted or indexed when used as operands. Refer to Subscripting, Indexing, and Identifier in Section 2.

55

Page 66: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

2. Except for the OCCURS clause, all data description clauses associated with an item whose description includes an OCCURS clause apply to each occurrence of the item described.

3. The VALUE clause is not allowed with the OCCURS clause.

PICTURE

The PICTURE clause describes the general characteristics and editing requirements of an elementary item.

General Format:

PICTURE

IS character-string PIC

Syntax Rules:

1. A PI c TURE clause can be specified only at the elementary item level.

2. A character-string consists of certain allowable combinations of characters in the COBOL 64 character set used as symbols. The allowable combinations determine the category of the elementary item.

3. The maximum number of characters allowed in the character-string is 30.

4. The PICTURE clause must appear in every elementary """'1111 item except those items whose USAGE is declared as . . . INDEX.

56

Page 67: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

5. PIC is an abbreviation for PICTURE.

General Rules:

1. There are five categories of data that can be described with a PI c TURE clause; alphabetic, numeric, alphanumeric, alphanumeric edited, and numeric edited.

2. To define an item as alphabetic:

a. The PICTURE character-string can only contain the symbol ' A ' .

b. The item contents, when represented in standard data format, must be any combination of the 26 letters of the English alphabet and the space from the computer character set

3. To define an item as numeric:

a. The PICTURE character-string can only contain the symbols '9 ', 's ',and 'V'. The number of digit positions that can be described by the PI c TURE character-string must range from 1 to 18 inclusive.

b. If unsigned, the item contents must be a combination of the numerals ' 0 ' , ' 1 ' , ' 2 ' , ' 3 ' , ' 4 ' , ' 5 ' , ' 6 ' , ' 7 ' , ' 8 ' , and ' 9 ' ; if signed, the item may also contain a ' + ' or ' - ' .

4. To define an item as alphanumeric:

a. The PI c TURE character-string is restricted to certain combinations of the symbols 'A ' , ' x ' , ' 9 ' , and the item is treated as if the character-string contained all X's. AP ICTURE character-string which contains all A's or all 9 's does not define an alphanumeric item.

57

Page 68: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

b. The item contents are allowable characters in the computers.

5. To define an item as alphanumeric edited:

a. The PICTURE character-string is restricted to certain combinations of the following symbols: ' A ' , ' x ' , ' 9 ' , ' B ' , ' O ' , and ' I ' .

1) The character-string must contain at least one ' B ' and at least one ' x ' or at least one ' o ' (zero) and at least one 'x ' or at least one 'I ' (stroke) and at least one 'x'.

2) The character-string must contain at least one ' O ' (zero) and at least one ' A' or at least one 'I' (stroke) and at least one 'A'.

b. The contents are allowable characters in the computer character set.

6. To define an item as numeric edited:

a. The PICTURE character-string is restricted to certain combinations of the symbols ' B ' , ' I ' , 'V', 'Z', '0', '9', ',', '.', '*', ' + ' , ' - ' , ' CR ' , ' DB ' , and the currency symbol ($ ). The allowable combinations are determined from the order of precedence of symbols and the editing rules.

1) The number of digit positions that can be represented in the PICTURE character-string must range from 1 to 18 inclusive.

2) The character-string must contain at least one '0', 'B', '/', 'Z', '*', '+',

' ' ' ' - ' 'CR' ' 'DB' ' or currency symbol.

58

Page 69: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

b. The contents of the character positions of these symbols that are allowed to represent a digit in standard data format must be one of the numerals.

7. The size of an elementary item, where size means the number of character positions occupied by the elementary item in standard data format, is determined by the number of allowable symbols that represent character positions. An integer which is enclosed in parentheses following the symbols: 'A' , ' ' 'X', '9', 'Z', '*', 'B', '/', '0', ' + ' , ' - ' , or ' $ ' indicates the number of consecutive occurrences of the symbol. The maximum value of this integer is 9 , 9 9 9. The following symbols may appear only once in a given PICTURE: ' s ' , ' v ' , ' . ' , ' CR', and ' DB ' .

8. The functions of the symbols used to describe an elementary item are explained as follows:

'A'

'B'

'S,

Each letter ' A ' in the character-string represents a character position which can contain only a letter of the alphabet or a space.

Each letter 'B' in the character-string represents a character position into which the space character will be inserted.

The letter ' s ' is used in a character-string to indicate the presence of an operational sign in the internal representation of a numeric data item. It must be the first (leftmost) character in the character-string.

When an operational sign is specified the sign is maintained and expected in the zone of the most significant (leftmost) character. When the data item is the receiving field in an arithmetic statement the four zone bits are set to binary 0101 for negative values and to binary 0100 for positive values. When the data item

59

Page 70: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

'V'

is used in an algebraic comparison or operation to supply an algebraic value, only the most significant zone being a binary 0101 will cause the value of the data item to be considered negative. Only the zone values 0100 and 0101 will qualify the data item as ""1111 being NUMERIC if tested by the NUMERIC class condition.

The letter 'v' is used in a character-string to indicate the location of the assumed decimal point and may only appear once in a character-string. The ' v ' does not represent a character position and is not counted in the size of the elementary item. When the assumed decimal point is to the right of the rightmost symbol in the string, the ' v ' is redundant.

'X'

'z'

'9'

'0'

Each letter 'x' in the character-string is used to represent a character position which contains any allowable character in the character set

Each letter ' z ' in a character-string may only be used to represent the leftmost leading numeric character positions which are replaced by a space character when the contents of that character positions are zero. Each ' z .. is counted in the size of the item.

Each numeral '9' in the character-string represents a character position which contains a numeral and is counted in the size of the item.

Each numeral ' O ' in the character-string represents a character position into which the numeral zero is inserted. The ' O ' is counted in the item.

60

Page 71: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

'I'

' '

' '

Each stroke ' I ' in the character-string represents a character position into which the stroke character is inserted. The '/' is counted in the size of the item.

Each comma ' , ' in the character-string represents a character position into which the character ' , ' is inserted. This character position is counted in the size of the item. The insertion character ' , ' must not be the last character in the PICTURE character-string.

When the character period ' . ' appears in the character-string it is an editing symbol which represents the decimal point for alignment purposes and in addition, represents a character position into which the character ' . ' is inserted. The character ' . ' is counted in the size of the item. For a given program the functions of the period and comma are exchanged if the clause DECIMAL-POINT IS COMMA is stated in the SPECIAL-NAMES paragraph. In this exchange the rules for the period apply to the comma and the rules for the comma apply to the period when appearing in a PI c TURE clause. The insertion character ' . ' must not be the last character in the PICTURE character-string.

' + ' ' - ' ' CR ' 'DB '

'*'

These symbols are used as editing sign control symbols and when used, represent the character position into which the editing sign control symbol will be placed. The symbols are mutually exclusive in any one character-string and each character used in the symbol is counted in determining the size of the data item.

Each asterisk ' * ' in the character-string represents a leading numeric character position into which an asterisk is placed when the contents of that position are zero. Each '*' is counted in the size of the item.

61

Page 72: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

'cs' The currency symbol ' $ ' in the character-string represents a character position into which a currency symbol is placed. The currency symbol in a character-string is represented by either the dollar sign ""1/1 '$' or by the character specified in the CURRENCY SIGN clause in the SPECIAL-NAMES paragraph. The currency symbol is counted in the size of the item.

EDITING RULES:

1. There are two general methods of performing editing in the PI c TURE clause, either by insertion or by suppression and replacement. The four types of insertion editing available are:

a. Simple insertion b. Special insertion c. Fixed insertion d. Floating insertion

There are two types of suppression and replacement editing:

a. Zero suppression and replacement with spaces b. Zero suppression and replacement with asterisks

2. The type of editing which may be performed upon an item is dependent upon the category to which the item belongs. Table 6-1 specifies which type of editing may be performed upon a given category:

62

Page 73: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Table 6-1. Editing for Each Item Category

Category Type of Editing

Alphabetic None None None

Numeric Alphanumeric Alphanumeric Edited Numeric Edited

Simple insertion ' O ' , ' B ' , and ' I ' All, subject to Editing Rule 3

3. Floating insertion, and editing by zero suppression and replacement, are mutually exclusive in a PICTURE clause. Only one type of replacement may be used with zero suppression in a PICTURE clause.

4. Simple Insertion Editing. The ' , ' (comma), 'B ' (space), 'O' (zero), and 'I' (stroke) are used as the insertion characters. The insertion characters are counted in the size of the item and represent the position in the item into which the character is inserted.

5. Special Insertion Editing. The ' . ' (period) is used as the insertion character. In addition to being an insertion character it also represents the decimal point for alignment purposes. The insertion character, used for the actual decimal point, is counted in the size of the item. The use of the assumed decimal point, represented by the symbol ' v' and the actual decimal point, represented by the insertion character, in the same P I c TURE character-string is disallowed. The result of special insertion editing is the appearance of the insertion character in the item in the same position as shown in the character-string.

6. Fixed Insertion Editing. The currency symbol and the editing sign control symbols, ' + ' , ' - ' , ' CR ' , 'DB', are the insertion characters. Only one currency symbol and only one of the editing sign control symbols can be used in a given P I c Tu RE character-string. The symbols 'CR' or 'DB' always represent two character positions in determining the

63

Page 74: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

size of the item and must represent the rightmost character positions counted in the size of the item. The symbol '+' or ' - ' when used, must be either the leftmost or rightmost character position to be counted in the size of the item. The currency symbol must be the leftmost character position to be counted in the size of the item except that it can be preceded by either a '+' or '-' symbol. Fixed insertion editing results in the insertion character occupying the same character position in the edited item as in the P I c Tu RE character-string. Editing sign control symbols produce the results shown in Table 6-2 depending upon the value of the data item.

Table 6-2. Editing of Sign Control Symbols

Result Editing Symbol in Data Item Data Item

p I c TURE Character-String Positive or Zero Negative

+ + space

CR 2 spaces CR DB 2 spaces DB

7. Floating Insertion Editing. The currency symbol and editing sign control symbols '+' or ' - ' are the floating insertion characters and are mutually exclusive in a given PICTURE character-string.

Floating insertion editing is indicated in a P I c TURE character-string by using a string of at least two of the floating insertion characters. This string of floating insertion characters may contain any of the fixed insertion symbols or have fixed insertion characters immediately to the right. These simple insertion characters are part of the floating string.

The leftmost character of the floating insertion string represents the leftmost limit of the floating symbol in the data item. The rightmost character of the floating

64

...,,

Page 75: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

string represents the rightmost limit of the floating symbols in the data item.

The second floating character from the left represents the leftmost limit of the numeric data that can be stored in the data item. Nonzero numeric data may replace all the characters at or to the right of this limit

In a PI c TURE character-string, there are only two ways of representing floating insertion editing. One is to represent any or all of the leading numeric character positions on the left of the decimal point by the insertion character. The other is to represent all of the numeric character positions in the P I c Tu RE character-string by the insertion character.

If the insertion characters are only to the left of the decimal point in the PI CT URE character-string, the result is that a single floating insertion character is placed into the character position immediately preceding either the decimal point or the first nonzero digit in the data represented by the insertion symbol string, whichever is farther to the left in the PICTURE character-string. The character positions preceding the insertion character are replaced with spaces.

If all numeric character positions in the PICTURE character-string are represented by the insertion character, the result depends upon the value of the data. If the value is zero, the entire data item will contain spaces. If the value is not zero, the result is the same as when the insertion character is only to the left of the decimal point.

To avoid truncation, the minimum size of the PICTURE character-string for the receiving data item must be the number of characters in the sending data item, plus the number of nonfloating insertion characters being edited into the receiving data item, plus one for the floating insertion character.

65

Page 76: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

8. Zero Suppression Editing. The suppression of leading zeroes in numeric character positions is indicated by the use of the alphabetic character ' z ' or the character '*' (asterisk) as suppression symbols in a PICTURE ""1111 character-string. These symbols are mutually exclusive in a given PICTURE character-string. Each suppression symbol is counted in determining the size of the item. If ' z ' is used the replacement character is the space, and if the asterisk is used the replacement character will be ' * ' .

Zero suppression and replacement is indicated in a PI CT URE character-string by using a string of one or more of the allowable symbols to represent leading numeric character positions which are to be replaced when the associated character position in the data contains a zero. Any of the simple insertion characters embedded in the string of symbols or to the immediate right of this string are part of the string.

In a PI c TURE character-string, there are only two ..,,,, ways of representing zero suppression. One is to represent any or all of the leading numeric character positions to the left of the decimal point by suppression symbols. The other is to represent all of the numeric character positions in the PICTURE character-string by suppression symbols.

If the suppression symbols appear only to the left of the decimal point, any leading zero in the data which corresponds to a symbol in the string is replaced by the replacement character. Suppression terminates at the first nonzero digit in the data represented by the suppression symbol string or at the decimal point, whichever is encountered first.

If all numeric character positions in the PICTURE character-string are represented by suppression _... symbols, and the value of the data is not zero, the ~ result is the same as if the suppression characters were only to the left of the decimal point. If the value is zero and the suppression symbol is ' z ' , the entire

66

Page 77: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

data item will be spaces. If the value is zero and the suppression symbol ' * ' , the data item will be all asterisks except for the actual decimal point

9. The symbols ' + ' , ' - ' , ' * ' , ' z ' , and ' $ ' , when used as floating replacement characters, are mutually exclusive within a given character-string.

10. At least one of the symbols ' A ' , ' x ' , ' z ' , ' 9 ' or ' * ' , or at least two of the symbols ' + ' , ' - ' or 'cs' must be present in a PICTURE string.

67

Page 78: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Examples:

The following Table 6-3 demonstrates the editing function of the PICTURE Clause.

Table 6-3. Editing Application of the PICTURE Clause

Source Area Receiving Area

Editing Picture Data Picture Edited Data

9(5) 12345 00999.00 00345.00 9(3)V99 12345 999.BB 123.

S9 (5) (+) 12345 $$$$$$.99CR $12345.00 S99V9 (3) (-) 12345 ------.99 -12.34

S9 (5) (-) 12345 $$$$$$.99CR $12345.00CR S9(5)V (-) 12345 -ZZZZ9.99 -12345.00

9(5) 12345 BBB99.99 45.00 S9(5) (+) 12345 ZZZZ9.99- 12345.00 S9(5) (-) 12345 ZZZZ9.99- 12345.00-

9(3)V99 12345 999.00 123.00 S9(5) (-) 00123 --99999.99 -00123.00 S9(5) (+) 12345 ZZZZ9.99+ 12345.00+

9(3)V99 00001 $$$,$$$.$$ $.01 9(5) 00000 $ZZ,ZZZ.ZZ 9(5) 12345 $$$,$$9.99 $12,345.00 9(3)V99 00001 $ZZ,ZZZ.99 $ .01 9(3)V99 12345 $$$,$$9.99 $123.45 9(3)V99 00012 $ZZ,ZZ9.99 $ 0.12 9(5) 00123 $**,**9.99 $***123.00 9(5) 00000 $** *** ** , . *******.** 9(5) 01234 $**,**9.99 $*1,234.00 9(5) 00000 $$$,$$$.$$ 9(3)V99 12345 $ZZ,ZZ9.99 $ 123.45 9(5) 00000 $$$,$$9.99 $0.00

V9(5) 12345 $ZZ,ZZ9.99 $ 0.12 V9(5) 12345 $$$,$$9.99 $0.12

9(5) 12345 $ZZ,ZZ9.99 $12,345.00

68

..,,.,

Page 79: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

USAGE

The USAGE clause specifies the format of a data item in the computer storage.

General Format:

[USAGE IS] INDEX

Syntax Rules:

1. An index data item can be referenced explicitly only in a SET statement or a relation condition.

2. The OCCURS, p ICTURE, or VALUE clauses cannot be used to describe group or elementary items described with the USAGE IS INDEX clause.

General Rules:

1. An elementary item described with the USAGE IS INDEX clause is called an index data item and contains a value which must correspond to an occurrence number of a table element.

The group item is considered to be a group data item whose class is alphanumeric and may be referenced any place in the syntax acceptable for such an item. The size of the group item is considered to be in terms of characters, six characters for each subordinate index data item.

2. An index data item can be part of a group which is referred to in an MOVE, or input-output statement, in which case no conversion takes place.

69

Page 80: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

VALUE

The VALUE clause defines the value of constants and the initial value of working-storage items. ..,,,,

General Format:

Format 1:

YALUE IS literal

Format 2:

YALUE IS .cHB literal-2

Syntax Rules:

1. The VALUE clause cannot be stated for any item that has the key word F ILLER or one which has an OCCURS clause or subordinate to an item which has an OCCURS clause.

2. A signed numeric literal must have an associated signed numeric PICTURE character-string.

3. All numeric literals in a VALUE clause of an item must have a value which is within the range of values indicated by the PICTURE clause, and must not have a value which would require truncation of nonzero digits. Nonnumeric literals in a VALUE clause of an item must not exceed the size indicated by the p I CTURE clause.

4. Format 2 VALUE clauses must contain a PICTURE clause with a character-string equal to one x. Literal-2 must be an unsigned integer between 0 and 255.

70

Page 81: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

General Rules:

1. The VALUE clause must not conflict with other clauses in the data description of the item or in the data description within the hierarchy of the item. The following rules apply:

a. If the category of the item is numeric, the literal in the VALUE clause must be numeric. If the literal defines the value of a working-storage item, the literal is aligned in the data item according to the standard alignment rules. Refer to Standard Alignment Rules in Section 2.

b. If the category of the item is alphabetic, alphanumeric, alphanumeric edited or numeric edited, all literals in the VALUE clause must be nonnumeric literals. The literal is aligned in the data item as if the data item had been described as alphanumeric. (Refer to Standard Alignment Rules in Section 2.) Editing characters in the P I c TURE clause are included in determining the size of the data item (refer to the PICTURE clause in this section) but have no effect on initialization of the data item. Therefore, the VALUE for an edited item is presented in an edited form.

2. Rules governing the use of the VALUE clause differ with the respective sections of the DATA DIVISION:

a. In the FILE SECTION, the VALUE clause may not be used.

b. In the WORKING-STORAGE SECTION the VALUE clause is used to specify the initial value of the data item, in which case the clause causes the item to assume the specified value at the start of the object program. If the VALUE clause is not used in an item description, the initial value is undefined.

71

Page 82: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

3. The VALUE clause is not allowed at the group level.

4. Format 2 is intended to provide a method of defining special character codes which are required for display '...I or printer commands and for testing certain keyboard input characters such as function keys. Refer to your Commodore User's Guide relating to CHR$ codes.

For Example:

77 RETURN-CODE VALUE IS CHR 13 PIC X.

In the PROCEDURE DIVISION when a DISPLAY RETURN-CODE is executed the cursor will advance to the next line and then position to column 1.

5. Format 2 is an extension to the ANSI COBOL-74 standard.

WORKING-STORAGE SECTION

The WORKING-STORAGE SECTION is optional and is that part of the DAT A D Iv I s Io N set aside for intermediate processing of data. The difference between the WORKING-STORAGE and FILE SECTIONS is that the former deals with data that is not associated with an input or output file. All clauses which are used in normal input or output record descriptions can be used in a WORKING-STORAGE record description.

WORKING-STORAGE STRUCTURE

Whereas the FILE SECTION is composed of file description (FD) entries and associated record description entries, the WORKING-STORAGE SECTION is composed ..,,,/ only of record description entries and noncontiguous items. The WORKING-STORAGE SECTION begins with the section-header and a period, followed by data

72

Page 83: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

description entries for noncontiguous WORKING­

STORAGE items, and/or record description entries for

WORKING-STORAGE records.

Each WORKING-STORAGE SECTION record name and noncontiguous item name must be unique.

General Example:

WORKING-STORAGE SECTION.

77 data-name-1

77 data-name-n 01 data-name-2

02 data-name-3

01 data-name-4 02 data-name-5

03 data-name-6

NONCONTIGUOUS WORKING-STORAGE

Items in WORKING-STORAGE which have no hierarchical relationship to one another need not be grouped into records, provided they do not need to be further subdivided. These items are classified and defined as noncontiguous elementary items. Each of these items is defined in a separate data description entry which begins with the special level-number 77.

The following record description clauses are required in each entry:

Level-number 77 Data-name The PICTURE clause or the USAGE IS INDEX clause.

The OCCURS clause is not meaningful on a 77 level item and will cause an error. Other data description clauses are optional and can be used to complete the description of the item if necessary.

73

Page 84: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

WORKING-STORAGE RECORDS

Data elements and constants in WORKING-STORAGE which have a definite hierarchic relationship to one another ...._~ must be grouped into records according to the rules for the ~ formation of record descriptions. All clauses which are used in normal input or output record descriptions can be used in a WORKING-STORAGE description.

INITIAL VALUES

The initial value of any item in the WORKING-STORAGE SECTION except an index data item is specified by using the VALUE clause with the data item. The initial value of any index data item is unpredictable.

CODING THE WORKING-STORAGE SECTION

Figure 6-5 illustrates the coding of the WORKING-STORAGE SECTION

WORKING-STORAGE SECTION. 01 HDG-LINE.

03 FILLER PIC X(52). 03 DN2 PIC A(17) VALUE "SALES PERFORMANCE".

77 DISK-CONTROL 77 TOTAL-SALES 77 SALES-QUOTA 01 STATE-TABLE.

PICTURE 9 (8) • PIC PIC

9 (11) VALUE 0. 9 (10).

05 STATE-KEY OCCURS 50. 10 STATE-CODE PIC 99. 10 COUNTY PIC 9. 10 CITY PIC 9.

74

Page 85: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

SECTION 7 PROCEDURE DIVISION

GENERAL

The PROCEDURE DIVISION must be included in every COBOL 64 source program. This division must contain at least 1 paragraph.

A paragraph consists of a paragraph-name, followed by a period and a space, followed by zero, one, or more successive sentences. A paragraph ends immediately before the next paragraph-name or at the end of the PROCEDURE DIVISION.

A sentence consists of one or more statements and is terminated by a period.

A statement is a syntactically valid combination of words and symbols beginning with a COBOL 64 verb.

The term 'identifier' is defined as the word or words necessary to make unique reference to a data item.

EXECUTION OF THE PROCEDURE DIVISION

Execution begins with the first statement of the PROCEDURE DIVISION. Statements are executed in the order of appearance, except where the user indicates GO

TO or PERFORM statements.

PROCEDURE DIVISION STRUCTURE

The PROCEDURE DIVIS ION is made up of the PROCEDURE DIVISION header and the PROCEDURE

DIVISION body. Descriptions of these follow:

75

Page 86: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

PROCEDURE DIVISION HEADER

The PRECEDURE DIVISION is identified by and must begin with the following header: ""11/1

PROCEDURE DIVISION.

PROCEDURE DIVISION BODY

The body of the PROCEDURE DIVISION must conform to the following format.

{paragraph-name. [sentence] ... }

STATEMENTS

There are two types of statements; conditional statements and imperative statements.

CONDITIONAL STATEMENTS

A conditional statement specifies that the truth value of a condition is to be determined and that the subsequent action of the object program is dependent on this truth value.

A conditional statement is

1. An IF statement.

2. A READ statement that specifies the AT END or INVALID KEY phrase.

3. A WRITE statement that specifies the INVALID KEY phrase.

4. An arithmetic statement (ADD, DIVIDE, MULTIPLY, SUBTRACT) that specifies the SIZE ERROR phrase.

5. A FILTER-NUMERIC statement.

76

Page 87: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

IMPERATIVE STATEMENTS

An imperative statement indicates a specific unconditional action to be taken by the object program. An imperative statement is any statement that is not a conditional statement. An imperative statement may consist of a sequence of imperative statements, each possibly separated from the next by a separator. The imperative verbs are:

ACCEPT ACCEPT-1-KEY ADD ( 1) CLOSE DEBUG-BREAK DEBUG-TRACE-OFF DEBUG-TRACE-ON DISPLAY DIVIDE (1) EXIT GO MOVE MULTIPLY (1) OPEN PERFORM READ (2) SET STOP SUBTRACT (1) WRITE (3)

The numbers in parentheses following some of the verbs have the following meaning:

Number

1

2

3

Meaning

Without the optional SIZE ERROR phrase. Without the optional AT END phrase or INVALID KEY phrase. Without the optional INVALID KEY phrase.

77

Page 88: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

When 'imperative-statement' appears in the general format of statements, it refers to a statement that begins with an imperative verb and specifies an unconditional action to be taken. An imperative statement may consist of a sequence of imperative statements. Imperative statements must be ended by a period, or an ELSE phrase associated with a previous IF statement.

RELATION CONDITION

A relation condition causes a comparison of two operands, each of which may be the data item referenced by an identifier or a literal. A relation condition has a truth value of TRUE if the relation exists between the operands. If either of the operands is a group item, the nonnumeric comparison rules apply.

General Format:

IS [N.Q.I] GREATER THAN

tdentifier-1 IS [N.QI] .LE.SS THAN rdent if ier-2} literal-1 IS [N.QI] f.Q.UAL TO literal-2

The first operand (identifier-I or literal-I) is the subject of the condition; the second operand (identifier-2 or literal-2) is the object of the condition. The relation condition must contain at least one reference to a variable.

When used, NOT and the next key word are one relational operator that defines the comparison to be executed for truth value; for example, NOT EQUAL is a truth test for an unequal comparison; NOT GREATER is a truth test for an equal or less comparison. The meaning of the relational operators is as follows:

78

Page 89: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Relational Operator Meaning

Is [NOT l GREATER THAN Greater than or not greater than

IS [NOT] LESS THAN Less than or not less than

rs [NOT 1 EQUAL To Equal to or not equal to

COMPARISON OF NUMERIC OPERANDS

For operands whose class is numeric, a comparison is made with respect to the algebraic value of the operands. The length of the literal in terms of number of digits represented, is not significant. Zero is considered a unique value regardless of the sign.

Unsigned numeric operands are considered positive for purposes of comparison.

COMPARISON OF NONNUMERIC OPERANDS

For nonnumeric operands, or one numeric and one nonnumeric operand, a comparison is made with respect to a specified collating sequence of characters. Refer to your Commodore User's Guide CHR$ codes for additional information. If one of the operands is specified as numeric, it must be an integer data item or an integer literal. The following conditions apply:

1. If the nonnumeric operand is an elementary data item or a nonnumeric literal, the numeric operand is treated as though it were moved to an elementary alphanumeric data item of the same size as the numeric data item (in terms of standard data format characters), and the contents of this alphanumeric data item are compared to the nonnumeric operand. Refer to the MOVE statement in this section.

2. If the nonnumeric operand is a group item, the numeric operand is treated as though it were moved to a group

79

Page 90: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

item of the same size as the numeric data item (in terms of standard data format characters), and the contents of this group item are compared to the nonnumeric operand. Refer to the MOVE for additional information. .,,./

3. A noninteger numeric operand cannot be compared to a nonnumeric operand.

4. The operands must be the same size.

Comparison effectively proceeds by comparing characters in corresponding character positions starting from the high order end and continuing until either a pair of unequal characters is encountered or the low order end of the operand is reached, whichever comes first. The operands are determined to be equal if all pairs of characters compare equally through the last pair, when the low order end is reached.

The first encountered pair of unequal characters is compared to determine a relative position in the collating ....__,,. sequence. The operand that contains the character that is ..,. positioned higher in the collating sequence is considered to be the greater operand.

COMPARISONS INVOLVING INDEX-NAMES AND/OR INDEX DATA ITEMS

Relation tests may be made between:

1. Two index-names. The result is the same as if the corresponding occurrence numbers were compared.

2. An index-name and a data item (other than an index data item) or literal. The occurrence number that corresponds to the value of the index-name is compared to the data item or literal.

3. An index data item and an index-name or another index data item. The actual values are compared without conversion.

80

Page 91: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

The comparison of an index data item with a literal or with any data item not specified above, is not allowed.

CLASS CONDITION

The class condition determines whether the operand is numeric, consisting entirely of the characters 'O', '1' ,

' 2 ' , ' 3 ' , ... , ' 9 ' , with or without the operational sign, or alphabetic, consisting entirely of the characters ' A' , ' B ' , ' c ' , . . . , ' z ' , and space.

General Format:

{

NUMERIC }

identifier IS [NQ!] ALPHABETIC

When used, NOT and the next key word specify one class condition that defines the class test to be executed for truth value; for example, NOT NUMER I c is a truth test for determining that an operand is nonnumeric.

The NUMERIC test cannot be used with an item whose data description describes the item as alphabetic or as a group item composed of elementary items whose data description indicates the presence of operational sign(s). If the data description of the item being tested does not indicate the presence of an operational sign, the item being tested is determined to be numeric only if the contents are numeric and an operations! sign is not present. If the data description of the item does indicate the presence of an operational sign, the item being tested is determined to be numeric only if the contents are numeric and a valid operational sign is present.

The ALPHABETIC test cannot be used with an item whose data description describes the item as numeric. The item being tested is determined to be alphabetic only if the contents consist of any combination of the alphabetic characters ' A ' through ' z ' and the space character.

81

Page 92: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

COMMON PHRASES

In the statement descriptions that follow, several phrases appear frequently: the ROUNDED phrase and the s I ZE ERROR phrase.

In the following discussion, a resultant-identifier is that identifier associated with a result of an arithmetic operation.

ROUNDED PHRASE

If, after decimal point alignment, the number of places in the fraction of the result of an arithmetic operation is greater than the number of places provided for the fraction of the resultant-identifier, truncation is relative to the size provided for the resultant-identifier. When rounding i~ requested, the absolute value of the resultant-identifier is increased by adding a one into the low-order digit whenever the absolute value of the next least significant digit of the intermediate data item is greater than or equal to five.

SIZE ERROR PHRASE

If, after decimal point alignment, the absolute value of a result exceeds the largest value that can be contained in the associated resultant-identifier, a size error condition exists. Division by zero always causes a size error condition. The size error condition applies only to the final results of an arithmetic operation and does not apply to intermediate results, except in the MULTIPLY and DIVIDE statements, in which case the size error condition applies to the intermediate results as well. If the ROUNDED phrase is specified, rounding takes place before checking for size error. When a size error condition occurs, the subsequent action depends on whether or not the SIZE ERROR phrase is specified.

82

Page 93: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

1. If the SIZE ERROR phrase is not specified and a size error condition occurs, the resultant value is stored in each of the receiving fields left truncated where required. Values of resultant-identifier(s) for which no size error condition occurs are unaffected by size errors that occur for other resultant-identifier(s) during execution of this operation.

2. If the s I ZE ERROR phrase is specified and a size error condition occurs, then the values of resultant-identifier(s) affected by the size errors are not altered. Values of resultant-identifier(s) size error condition occurs are unaffected by size errors that occur for other resultant-identifier(s) during execution of this operation. After completion of the execution of this operation, the imperative statement in the s I ZE ERROR phrase is executed.

ST A TEMENT FORMATS

GENERAL RULES FOR STATEMENT FORMATS

The following paragraphs describe general rules for statement formats.

ARITHMETIC STATEMENTS

The arithmetic statements are ADD, DIVIDE, MULTIPLY, and SUBTRACT and have several common features:

1. The data descriptions of the operands need not be the same; any necessary conversion and decimal point alignment is supplied throughout the calculation.

2. The maximum size of each operand is 18 decimal digits.

3. Each arithmetic operation is evaluated using an intermediate data item for the result of the operation.

83

Page 94: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

The contents of the intermediate data item are moved to the resultant-identifier according to the rules for the MOVE statement. Rounding is performed and the size error conditon is determined only during this MOVE operation.

INCOMPATIBLE DATA

Except for the class condition (refer to Class Condition in this section), when the contents of a data item are referenced in the PROCEDURE DIVISION and the contents of that data item are not compatible with the class specified for that data item by the PICTURE clause, then the result of such a reference is undefined.

SPECIFIC VERB FORMATS

The specific verb formats, together with a detailed discussion of the restrictions and limitations associated with each, appear on the following pages in alphabetic sequence.

84

Page 95: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

ACCEPT

The ACCEPT statement is used to input data from the keyboard and placed in the specified data item.

General Format:

ACCEPT identifier

Syntax Rules:

1. If the identifier describes a numeric item it must be an integer.

General Rules:

1. The ACCEPT statement causes the transfer of data from the keyboard. This data replaces the contents of the data item named by the identifier.

2. The maximum number of characters that can be transferred is 80. The RETURN key terminates the transfer.

3. The ACCEPT statement causes the information requested to be transferred to the data item specified by identifier according to the rules of the MOVE statement.

4. As each key is entered it is displayed on the screen at the current cursor position. The cursor control and insert/delete keys are active.

85

Page 96: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

ACCEPT-1-KEY

The Ac c E P T - 1 - KEY statement is used to input 1 character from the keyboard and place it in the specified data item. This verb is an extension to ANSI COBOL-74. ""111

General Format:

ACCEPT-1-KEY identifier

This statement differs from the ACCEPT statement in that it will enable any one key on the keyboard including function keys. Refer to your Commodore User's Guide under CHR$ codes for each key's definition. The key entered is not displayed.

86

Page 97: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

ADD

The ADD statement causes two or more numeric operands to be summed and the result to be stored.

General Format:

Format 1:

AD.U {identifier-~ [identif ier-21

literal-1 J literal-2 J .I..Q identifier-m [BOIJNQEQ]

[ON .s.IZi.E. EBBQE. imperative-statement]

Format 2:

{

identifier-} ~dentifier-2~ ~dentifier-3)

literal-1 lliteral-2 ~ ~iteral-3 .G.nl.Ifili ident if ier-m (BOIJNQEQ]

[ON .s.I.Z.E. .E.B.B.Q.B. imperative-statement]

Syntax Rules:

1. In formats 1 and 2, each identifier must refer to an elementary numeric item, except that in Format 2 the identifier following the word GIVING must refer to either an elementary numeric item or an elementary numeric edited item.

2. Each literal must be a numeric literal.

87

Page 98: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

General Rules:

1. Additional rules and explanation relative to this statement are given in the appropriate paragraphs. Refer to ROUNDED Phrase, SIZE ERROR Phrase, Arithmetic Statements.

2. If Format 1 is used, the values of the operands preceding the word TO are added together, then the sum is added to the current value of identifier-n storing the result immediately into identifier-n.

3. If Format 2 is used, the values of the operands preceding the word GIVING are added together, then the sum is stored as the new value of identifier-m, the resultant-identifier.

4. The system ensures that enough places are carried so that significant digits are not lost during execution.

Examples:

Assume as initial values for each ADD: X=2, Y=lO, Z=lS, TOT=SO.

Format 1:

ADD X TO TOT. Results TOT=52

ADD X Y Z TO TOT Results TOT=77

Format 2:

ADD X Y GIVING TOT. Results TOT=12

ADD X Y Z GIVING TOT Results TOT=2 7

88

Page 99: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

CLOSE

General Format:

CLOSE file-name

The CLOSE statement terminates the processing of a file.

General Rules:

A CLOSE statement may only be executed for a file in an open mode. Refer to I-0 status under the File Concepts section.

It is very important that you CLOSE files once you have finished using them. Closing a disk file causes the system to properly allocate space and update the directory. If you do not CLOSE the disk file, all of your data will be lost.

DEBUG-BREAK

This verb will cause an execution break if the program is executing in the DEBUG Mode. Refer to the E>EBUG Mode sections. The verb is ignored if not executing in the DEBUG Mode. This verb is an extension to the ANSI standard.

DEBUG-TRACE-OFF

When executing in the DEBUG Mode this verb will tum off the trace feature. Refer to the DEBUG section. This verb is ignored if executing in the DEBUG Mode. This verb is an extension to the ANSI standard.

89

Page 100: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

DEBUG-TRACE-ON

This verb will cause the trace feature to be turned on if executing in the DEBUG Mode. Refer to the DEBUG Mode section. The verb is ignored if not executing in the DEBUG Mode. This verb is an extension to the ANSI standard.

DISPLAY

The DI SP LAY statement causes the data items to be displayed on the screen.

General Format:

prspr.AY{identifier-i\_

literal-1 J Syntax Rules:

fdentifier-~ ...

hiteral-2 J

If the literal is numeric, then it must be an unsigned integer.

General Rules:

1. The DI SPLAY statement causes the contents of each operand to be transferred to the hardware device in the order listed.

2. The maximum number of characters that can be transmitted is unlimited.

3. When a DI SPLAY statement contains more than one operand, the values of the operands are transferred in the sequence in which the operands are encountered.

4. For any one data item, if a character code 13 (RETURN) is encountered the transfer will be terminated after sending the RE TURN code.

90

Page 101: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

5. It is not recommended to DI SPLAY an identifier which is defined as signed numeric. This is due to the fact that the sign character is combined with the most significant number of the data item.

6. The display begins at the current cursor location.

DIVIDE

The DIV IDE statement divides one numeric data item into others and sets the values of data items equal to the quotient.

General Formats:

Format 1:

.Ill.Yl.D.E. t'dentifier-1} T~~~ ~ identifier-2

literal-1 [ROUNDEQ]

[ON .s.I.Z.E EBB.QR imperative-statement]

Format 2:

.P..DLI.D.E.J"identifier-~f.aY ~}.fidentifier-2~

~iteral-1 J~ ~iteral-2 ~ ~ identifier-3 [ROUNQEQ)

[ON .s.I.Z.E .E.B.B.QB. imperative-statement]

91

Page 102: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Syntax Rules:

I. Each identifier must refer to an elementary numeric item, except that the identifier associated with the GIVING phrase must refer to either an elementary numeric item or an elementary numeric edited item.

2. Each literal must be a numeric literal.

General Rules:

I. Additional rules and explanations relative to this statement are given in the appropriate paragraphs. Refer to Arithmetic Statements, ROUNDED phrase and the SIZE ERROR phrase.

2. When Format I is used, the value of identifier-2 is divided by either the value of identifier-I or literal-I. The value of the dividend (identifier-2) is replaced by this quotient.

3. When Format 2 is used, the value of identifier- I or literal-1 is divided by the value of identifier-2 or """""' literal-2, and the result is stored in identifier-3.

92

Page 103: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

EXIT

The EXIT statement provides a means of documenting the logical end point for a series of paragraphs that may be executed under the control of a PERFORM statement.

General Format:

E.Xil..

Syntax Rules:

1. The EXIT statement must appear in a sentence alone.

2. The EXIT sentence must be the only sentence in the paragraph.

General Rules:

1. An EXIT statement serves only to enable the user to assign a procedure-name to a given point in a program. Such an EXIT statement has no other effect on the execution of the program.

FILTER-NUMERIC

The FILTER-NUMERIC statement filters and validates alphanumeric data to numeric data format. This verb is an extension to ANSI COBOL-74.

General Format:

FILTER-NQMERIC identif ier-1 .IQ identif ier-2

ON E.E.B.QB imperative-statement

Syntax Rules:

1. Identifier-1 represents the sending area and identifier-2 represents the receiving area.

93

Page 104: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

2. Identifier-2 must be defined as a numeric data item.

General Rules:

1. The contents of identifier-1 are examined. Valid characters are 0 through 9 and the decimal-point. Leading and trailing space characters are also valid. Only one decimal point character is allowed and only if there is one or more decimal places in the receiving fields picture. A decimal point without other characters is invalid.

2. If the above tests are passed the size of significant data is evaluated against the size of identifier-2. If there is no size problem, including decimal alignment, the data is transferred to identifier-2.

3. If any of the above tests fail the ON ERROR imperative statement is processed.

4. The DECIMAL POINT IS COMMA clause apples to this statement.

This verb is intended to process data received from the keyboard (ACCEPT) or other systems.

Examples: The receiving numeric PICTURE is 999V99.

Sending Data

123.45 1

(all spaces) .12

1 2 1234.5 1.2345 1.2.3

1A2

Result

12345 00100 00000 00012 ERROR-embedded space ERROR-size ERROR- size ERROR - more than 1 decimal point ERROR-invalid character ERROR-decimal point only

94

Page 105: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

GOTO

The GO TO statement causes control to be transferred from one part of the PROCEDURE DIVISION to another.

General Format:

Format 1:

.GQ TO paragraph-name-1

Format 2:

1iQ TO paragraph-name-1 [paragraph-name-2) .•• paragraph-name-n

DEPENQING ON identifier

Syntax Rules:

1. Identifier is the name of a numeric elementary item described without any positions to the right of the assumed decimal point

2. If a GO TO statement, represented by Format 1, appears in a consecutive sequence of imperative statements within a sentence, it must appear as the last statement in that sequence.

General Rules:

1. When a GO TO statement, represented by Format 1 is executed, control is transferred to paragraph-name-1.

2. When a Format 2 GO TO statement is executed, control is transferred to the paragraph-name whose ordinal position in the list following the GO TO corresponds to the value of the identifier being 1, 2 , ... , n. If the value of the identifier is anything other than the positive or unsigned integers 1, 2, ... , n, then no transfer occurs and control passes to the 'next statement in the normal sequence for execution.

95

Page 106: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

IF

The IF statement causes a condition to be evaluated. The subsequent action of the object program depends on whether the value of the condition is TRUE or FALSE. "'1111

General Format:

.IE. condition{statement-1 l f .E.L.5.E. statement-2 l ~ SENTENCEJ l.E.L.5.E. ~ SENTENCE~

Syntax Rules:

1. Statement-1 and statement-2 must represent an imperative statement

2. The ELSE NEXT SENTENCE phrase may be omitted if it immediately precedes the terminal period of the sentence.

General Rules:

1. When an IF statement is executed, the following transfers of control occur:

a. If the condition is TRUE, statement- I is executed, if specified. If statement- I contains a procedure branching statement, control is explicitly transferred in accordance with the rules of that statement. Refer to Categories of Statements in this section. If statement- I does not contain a procedure branching statement, the ELSE phrase, if specified, is ignored and control passes to the next executable sentence.

b. If the condition is TR u E and the NE x T s ENT EN c E phrase is specified instead of statement- I, the EL s E phrase, if specified, is W ignored and control passes to the next executable sentence.

96

Page 107: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Examples:

c. If the condition is FALSE, statement-1 or NEXT SENTENCE is ignored, and statement-2 if specified, is executed. If statement-2 contains a procedure branching statement, control is explicitly transferred in accordance with the rules of that statement. Refer to Categories of Statements in this section. If statement-2 does not contain a procedure branching statement, control passes to the next executable sentence. If the EL s E statement-2 phrase is not specified, statement-1 is ignored and control passes to the next executable sentence.

d. If the condition is FALSE, and the ELSE NEXT SENTENCE phrase is specified, statement-1 is ignored, if specified, and control passes to the next executable sentence.

IF APPLE IS EQUAL TO RED DISPLAY "GOOD" PERFORM GOOD-APPLE

ELSE PERFORM BAD-APPLE.

IF APPLE EQUAL RED NEXT SENTENCE

ELSE DISPLAY "BAD"

ADD 1 TO TOT-BAD-APPLES.

IF APPLE NOT EQUAL RED ADD 1 TO TOT-BAD-APPLES.

97

Page 108: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

MOVE

The MOVE statement transfers data, in accordance with the rules of editing, to one or more data areas.

General Format:

M~u~ {identifier-; ~ .IQ identifier-2 [identifier-3] ...

literal

Syntax Rules:

l. Identifier-1 and literal represent the sending area; identifier-2, identifier-3, ... , represent the receiving area.

2. An index data item cannot appear as an operand of a MOVE statement. Refer to the USAGE clause in Section 6.

General Rules:

1. The data designated by the literal or identifier-1 is moved first to identifier-2, then to identifier-3, and so on. The rules governing identifier-2 also apply to the other receiving areas. Any subscripting or indexing associated with identifier-2 is evaluated immediately before the data is moved to the respective data item.

Any subscripting or indexing associated with identifier-1 is evaluated only once, immediately before data is moved to the first of the receiving operands. The result of the statement:

MOVE a (b) TO b c (b)

is equivalent to:

MOVE a (b) TO temp MOVE temp TO b MOVE temp TO c (b)

98

Page 109: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Temp is an intermediate result item provided by the system.

2. Any MOVE in which the sending and receiving items are both elementary items is an elementary move. Every elementary item belongs to one of the following categories: numeric, alphabetic, alphanumeric, numeric edited, alphanumeric edited. These categories are described in the PICTURE clause in Section 6. Numeric literals belong to the category numeric, and nonnumeric literals belong to the category alphanumeric.

The following rules apply to an elementary move between the categories:

a. A numeric edited, alphanumeric edited, or alphabetic data item must not be moved to a numeric or numeric edited data item.

b. A numeric literal, a numeric data item or a numeric edited data item must not be moved to an alphabetic data item.

c. A noninteger numeric literal or a noninteger numeric data item must not be moved to an alphanumeric or alphanumeric edited data item.

d. All other elementary moves are legal and are performed according to the rules given in General Rule 3.

3. Any necessary conversion of data from one form of internal representation to another takes place during legal elementary moves, along with any editing specified for the receiving data item:

a. When an alphanumeric edited or alphanumeric item is a receiving item, alignment and any necessary space filling takes place as defined under Standard Alignment Rules in Section 2. If the size of the sending item is greater than the size of the receiving item, the excess characters are

99

Page 110: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

truncated on the right after the receiving item is filled. If the sending item is described as being signed numeric, the operational sign is not moved.

b. When a numeric or numeric edited item is the receiving item, alignment by decimal point and any necessary zero-filling takes place as defined under the Standard Alignment Rules, except where zeroes are replaced because of editing requirements.

1) When a signed numeric item is the receiving item, the sign of the sending item is placed in the receiving item. If the sending item is unsigned, a positive sign is generated for the receiving item.

2) When an unsigned numeric item is the receiving item, the absolute value of the sending item is moved and no operational sign is generated for the receiving item.

3) When a data item described as alphanumeric is the sending item, data is moved as if the sending item were described as an unsigned numeric integer.

c. When a receiving field is described as alphabetic, justification and any necessary space-filling takes place as defined under the Standard Alignment Rules. If the size of the sending item is greater than the size of the receiving item, the excess characters are truncated on the right after the receiving item is filled.

5. Any move that is not an elementary move is treated exactly as if it were an alphanumeric to alphanumeric elementary move, except that there is no conversion of data from one form of internal representation to ..,,,, another. In such a move, the receiving area is filled without consideration for the individual elementary or group items contained within either the sending or receiving area.

100

Page 111: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

6. The validity of the various types of MOVE statements is summarized in Table 7-4.

'-" Table 7-4. A Valid MOVE Statement

Category of Receiving Data Item

Alphanumeric Category of Sending Data Item

Alphabetic Edited

Alphanumeric

ALPHABETIC YES YES

ALPHANUMERIC YES YES

ALPHANUMERIC EDITED YES YES

NUMERIC INTEGER NO YES

NUMERIC NON INTEGER NO NO

NUMERIC EDITED NO YES

101

Numeric Integer Numeric Noninteger Numeric Edited

NO YES NO YES YES NO

Page 112: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

MULTIPLY

The MULTIPLY statement causes numeric data items to be multiplied and sets the value of a data item equal to the result.

General Format:

Format I:

MULTIPLY {identifier-it .lil'.. identifier-2 [ROUNDED) literal-1 J

[ON ..5..IZE. .E.B.B.QB. imperative-statement)

Format 2:

MULTipI.Y {identifier-l .lll'.. {identifier-2} ~ identifier-3 literal-1 J literal-2

[ROUNQEQJ

[ON ..5..IZE. .E.B.B.QB. imperative-statement]

Syntax Rules:

1. Each identifier must refer to a numeric elementary item, except that in Format 2 the identifier following the word GIVING must refer to either an elementary numeric item or an elementary numeric edited item.

2. Each literal must be a numeric literal.

3. The composite of operands, determined by superimposing all receiving data items of a given statement, aligned on decimal points, must not exceed 18 digits.

102

Page 113: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

General Rules:

OPEN

1. Refer to ROUNDED Phrase, SIZE ERROR Phrase in Arithmetic Statements in this section for additional rules and information.

2. When Format 1 is used, the value of identifier-I or literal-I is multiplied by the value of identifier-2. The value of the multiplier (identifier-2) is replaced by this product.

3. When Format 2 is used, the value of identifier-I or literal-I is multiplied by identifier-2 or literal-2 and the result is stored in identifier-3.

The OPEN statement initiates the processing of files. It also performs checking of labels and other operations.

General Format:

INPUT

OUTPUT file-name

Syntax Rules:

1. The 1-0 phrase can be used only for disk files. The disk file must be defined with ORGANIZATION IS RELATIVE and ACCESS MODE IS RANDOM clauses.

2. OPEN INPUT file-name must not be a printer file.

103

Page 114: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

General Rules:

1. The successful execution of an OP EN statement determines the availability of the file and results in the file being in an open mode.

2. The execution of an OPEN statement does not affect either the contents or availability of the file's record area.

3. When a given file is not in an open mode, no statement that references that file can be executed successfully.

4. A file may be opened with the INPUT' OUTPUT and 1-0 phrases in the same program. Following the initial execution of an OP EN statement for a file, each subsequent OPEN statement execution for that same file must be preceded by the execution of a CLOSE statement for that file.

5. Execution of the OPEN statement does not obtain or release the first data record.

6. The beginning labels are processed as follows:

a. When the IN P u T phrase is specified, the execution of the OPEN statement causes the labels to be checked in accordance with conventions for input label checking.

b. When the OUTPUT phrase is specified, the execution of the OPEN statement causes the labels to be written in accordance with conventions for output label writing.

7. The file description entry for the file-name must be equivalent to that used when this file was created.

8. For files being opened with the INPUT phrase, the OPEN statement sets the current record pointer to the first record currently existing within the file.

104

Page 115: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

9. Upon successful execution of an OPEN statement with

the OUTPUT phrase specified, a file is created. At that time the associated file contains no data records.

PERFORM

The PERFORM statement is used to transfer control explicitly to one or more paragraphs and to return control implicitly whenever execution of the specified paragraph is complete

General Format:

PEHrQRM paragraph-name-1 [ {.'J'H:H} paragraph-name-2 J Syntax Rules:

1. The words THRU and THROUGH are equivalent.

General Rules:

1. When the PERFORM statement is executed, control is transferred to the first statement of the paragraph named paragraph-name-1. This transfer of control occurs only once for each execution of a PERFORM

statement. An implicit transfer of control to the next executable statement following the PERFORM

statement is established as follows:

a. Ilf paragraph-name-2 is not specified, then the return is after the last statement of paragraph-name-1.

b. If paragraph-name-2 is specified, then the return is after the last statement of the paragraph-name-2.

2. No particular sequential relationship is required to exist between paragraph-name-I and paragraph-name-2. There may be more than one logical path of program

105

Page 116: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

control through the performed range of paragraphs. A common method, though not a required one, of documenting the terminal paragraph of a performed range of paragraphs is through the use of the EXIT statement.

3. An implicit return mechanism is established at the end of a performed range of paragraphs and is activated by the execution of a PERFORM statement. Program control reaching an active return mechanism always returns to the activating PERFORM statement. A return mechanism permanently deactivates by transferring program control back to a PERFORM statement. An active return mechanism is temporarily deactivated by the execution of a PERFORM statement. Program control always passes through a nonactive return mechanism to the next executable statement following the PERFORM range.

4. A paragraph executed under the control of a PERFORM statement may execute PERFORM statements. There is no requirement that the range of paragraphs executed under the control of the nested PERFORM statement be declared totally within, or disjoint from, the range of paragraphs executed by the first PERFORM statement. The permanent deactivation of an active return mechanism causes the last return mechanism temporarily deactivated to again become active, allowing overlapping PERFORM ranges, or two or more PERFORM ranges that have a common exit point, to logically execute the same as disjoint PERFORM ranges.

Transferring program control, by means of a GO TO statement, from a range of paragraphs being executed under control of a PERFORM statement does not cause the return mechanism to be deactivated. This is allowed but this is not considered good programming practice and 'trJtll should be avoided! Subsequently, transferring program control back into the PERFORM range causes control to return to the PERFORM statement, provided that the return

106

Page 117: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

mechanism is still active. Repeatedly branching from a PERFORM range without allowing control to ever reach an active return mechanism may cause the program to terminate abnormally by exhausting the resources allocated to account for return mechanisms. In such a case, the error message PERFORM STACK ERROR is displayed

Example:

START. PERFORM PARA

PERFORM PARA THRU PARC.

ENDIT. STOP RUN.

PARA. ADD ••••

PARB. MOVE ....

PARC. PERFORM PARB

The execution sequence would be:

START

PARA

PARA

PARB

PARC

PARB END IT

107

Page 118: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

READ

For sequential access, the READ statement makes available the next logical record from a file. For random access, the READ statement makes available a specified record.

General Format:

Format I:

RE.All file-name RECORD

AT END. imperative-statement

Format 2:

RE.All file-name RECORD

INVALID KEY imperative-statement

Syntax Rules:

1. Format 1 must be used for all files in sequential access mode.

2. Format 2 is used for files in random access mode.

General Rules:

1. The associated file must be open in the INPUT or I-0 mode. Refer to the OPEN statement in this section.

2. The execution of the READ statement causes the value of the FILE STATUS data item, if any, associated with file-name to be updated. Refer to I-0 Status in Section 5.

3. If, at the time of the execution of a Format 1 READ statement, no next logical record exists in the file, the AT END condition occurs, and the execution of the

108

Page 119: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

READ statement is considered unsuccessful. Refer to 1-0 Status in Section 5.

4. When the AT END condition is recognized, the following actions are taken in the specified order:

a. A value is placed into the FILE STATUS data item, if specified for this file, to indicate an AT

END condition. Refer to 1-0 Status in Section 5.

b. Control is transferred to the AT END imperative statement.

c. The execution of the input-output statement which caused the condition is unsuccessful.

5. Following the unsuccessful execution of any READ

statement, the contents of the associated record area and the position of the current record pointer are undefined.

6. When the AT END condition has been recognized, a Format 1 READ statement for that file must not be executed without first executing a successful CLOSE

statement followed by the execution of a successful OPEN statement for that file.

7. In a Relative File with access mode sequential declared, if the RELATIVE KEY phrase is specified, the execution of a Format 1 READ statement updates the contents of the RELATIVE KEY data item so that it contains the relative record number of the record made available.

8. For a Relative File with access mode random declared, the execution of a Format 2 READ statement sets the current record pointer and makes available the record whose relative record number is contained in the data item named in the RELATIVE KEY phrase for the file. If the file does not contain such a record, the INVALID KEY condition exists and execution of the

109

Page 120: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

SET

RE AD statement is unsuccessful. Refer to the INVALID KEY condition under Invalid Key in Section 5.

The SET statement establishes reference points for table handling operations by setting index-names associated with table elements.

General Format:

{

ident if ier-ll

index-name-1J

Syntax Rules:

identifier-3

index-name-3

integer-1

1. Integer-I may be signed but must be plus.

General Rules:

1. Index-names are considered related to a given table and are defined by being specified in the I ND EXE D BY clause.

2. If index-name-3 is specified, the value of the index before the execution of the s ET statement should correspond to an occmTence number of an element in the associated table.

If index-name-1 is specified, the value of the index after the execution of the SET statement should correspond to an occurrence number of an element in the associated table.

When a statement using the index-name to refer to a table element is executed, the value in the index or the value produced by relative indexing must fall within

110

Page 121: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

the range specified by the OCCURS clause defining the table. Otherwise, an abnormal termination of the program occurs. Refer to Indexing in Section 2.

3. When a SET statement is executed, the following actions occur:

a. Index-name-I is set to a value causing it to refer to the table element that corresponds in occurrence number to the table element referenced by index-name-3, identifier-3, or integer-I. If identifier-3 is an index data item, or if index-name-3 is related to the same table as index-name-I, no conversion takes place.

b. If identifier-I is an index data item, it may be set equal to either the contents of index-name-3 or identifier-3, where identifier-3 is also an index data item. No conversion takes place in either case.

c. If identifier-I is not an index data item, it may be set only to an occurrence number that corresponds to the value of index-name-3. Neither identifier-3 nor integer-1 can be used in this case.

4. Data in Table 7-6 represents the validity of various operand combinations in the s ET statement. The general rule reference (for example, 3b) indicates the applicable general rule.

111

Page 122: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Table 7-6. SET Statement Combinations

Sending Item Receiving Item Integer Data Item Index-Name Index Data Item 'ttttlfl

Integer Literal No/3c Valid/3a

Valid/3a

No/3b

No/3b Integer Data Item N0/3c

lndex-N ame V alid/3c Valid/3a Valid/3b*

Index Data Item No/3c V alid/3a * V alid/3b*

*No conversion takes place*

STOP

The STOP statement causes a permanent suspension of the "'1lll/I execution of the object program.

General Format:

Syntax Rules:

1. If a STOP RUN statement appears in a consecutive sequence of imperative statements within a sentence, it must appear as the last statement in that sequence.

General Rules:

1. The ending procedure established by the COBOL 64 system is instituted.

112

Page 123: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

SUBTRACT

The SUBTRACT statement is used to subtract one or the sum of two or more numeric data items from one item and set the value of one item equal to the result.

General Format:

Format I:

SUBTRACT

{

identifier-} rdentifier-,J: ... .ERQM identifier-m

literal-1 Lliteral-2

[ROIJNQEQ)

[ON .s.IZ.E, .ERB.QR imperative-statement)

Format 2:

SUBTRACT {identifier-~ [dentifier-~ ... E.B.QM {identifier-m}

literal-1 ~ literal-2 ~ literal-m

~ identifier-n

[BO(JNQEQ]

[ON .s.r.z.E. E.RB.Q.B. imperative-statement]

Syntax Rules:

1. Each identifier must refer to a numeric elementary item except that in Format 2, the identifier following the word GIVING must refer to either an elementary numeric item or to an elementary numeric edited item.

2. Each literal must be a numeric literal.

113

Page 124: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

General Rules:

1. Additional rules and explanations related to this statement are given in the appropriate paragraphs. ""11111 Refer to ROUNDED Phrase, SIZE ERROR Phrase in Arithmetic Statements in this section.

2. In Format l, all literals or identifiers preceding the word FR o M are added together, and this total is subtracted from the current value of identifier-m. The result is immediately stored into identifier-m.

3. In Format 2, all literals or identifiers preceding the word FROM are added together, the sum is subtracted from literal-m or identifier-m, and the result of the subtraction is stored as the new value of identifier-m.

Examples:

Assume as initial values for each subtract; X=2, Y=lO, Z=lS, TOT=SO, and SUB=30.

Format I:

SUBTRACT X FROM TOT. SUBTRACT X Y Z FROM TOT

Format 2:

results TOT=48 results TOT=23

SUBTRACT X Y FROM SUB GIVING TOT. SUBTRACT X Y FROM Z GIVING TOT

results TOT=18 results TOT=3

114

Page 125: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

WRITE

The WRITE statement releases a logical record for an output file. It can also be used for vertical positioning of lines for a printer.

General Format:

Format I:

Format 2:

WRITE record-name

INVALID KEY imperative-statement

Syntax Rules:

1. The record-name is the name of a logical record in the FILE SECTION of the DATA DIVISION.

2. Integer-1 may not be zero.

3. Format 2 is used for Organization Relative Files.

General Rules:

1. The associated file must be open in the OUTPUT or I-0 mode at the time of the execution of this statement.

2. The execution of a WR I TE statement has no effect upon either the contents or accessibility of the record area.

115

Page 126: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

3. The execution of the WRITE statement causes the value of the FILE STATUS data item, if any, associated with the file to be updated. Ref er to 1-0 Status iii Section 5.

4. The maximum record size for a file is established when the file is created and must not subsequently be changed.

5. The number of character positions on a disk storage device required to store a logical record in a file may or may not be equal to the number of character positions defined by the logical description of that record in the program.

6. The execution of the WRITE statement releases a logical record to the operating system.

PRINTER FILES

1. The ADVANCING phrase allows control of the vertical "111 positioning of each line on a printed page. If the . ADVANCING phrase is not used, automatic advancing is provided to act as if the user had specified AFfER ADVANCING 1 LINE. If the ADVANCING phrase is used, advancing is provided as follows:

a. Ilf integer-I is specified, the page is advanced the number of lines equal to the value of integer-I.

b. If the BEFORE phrase is used, the line is written before the page is advanced.

2. During the transfer of data to the printer, if a character code 13 (RE TURN) is encountered the transfer is · terminated after sending the RETURN code.

116

Page 127: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software

DISK FILES

SEQUENTIAL FILES:

COBOL 64

1. When an attempt is made to write beyond the externally defined boundaries of a Sequential File, an exception condition exists and the contents of the record area are unaffected. The value of the FI LE STATUS data item, if any, of the associated file is set to a value indicating a boundary violation. Refer to 1-0 Status in Section 5.

RELATIVE FILES:

I. When a Relative File is opened in the output mode, records may be placed into the file in one of the following ways:

a. If the access mode is sequential, the WR I TE statement causes a record to be released. The first record has a relative record number of 1 and subsequent records released have relative record numbers of 2, 3, 4, and so on. If the RELATIVE KEY data item has been specified in the file control entry for the associated file, the relative record number of the record just released is placed into the RELATIVE KEY data item during execution of the WRITE statement.

b. If the access mode is random, before the execution of the WRITE statement, the value of the RELATIVE KEY data item must be initialized in the program with the relative record number to be associated with the record in the record area. That record is then released by execution of the WRITE statement.

2. When a Relative File is opened in the 1-0 mode and the access mode is random, records are to be inserted in the associated file. The value of the RELATIVE KEY data item must be initialized by the program with the relative record number to be associated with the record

117

Page 128: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

in the record area. Execution of a WRITE statement then causes the contents of the record area to be released.

3. The INVALID KEY condition exists when an attempt ..,/ is made to write beyond the externally defined boundaries of the file.

118

Page 129: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

CHAPTER7

START UP/OPERATING INSTRUCTIONS

Connect the system as described in your Commodore User's Guide. Now tum on the equipment in the following order:

1. Printer (if present) 2. Computer 3. Disk drives 4. TV or monitor

Insert the COBOL 64 diskette and type:

LOAD "COBOL 64", 8,1

followed by the RETURN key. The system loading process will then take place. When completed, READY will appear on the screen. Now type:

SYS 2051

followed by the RETURN key. The COBOL 64 System will then start.

119

Page 130: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

CHAPTERS

MAIN MENU

The COBOL 64 Main Menu is displayed on the screen and contains the following functions:

l=EDIT

2=RUN

3=DEBUG

4=SAVE

S=GET

6=NEW-PROG/EDIT

?=CRUNCH

8=PRINT-ON

9=PRINT-OFF

lO=NEW-NAME

At this point enter the number of the function desired followed by the RE TURN key.

The following sections will describe each function in detail. They appear in alphabetical order for easy reference.

120

Page 131: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Main Menu

CRUNCH

The CRUNCH function is used to reduce the memory size of your program file. A file must be present, refer to GET and NEW-PROG. If the COED IT program overlay is not present in memory, it will be automatically loaded by the system from disk. Messages will appear on the screen when this occurs.

While developing your program, each time you delete or change lines the memory space for the old lines is no longer available for new lines. This is not a problem unless you exceed the maximum available memory. At this time or at any time you wish to consolidate memory, invoke this function.

The processing associated with this function includes writing to disk a temporary file with the prefix c s (COBOL sequential) before your file name. eg. CS YOUR-NAME. A warning message will appear on the screen which will allow you to remove the COBOL 64 diskette and insert your diskette. Enter any key on the keyboard to continue. Once the temporary file is written, it is then read back into the system. As each line is written to disk or read back from disk, it will appear on the screen. At the completion of this task a warning message will appear which allows you to save the new consolidated program on disk. The system will now return to the Main Menu.

121

Page 132: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Main Menu

DEBUG

This function directs the system to begin executing the """' current program file in memory. A file must be present, refer to GET or NEW-PROG. The DEBUG function is similar to the RUN function described below. In addition to executing your program a number of powerful debug features are provided which are intended to facilitate the debugging of your program. All debugging in COBOL 64 is accomplished at the source (symbolic) language level. There is no need to be concerned with machine language, memory addressing or hexadecimal notation.

Before debugging can begin, your program is tested to determine if it has been successfully syntaxed. If it has, the CORD (Run/Debug) program overlay is automatically loaded from disk if required. If your program had not previously been syntaxed the syntax process will begin. Refer to EDIT SYNTAX for additional details. If the syntax process is unsuccessful the system resumes at the """' main menu. If successful the system proceeds with the CORD program overlay.

At the beginning of DEBUG Mode a "START DEBUG" message will appear on the screen followed by the DEBUG feature menu. At this time you may need to remove the COBOL 64 diskette and insert your diskette if your program is going to use the disk drive.

122

Page 133: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

The following is a list of the DEBUG Menu features. Each one is described in detail below. Enter the feature number desired followed by the RE TURN key.

START-PROG

l=START-PROG 2=RESUME-PROG 3=SINGLE-ON 4=SINGLE-OFF S=EXIT 6=BREAK1 7=BREAK2 8=BREAK3 9=0PTIONS

lO=TRACE-ON-LINE ll=TRACE-OFF-LINE 12=TRACE-FAST 13=TRACE-SLOW 14=TRACE-ON lS=TRACE-OFF 16=RESET-OPTIONS

This selection will cause your program to begin executing at the first PROCEDURE DIVISION statement in your program. Your program is initialized with its starting VALUE clauses as required. To simplify debugging, all other data items are initialized to the numeral 9. During execution, if your program references a data item which you did not properly initialize, the 9's will be obvious; otherwise you would see strange characters on the screen for a DISPLAY statement or as a function of the trace feature.

123

Page 134: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

RESUME-PROG

This selection allows you to continue execution from the point where it was before entering the debug menu state.

This selection cannot be used when starting a program, or after a STOP RUN verb, you must use the START-FROG.

SINGLE-ON

This selection turns on the "single step" feature. Single stepping allows you to step through your program execution one statement at a time. Once your program begins executing (see START-FROG or RESUME-FROG) each statement will display S=NNNNNN where N is equal to the line number of the statement followed by the statement. At this point depress the RETURN key to execute the next statement. Any other key will direct the system to the DEBUG Menu. This feature will also automatically tum on the trace feature, refer to TRACE-ON. Comment lines are ..,,,,, ignored during execution.

SINGLE-OFF

EXIT

The single step feature described above is turned off. The trace feature is also turned off.

This selection will direct the system to exit the DEBUG Mode and proceed to the COBOL 64 Main Menu.

124

Page 135: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

BREAKl BREAK2 BREAK3

A selection of the break feature allows you to enter a statement line number which when executed will cause the system to enter the DEBUG Menu state. Note that this occurs before execution of the statement in the selected line number. The screen will contain a B=NNNNNN where N is equal to the line number. The system provides for one to three line numbers plus the verb DEBUG-BREAK which you can place in your program as required. Comment lines are ignored during execution.

OPTIONS

The selection of this feature directs the system to display the current state of all DEBUG Menu options.

TRACE-ON-LINE

A selection of this feature allows you to enter a statement line number which when executed will cause the system to tum on the trace feature. Refer to TRACE-ON for additional information.

TRACE-OFF-LINE

A selection of this feature allows you to enter a statement line number which when executed will cause the system to tum off the trace feature. Refer to TRACE-ON and TRACE-OFF for more details.

125

Page 136: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

TRACE-FAST

The TRACE-FAST feature displays all trace information at full speed. This is the default setting for the trace feature.

TRACE-SLOW

The TRACE-SLOW feature provides for slowing down the speed of the trace display such that it is more readable during execution.

TRACE-ON

The selection of the TRACE-ON feature provides for information to be displayed during execution of your program. The TRACE-ON feature is a default setting.

As each statement is executed the system displays """""' T=NNNNNN followed by the statement; where N is equal to the statement line number. All comment lines are ignored during tracing. If the statement being traced has a receiving data item such as MOVE A TO B then C= is displayed followed by the new contents of the data item. The size of the display is limited to 18 characters. If the receiving field is a numeric data item the contents display is enhanced to include the sign (+-)if present and the letter 'v' in the assumed decimal point position.

Example:

The picture of A is equal to S99V99.

T=OOOlOO MOVE +1.2 TO A

C=+01V20

126

Page 137: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

In addition to the TRACE-ON and TRACE-ON-LINE features, the system provides a DEBUG-TRACE-ON verb which you can insert in your program as required.

TRACE-OFF

The trace feature described above is turned off. There is also a DEBUG-TRACE-OFF verb for this purpose which you can insert in your program as required.

RESET-OPTIONS

The selection of this feature is used to reset all DEB u G options to their default settings:

TRACE-ON

TRACE-FAST

127

Page 138: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Main Menu

EDIT

The ED IT function is used to enter your COBOL 64 """"" statements. A set of EDIT functions are also provided to facilitate the editing process:

DIRECTORY LIST DELETE SYNTAX AUTO SAVE RESEQUENCE PRINT-ON PRINT-OFF EXIT

list the disk directory list lines on screen delete lines syntax analysis auto line numbers save program on disk renumber all lines set printer on set printer off exit to main menu

If the COED IT program overlay is not present in memory it will automatically be loaded from disk by the system. "'11111 Messages will appear on the screen when this occurs. When the START EDIT message appears on the screen you can begin entering COBOL 64 Statements or ED IT-Functions.

COBOL 64 Statements

Start by entering a six digit line number followed by the remainder of your statement. Refer to the section titled Editing Format for additional information. Each line must be terminated by the RETURN key before it is processed by the system. The Commodore cursor control keys are enabled including the insert/delete keys. Refer to your Commodore User's Guide for more details. One line on the screen is 40 characters, a COBOL 64 line can be up to 80 characters, which would occupy 2 lines on the screen. .........JI To replace a line you may simply type the new line with the ..._, same line number as the line your are replacing. The EDIT-LIST function described below can be used to

128

Page 139: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

view your text. You can, for example, list a line or series of lines, and then type any changes needed followed by the RETURN key. Inserting lines is accomplished by typing a line number which falls between two existing lines. Deleting lines is accomplished by the ED IT-DELETE function described below.

While entering COBOL 64 statements some validation of the text is performed. If an error is detected INVALID ENTRY is displayed. If this message should appear, review the entry you have just typed and make any necessary corrections.

Example:

If you enter -

ADD A TO lB

the INVALID ENTRY message will appear because lB is not a valid COBOL 64 word.

Additional validation (Syntax Analysis) is performed at another time.

DIRECTORY

The DIRECTORY function will list the disk directory on the screen. The abbreviation DIR can be used.

129

Page 140: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

LIST

The LI s T function has the following format:

LIST [starting-line-number] [ending-line-number]

1. If no line numbers are present then the entire file is displayed.

2. If only one line number is entered then only that line is displayed (if present).

3. If two line numbers are entered (at least one space between the numbers is required) then the first number is interpreted as the starting line and the second as the ending line number. Note the ending line number must be greater than or equal to the starting line number. The lines are displayed if present.

4. The RUN/STOP key can be used to terminate the listing process or the listing process can be paused by holding down the SHIFT key.

5. The LIST function can be abbreviated 'L '.

6. Leading zeros on line numbers need not be entered.

7. An error message is displayed if invalid line numbers are entered; such as 12 X3 or more than 6 digits.

DELETE

The format and validation of DELETE is similar to LIST. This function deletes the lines indicated. The lines are displayed for documentation purposes.

130

Page 141: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

SYNTAX

This function performs a complete syntax analysis of your program. Any errors found will cause the line in error to be displayed (including the previous 7 lines) and an error message.

For the IDENTIFICATION, ENVIRONMENT and DATA divisions the syntax analysis process is aborted following the first error encountered. The PROCEDURE DIVISION is only syntaxed if no errors are found in the other divisions. All errors are reported in the PROCEDURE DIVISION.

This function is optional during the ED IT Mode. An automatic syntax analysis will be forced when you select the RUN or DEBUG Mode for any program. It has been made available in the ED IT Mode to allow you to selectively syntax portions of your program as you develop it.

The syntax analysis process involves two automatic program overlays to occur from disk, cos YN and cos YNP. Messages are displayed for this purpose. Following the syntax process the COEDIT program overlay is automatically reloaded along with appropriate messages appearing on the screen. This entire process (excluding optional printer time) will take less than two minutes, regardless of the program size.

131

Page 142: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

AUTO

SAVE

The AUTO function provides for automatic display of the next line number. The AUTO function has the following format:

AUTO [line-increment-value]

1. The line-number-value must be within the range 1 to 100.

2. If no value is entered then the AUTO function is turned off.

3. The line number displayed is computed by adding the line-increment-value to the last line entered into the system.

4. In addition to displaying the new line number, column 12 is indicated by displaying a large dot. This was provided to facilitate formatting the line. If no new text is entered in column 12, the large dot will be ..,,, automatically removed by the system before validation begins. There is no need for you to type over it

5. If the automatic increment should cause an overflow, an error message is displayed and the function is turned off.

The SAVE function causes your program to be saved to disk, refer to Main Menu SA VE for additional details. It is good practice to periodically save your program file onto disk in case a problem with your computer or electrical power develops. It is also good practice to save your program on a second or third diskette in case a problem "'1111 with the diskette develops.

132

Page 143: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

RESEQUENCE

The RESEQUENCE function will renumber all lines in your program by increments of 100.

PRINT-ON PRINT-OFF

EXIT

This function forces all keyboard input and displays to the screen to be printed on the printer. The printer must be powered on. The feature provides for creating program listings, documents all changes and error messages. For example, if the PRINT-ON is entered followed by LIST 5 O O O 8 O O O, these lines are displayed on the screen and printed on the printer. If s YNT AX is selected with the PRINT-ON, all error messages are printed for later evaluation.

Printing is terminated with the PRINT-OFF function.

These functions are also available from the COBOL 64 Main Menu selection.

The Ex IT function allows for terminating the ED IT session and returns processing to the COBOL 64 Main Menu. If the ED IT session included changing the program file, then a warning message appears, which will allow files to be saved on disk. Refer to the Main Menu SA VE function for additional details on saving a file.

133

Page 144: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

Main Menu

GET

The GET function is used to get (load) an existing program file from disk into memory. A message appears on the screen requesting that a file name be entered. At this time you must remove the COBOL 64 diskette and insert your diskette. Enter the desired file name (enclosed in quotation marks) followed by the RETURN key. Messages will appear during the loading process. The system will return to the main menu following the loading process. At this time you may need to remove your diskette and insert the COBOL 64 diskette, depending on your next menu selection.

NEW-NAME

The NE w-NAME function provides for the changing of a program file name. A file must be present, refer to GET or NEW-PROG. A message appears on the screen requesting that the new file name be entered. Enter the new file name (enclosed in quotation marks) followed by the RETURN key. The system then returns to the Main Menu. This feature is useful when using an existing program as a basis for a new program.

NEW-PROG/EDIT

This function erases any existing program in memory and accepts a new program name. A message appears on the screen requesting that a file name be entered. Enter the new program name (enclosed in quotation marks) followed by the RE TURN key. The system then proceeds as if the ED IT function had been selected from the Main Menu. ""'1111 Refer to the section on ED IT for additional information.

134

Page 145: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

PRINT-ON PRINT-OFF

RUN

These features force all keyboard input and screen displays to be printed on the printer. The printer must be powered on. They are intended for creating program listings, documenting all changes, menu selections, tracing and error messages.

Printing is terminated with the PRINT-OFF function.

This function directs the system to begin executing the current program file in memory. A file must be present, refer to GET or NEW-PROG. Before execution can begin your program is tested to determine if it has been successfully syntaxed.

If it has, the CORD (RUN /DEBUG) program overlay is automatically loaded from disk if required. At the beginning of RUN Mode a "START RUN" message will appear on the screen. At this time you may need to remove the COBOL 64 diskette and insert your diskette if your program is going to use the disk drive. Enter any key to begin execution of your program. When your program execution is terminated, the system will return to the Main Menu.

If your program had not previously been successfully syntaxed, then the syntax process will begin. Refer to EDIT SYNTAX for additional details. If the syntax process is unsuccessful, the system resumes at the Main Menu. If the syntax process is successful, the system proceeds with the CORD program overlay as described above.

135

Page 146: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

SAVE

The s A VE function provides for the saving of your program onto disk. A file must be present, refer to GET or ._., NEW-PROG. Before proceeding with the SAVE, remove the COBOL 64 diskette and insert your diskette.

Program files are saved in two parts. Each part is prefixed by Cl or C2 before your file name. eg., Cl YOURFILE C2YOURFILE. Screen messages will appear during the saving process. If your file already exists on the diskette it will automatically be overwritten by the new file.

136

Page 147: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software

APPENDIX A

SAMPLE PROGRAM

COBOL 64

The following sample program is an example of one way to write a COBOL 64 program which performs the function of a simple adding machine. This program is available on the COBOL 64 diskette. It is recommended that you use the program to get familiar with the COBOL 64 system. After studying the program listing try the exercises below:

000100 IDENTlFiCATlGN DIVISlON. 000200 PROGRAM-ID. VS-ADDING-MACHINE. 000300 ENVIRONMENT DlV1S10N. 000400 CONFIGURATION SECTION. 000500 SOURCE-COMPUTER. C64. 000600 OBJECT-COMPUTER. C64. 000700 DATA DIVISION. 000800 WORKING-STORAGE SECTION. 000900 01 DISPLAY-LINE. 001000 02 DiSP-SPACE PIC l120l VALUE H ".

001100 02 DISP-NUMBER rIC ZZ,ZZZ,ZZZ.99+. 0~1200 01 ENTRY. ~01300 02 ENTRY-TABLE PIC X OCCURS 12 TIMES. 001400t 10 DIGITS + 1 DECIMAL POINT + 1 FUNCTION KEV 001500 77 ENTRY-SUB PIC 99. 001600 77 KEV-IN PIC X. 001700 77 TOTAL PIC 59(BlV99 VALUE 0. 001800 77 NUHERIC-ENTRV PIC S91BlV99. 001900 77 CLEAR-HOME-CODE VALUE CHR 147 PIC x. 002000 77 RETURN-CODE VALUE CHR i3 PIC X. 002100 77 RVS-ON-CODE VALUE CHR 18 PIC X. 002200 77 RVS-OFF-CODE VALUE CHR 146 PIC X. 002300 PROCEDURE DIVISION. 00240~ START. 0025~l DISPLAY CLE~R-HOME-CGDE ~02600 ~srART ADDING MACHINEU 002700 RETURN-CODE.

137

Page 148: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software

002800 START-ENTRY. 002900 DISPLAY RETURN-CODE 003000 5 ENTER: u

003100 MOVE " " TO ENTRY 003200 HOVE 1 TO ENTRY-SUB. 003300 ACCEPT-LOOP.

ACCEPT-1-KEY KEY-IN DISPLAY KEHN IF KEY-IN IS EQUAL TO •+•

PERFORM PLUS-KEY THRU PLUS-KEY-EXIT GO TO START-ENTRY.

IF KEY-IN EQUAL "-"

COBOL 64

003400 003500 003600 003700 003800 003900 004000 004100 004200 004300 004400 004500 004600 004700 004800 004900*

PERFORM MINUS-KEY THRU MINUS-KEY-EXIT SO TO START-ENTRY.

IF KEY-IN EQUAL n5n PERFORM SUB-KEY GO TO START-ENTRY.

IF KEY-IN EQUAL HT" PERFORl'I TOT-KEY SO TO START-ENTRY.

IF KEY-IN EQUAL "Eu STOP RUN.

005000 MOVE KEY-IN TO ENTRY-TABLEIENTRY-SUBi 005100 ADD 1 TO ENTRY-SUB 005200 IF ENTRY-SUB IS GREATER THAN 12 005300 PERFORM ERR 005400 60 TD START-ENTR~ 005500 ELSE GO TO ACCEPT-LOOP. 005600 PLUS-KEY. 005700 FILTER-NUMERIC ENTRY TO NUMERiC-~NTRY 005800 ON ERROR 005900 PERFORM ERR 006000 GO TO PLLlS-KEY-EXIT. 006100 ADD NUHERIC-EMTRY TO TOTAL 006200 MOVE NUMERIC-ENTRY TO DISP-NUNBER 006300 D1SPLA¥ RETURN-CODE 006400 DISPLAY-LINE. 006500 PLUS-KEY-EXIT. EX1T. 006600 MINUS-KEY.

138

Page 149: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software

006700 006800 006900 007000 007100 007200 a01300

FILTER-NUMERIC ENTRY TO NUMERIC-ENTRY ON ERROR

PERFORM ERR GO TO MINUS-KEY-EXIT.

MULTIPLY -1 BY NUMERIC-ENTRY ADD NUMERIC-ENTRY TO TOTAL MOVE NUMERIC-ENTRY TO DISP-NUMBER

007400 DISPLAY RETURN-CODE 007500 DISPLAY-LINE. 007600 MINUS-KEY-EXIT. EXIT. 0m00 SUB-KEY. a07800 IF ENTRY-SUB IS EQUAL TO 1 ~07900 MOVE TOTAL TO DISP-NUKBER 308000 DISPLAY RETURN-CODE J0B100 DISPLAY-LINE a08200 KEY-IN ~08300 ELSE PERFORM ERR. 008400 TOT-KEY. 008500 IF ENTRY-SUB EQUAL 1 008600 PERFORM SUB-KEY 008700 MOVE 0 TO TOTAL 008800 ELSE PERFOR" ERR. 008900 ERR. 009000 DISPLAY RETURN-CODE 009100 RVS-ON-CODE 009200 »JNVALID ENTRY" 009300 RVS-OFF-CODE. 009400 END-PROG.

139

COBOL 64

Page 150: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software

APPENDIX A

Exercises

1. Load and execute the program in RUN Mode.

a. From the Main Menu select GET file:

Enter 5 then RETURN

b. Enter the file name in quotes

Enter "ADDING" then RETURN

COBOL 64

At this point the ADDING program is loaded into memory.

c. Select the RUN program option

Enter 2 then RETURN

At this point the CORD program overlay will take place followed "'1111/J by screen messages "START RUN" and "ENTER ANY KEY TO CONTINUE".

d. Enter any key to start the ADDING program.

e. Enter some entries such as:

123+ 456+

s T

Try some invalid entries such as:

12B3+ (not a number) 12. 345+ (too many digits after decimal point)

f. To exit the program and return to the Main Menu

EnterE

140

Page 151: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

2. Execute the program in DEBUG Mode.

a. From the Main Menu and with the program already loaded into memory (Step 1 above).

Enter 3 then RETURN

Note that the CORD program overlay is not needed at this time because it is still in memory from Step 1 above.

The DEBUG Menu is displayed at this time.

b. Proceed at this point by selecting TRACE-SLOW.

Enter 13 then RETURN.

c. Select the START-PROO option.

Enter 1 then RETURN

The program will start executing with a display of each COBOL 64 statement as it is being executed. The trace display will stop when the ACCEPT-1-KEY statement is executed (line # 003400)

d. Now enter some entries as you did in Step 1 above and try to follow the program execution sequence.

e. Exit the program as you did in Step 1.

EnterE

The system returns to the DEBUG Menu.

f. Return to the Main Menu by selecting EXIT.

Enter 5 then RETURN

141

Page 152: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

3. Try making some changes to the program so that you can exercise the EDIT Mode. Consider changing the size of the entry or even simpler, the "START ADDING MACHINE" on line 002600.

a. From the Main Menu select EDIT Mode.

Enter 1 then RETURN

The COED IT program overlay is then loaded into memory.

b. List the program on the screen.

Enter LIST then RETURN.

Continue changing and listing as required.

c. To exit the EDIT Mode

Enter EXIT then RETURN

Note the warning message to save the program. You cannot use the COBOL 64 diskette because it has the write protect tab on. Insert your own disk to save the program or bypass the save. If you do insert your disk be sure to replace it with the COBOL 64 diskette after the save has been completed. Now the Main Menu is present on the screen. Try executing your changes by following Step 1 or 2 above. This time you will observe that a Syntax Analysis is being perf orrned, this will occur whenever a program is changed.

142

Page 153: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software

APPENDIX B

RESERVED WORDS

COBOL 64

All reserved words known to the COBOL 64 System are listed in this Appendix.

ACCEPT ACCEPT-1-KEY ACCESS ADD ADVANCING AFTER ALPHABETIC AT AUTHOR BEFORE BY CLOSE COMMA CONFIGURATION CURRENCY DATA DATE-WRITTEN DEBUG-BREAK DEBUG-TRACE-OFF DEBUG-TRACE-ON DECIMAL-POINT DEPENDING DISPLAY DIVIDE DIVISION END ENVIRONMENT EQUAL ERROR FD FILE FILE-CONTROL FILLER FILTER-NUMERIC FROM GIVING GO GREATER I-0 IDENTIFICATION IF INDEX IDEXED INPUT INPUT-OUTPUT INSTALLATION INTO INVALID IS KEY LABEL LESS LINE LINES MODE MOVE MULTIPLY NEXT NOT NUMERIC OBJECT-COMPUTER OCCURS OF OMITTED ON OPEN ORGANIZATION OUTPUT PERFORM PIC PICTURE PROCEDURE PROGRAM-ID RANDOM READ RECORD RECORDS RELATIVE ROUNDED RUN SECURITY SELECT SENTENCE SEQUENTIAL SET SIGN SIZE SOURCE-COMPUTER SPECIAL-NAMES STANDARD STATUS STOP SUBTRACT THAN THROUGH THRU TIMES TO VALUE WORKING-STORAGE WRITE

143

Page 154: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software

APPENDIX C

LANGUAGE SUMMARY

IDENTIFICATION DIVISION PROGRAM-ID AUTHOR INSTALLATION DATE-WRITTEN SECURITY

ENVIRONMENT DIVISION CONFIGURATION SECTION

SOURCE-COMPUTER OBJECT-COMPUTER SPECIAL-NAMES

CURRENCY SIGN IS .•. DECIMAL-POINT IS COMMA

INPUT-OUTPUT SECTION FILE-CONTROL

SELECT ..• ASSIGN .•. ORGANIZATION IS SEQUENTIAL

ACCESS MODE IS SEQUENTIAL ORGANIZATION IS RELATIVE

COBOL 64

ACCESS MODE IS SEQUENTIAL RELATIVE KEY IS ACCESS MODE IS RANDOM RELATIVE KEY IS ...

FILE STATUS IS ...

DATA DIVISION FILE SECTION

FD LABEL RECORDS ARE ..• VALUE OF FILE-ID IS .••

WORKING STORAGE SECTION LEVEL-NUMBER ... FILLER •••

PICTURE IS •.• USAGE IS ..• INDEX .•• OCCURS ..• TIMES •.. INDEXED BY .•• VALUE IS ••. CHR ..•

144

Page 155: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software

LANGUAGE SUMMARY continued

PROCEDURE DIVISION ACCEPT ... ACCEPT-1-KEY ... ADD ..• GIVING .•. ROUNDED ON SIZE ERROR ..• CLOSE ... DEBUG-BREAK DEBUG-TRACE-OFF DEBUG-TRACE-ON DISPLAY ...

COBOL 64

DIVIDE ..• INTO BY ... GIVING ..• ROUNDED ON SIZE ERROR ... EXIT FILTER-NUMERIC ... GO TO ... DEPENDING ON ... IF ... NEXT SENTENCE ..• ELSE ... NEXT SENTENCE .•. MOVE .. . MULTIPLY ... BY ..• GIVING ... ROUNDED ON SIZE ERROR ..• OPEN INPUT •.. OUTPUT ... I-0 ... PERFORM •.. THRU .. . READ ... AT END ... INVALID KEY ... SET .. . STOP RUN SUBTRACT ... FROM ... GIVING ... ROUNDED ON SIZE ERROR ... WRITE ... BEFORE/AFTER ADVANCING ... LINES ••• INVALID KEY ...

145

Page 156: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software

APPENDIX D

SAMPLE PROGRAMS

000100 IDENTIFIC~TIGN DlvlSIGN. 000200 PROGRAM-ID. BUILD-DATHi. 000300 AUTHOR. K A ALEXANDER. 000400 ENVIRONMENT DIVISION. 000500 CONFIGURATION SECTION. 000600 SOURCE-COMPUTER. C64. 000700 OBJECT-COMPUTER. Cb4. 000800 INPUT-OUTPUT SECTION. 000900 FILE-CONTROL.

COBOL 64

001000 SELECT DATAl ASSIGN TO DISK-1541 DRIVE-8 001100 FILE STATUS IS FILE-ST. 00120~ DATA DIVISION. 001300 FILE SECTION. .:~1400 FD '.101500 1301600 301700 01 ~01800

~01900

~02000 01 002100

DATA1 LABEL RECORDS ARE OMITTED VALUE OF FILE-ID IS "@0:DHfAl". DATM:ECGRD. 02 NAME-FIELD PIC X(201. 02 ADDR-FIELD PIC X(20l. DATiHHDRD2. 02 NAME-FIELD-EXIT PIC Xi4l.

002200 02 FILLER PIC X{361. 002300 WORKING-STORAGE SECTION. 00240~ 77 WRITE-FLAB PiC X v~LUi "N". 002500 77 RVS-ON VALuE CHR 18 PIC X. 00260~ 77 RETURN-CODE VALUE CHR 13 ~IC A.

002700 77 CLEAR-HOME VALUE CHR 147 PIC X. 102800 77 FILE-ST PIC Xl. ~029m@ PROCEDURE DIVISJQN. 003000 START-UP. 003100 DISPLAY CLEAR-HOME 003200 003300 003400 003500

OPEN OUTPUT DATAl IF FILE-ST IS NGT EQUAL TO

"Ii" DlSPLAY "Q?E~ ERRGR­STOP ~;UN.

0i3600 PERFORM 6~T-DATA-LOOP THRJ LOOP-EXIT. 003700 END-IT.

146

Page 157: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software

APPENDIX D

SAMPLE PROGRAMS

003800 CLOSE DATA1 003900 IF FILE-ST NOT EQUAL TO 1 00 1

004000 DISPLAY 9 CLDSE ERRDRH. 004l00 STOP RUN. 004200 GET-DATA-LOOP. 004300 DISPLAY RVS-ON 004400 "ENTER NAME FIELD 004500 RETURN-CODE 004600 ACCEPT NAME-FIELD 004700 IF NAME-FlELD IS NOT ALPHABETIC 004800 DISPLAY "NOT ALPHA" 004900 RETURN-CODE 005000 60 TO GET-DATA-LOOP. 005t00 IF NAME-FIELD-EXIT EQUAL TO 005200 •EXIT 9 GD TD LOOP-EXIT. 005300 DISPLAY RVS-ON ~05400 °ENTER ADDRESS 005500 RETURN-CODE 005600 ACCEPT ADDR-FlELD 005700 DISPLAY HDATA OK? (Y/NJ". 005800 ACCEPT WRITE-FLAG. 005900 IF WRITE-FLAG EQUAL "YH 006000 PERFORM WRITE-ROUTINE. 006t00 GO TO GET-DATA-LOOP. 006200 WRITE-ROUTINE. 006300 wRITE DATA-RECORD. 006400 IF FILE-Sl NOT EQUAL TG "00" 006500 DISPLAY "WRITE ERRORR 006600 STOP RUN. ~~6700 MOVE " 9 TO DATA-RECORD. 806800 MOVE 1 N" TO WRITE-FLAG. 006900 LOOP-EXIT. 007~00 EXIT. HCQMPLETED PRHH-OFF

147

COBOL 64

Page 158: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software COBOL 64

APPENDIX D

SAMPLE PROGRAMS

000100 IDENTiFICATION DlvlSiuN. 000200 PROGRAM-ID. LIST-DATAl. 000300 AUTHOR. K A ALEXANDER. 000400 ENVIRONMENT DIVISION. 000500 CONFIGURATION SECTION. 000600 SOURCE-COMPUTER. C64. 000700 OBJECT-COMPUTER. Cb4. 000800 INPUT-OUTPUT SECTION. 000900 FILE-CONTROL. 001000 SELECT DATA1 ASSIGN TO DISk-1541 DRIVE-B 001100 FILE STATUS IS FILE-ST. 001200 SELECT PRINT-FILE ASSIGN TD PRINTER-1525. 001300 DATA DIVISION. 001400 FILE SECTION. ~01500 FD DATA1 001600 LABEL RECORDS ARE OMITTED 001700 VALUE OF FILE-lD IS hDATAl". 001800 01 DATA1-RECGRD PiC X\40i. 001900 FD PRINT-FILE 002000 LABEL RECORDS ARE OMITTED. 002100 01 PRINT-REC PIC X(401. 002200 WORKINS-STORAGE SECTION. ~02300 77 FILE-ST PIC XX. 002400 PROCEDURE DIVISION. 002500 START-UP. 002600 OPEN INPUT DATAl. 002700 IF FILE-ST NQT EQUAL TO •00~

002800 DISPLAY uoPEN ERRORM 002900 STOP RUN. 003000 OPEN OUTPUT PRINT-FILE. 003100 PERFURH READ-WRITE-LOOP THRU LOOP-EXIT. 00:0200 END-UP. 003300 CLOSE PRINT-FILE. 003400 CLOSE DATA1. 003500 IF FILE-ST NOT EQUAL TD "00u 003600 DISPLAY "CLOSE ERROR". 003700 STOP RUN.

148

Page 159: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Abacus Software

APPENDIX D

SAMPLE PROGRAMS

003800 READ-WRITE-LOOP.

COBOL 64

003900 READ DATA1 AT END GO TO LDDP-Eiil. 004000 IF FILE-ST NOT EQUAL TO ·~0·

~04100 DISPLAY uREAD ERROR• 004200 STOP RUN. 004300 MGVE DATAl-RECQRD TO PRINT-REC. ~04400 WRITE FRINT-REC. i04500 MOVE H n TO PRINT-REC, 004600 GO TO READ-WRITE-LOOP. 004700 LOOP-EXIT. 004800 Em. HCOMPLETEO PRINT-Off

149

Page 160: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL
Page 161: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

C-128 REQUIRED and C-64™ REAi >ING COMMODORE <} ~u

COMMODORE

©L'l.IQl COMPUTER AIDED DESIGN

L2wE f~ ~~

ADA~A BC:OIEFIEIOOl(Pl.J8ll&HE08V AllliTA 9£C>(£Fl[lOCJO;PlJIUSl--£08V A.Doi.TA Bl.CO:EFl!l(X)ol;PU8:_lQ-1EOBV Al».TA 8£Cl(EFl80{)0;PUll.J6HED8V AQATA 8ECO:EPl!l()()(PUILISHED8V

AbacusBSoflware /\.bdcusllBlllfl.Softwarc Abacus-Software Abacus-Software Abacus-Software

Detailed guide presents the 12B's Get all the inside information on Filled with inlo 1or everyone. Covers Insiders' guide for novice & ad- Learn fundamentals of CAO while operating system, explains graphic BASIC 7.0 This exhaustive hand- 80 column hi-res graphics, win- vanced users Covers sequential & developing your own system. Design chips, Memory Management Unit, 80 book is complete with commenled dewing, memory layout, Kamal relative 11les, & direct access com- ob1ects on your screen to ci.Jmp to a column graphics and commented BASiC 7.0 ROM listings. Coming routines, sprites, software pro- mands. Describes DOS routines printer. Includes listings for '64 w.i!h ROM listings 500pp $1995 Summer'86 $19.95 tec1t0n,autostarting 300pp $19.95 Commented listings $1995 Simon'sBasic 300pp $1995

~<l BASICs.ource lJ

,.@";-::: •• ·s- 11 ~I e¢Sii?F:'

iiiliiil iii .,. .. ""''"""'""u""'"' I Ai»,IAl1EC<;EFl8000:f>Ull.$HEDIJV

/\.bacusBllll.Softwarc AbacusBllll.Softwarc

Introduction to programing; problem Presents. dozens al programming analysis thorough descripllOn ol all quick-hitters Easy and useful BASIC commands with hundreds of techniques on tMe operating system, examples, monitor commands: util- stac11.s, zero-page, pointers, !Me i11es, mucM more $16.95 BASIC interpreter and more $16 95

ANATOMY OF C·64 Insider's guide lo the TRICKS & TIPS FOR C-64 Coll8Ction of SCIENCE/ENGINEERING ON C-94 In Adventure G1mewrlter'e H1ndbook

!!!n~~n~~.G~:::~~~o~;~~ ~O~~:~~=~ ~~:~~t~~~sed:l~h~~~t =~~~~:dd g~i1~: ~~~~i~~~~~ t~h';~:.te~0;1~~~'.e:~~0:o:!~~ ~~:~-:!::~~~~~e t;a'::~~;~h ~0::!~~ ROM listings. 300pp $19.95 CP/M, more. 275pp- $19.95 eledronK:s, o1hers. 350pp $19.95 adventure game generator. 200pp $14.95

ANATOMY OF 1~&.DRIVE Best 1541 REPAIR & MAINTENANCE CASSETTE BOOK C-64/VIC-20 PEEKS & POKES FOR THE C-64 handbook on ,_; · s all. Many Handbook describes !he disk drive hard· Comprehensive guide; many sample Includes in-depth explanalions of PEEK, examples and ~~ commented ware. Includes schemalics and lechniques programs. High speed operating system POKE, USA, and other BASIC commands. 1541 ROM listin 500pp $19.95 to keep 1541 running. 200pp $19.95 fast tile loadmg and saving. 225pp $14.95 Learn the •inside• tric*.s to get the most out

MACHINE LANGUAGE C-64 Learn ADVANCED MACHINE LANGUAGE IDEAS FOR USE ON C-64 Themes: olyour'64. 200pp $14.95 651 O code write last programs. Many sam- Not covered elsewhere: - video conlroller, auto expenses, calculalor. recipe file, stock Option al Dlakettea for book• pies and listings for comple1e assembler, interrupts, timers, clocks, VO, real time; i1sts, diet planner, window advertising, For your convenience, the programs. monitor, & simulator. 200pp $14.95 extended BASIC, more. 210pp $14.95 others. Includes listings. 200pp $12.95 contained in each of our books are avail-

GRAPHICS BOOK C-64 ·best reference PRINTER BOOK C-64/VIC·20 Under· COMPILER BOOK C-64/C·128 All you able on diskette to save you time entering covers basic and advanced graphics. 51and Commodore, Epson-compatible print- need 10 know aboul compilers: how they them from your keyboard. Specify name of Sprites, animation, Hires, Multicolor, ers and 1520 ploner. Packed: utili,ies; gra· work; designing and writing your own; book when ordering. $14.95 each llghtpen, 30·graph1cs, IAQ, CAO, pro- phics dump; JD-plot; commenled MPSao1 generating machine code. With working

·"···--·-~~~s 1liiiii1ii~~f~re·---~-P.O. Box7219 Grand Rapids, Ml 49510· Telex709-101 • Phone(616)241·5510 Call now for the name of your nearest dealer. Or to order directly by credit card, MC, AMEX of VISA call (616) 241-5510. Other software and books are available-Call and ask for your free catalog. Add $4.00 for shipping per order. Foreign orders add $10.00 per book. Dealer inquires welcome-1400+ nationwide.

Page 162: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

TI.ii

'128 and C·64™

.............................................. ,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,.,,,,,,,,,,,,,,:,:,:,:,:,:,:,.·:·:::::::::::::\! The complete compiler

ii and development pack­i' age. Speed up your pro­!! grams Sx to 35x. Many ii options: flexible memory i' management; choice of

-

-

Cl ll ~

'! compiling to machine . '! code, compact p-code or > both. '128 version: 40 or ii 80 column monitor output '! and FAST-mode opera­'! lion. '128 Compile(s ex­:: tensive 80-page pro-

Mait.e yow BAS/CprogrQMS nui.UGHT'NING SPEED! :: grammer's guide covers

l!l!!!!!l!ll!l!!l!l::::::l.,:::,:!:::::::!::::::~'"''l'::i.lnf ~~~~~r t':ct~::is an:, optimization, memory usage, VO handling, 80 column hi-res graphics, faster, higher precision math functions. speed and space saving tips, more. A great package that no software library should be without. 128 Complier $59.95

64 Compiler $39.95

,----====:::::===:;---:-:----:-:---1 Easily create professional high quality charts and

=---"'---'-'--'"-"~-"--'-.I graphs without programming. You can immediately change the scaling, labeling, axis, bar- filling, etc. to suit your needs. Accepts data from CalcResult and MultiPlan. C-128 version has 3X the

.. resolution of the '64 version. :H.rr-T,,_.,...,........,.:.;r;,,_, JI Outputs to most printers.

PowerPlan

C-128 $39.95 C-64 $39.95

One of the most powerful spreadsheets with integraded graphics. Includes menu or keyword selections, online help screens, field protection, windowing.trig functions and more. PowerGraph, the graphics package, is included to create integrated graphs & charts. C-64 $39.95

COBOL Compiler for the C-64 $39.95 Ada Compiler for the C-64 $39.95 VideoBasic Language for the C-64 $39.95

~-----------,Not just a compiler, but a Comp1lerandSoftwarc Development System

complete system for develop­ing applications in Pascal

~. ~i!~ur~~ap~~t:n:~~ :~~:;,~ : :· · 'i::···::· .. 4 :::::: :: .. ~ with search, replace, auto,

' ~~] ~ " ~"~":~ie~t~h~tta~:~:~a~e: . ·:;}. " ~ last machine code. If you

want to learn Pascal or to

c~ '2. " g:~~~:,:~~~~,~Jp~: '----------·----'Pase.I is ~~;21;st 5c;:.~s

C-64 $59.95

OTHER TITLES AVAILABLE: Technical Analysis Systam ~

Sophisticated charting and technical analysis system for '1119"' serious investors. Charting and analyzing past history of a stock, TAS can help pinpoint trends & patterns and predict a stock's future. Enter data from the keyboard or from online financial services. C-64 $59.95

Personal Portfolio Manager Complete protfolio management system for the individual or professional investor. Easily manage your portfolios, obtain up-to-the-minute quotes and news, and perform selected analysis. Enter quotes manually or automatically through Warner Computer Systems. C-64 $39.95

Xper XPER is the first "expert systerrl' for the C-128 and C-64. While ordinary data base systems are good for reproducing facts, XPER can derive knowledge from a mountain of facts and help you make expert decisions. Large capacity. Complete with editing and reporting. C-64 $59.95

C· 128 and C-64 •• •ld1miarkl of Ccmmoda• 6Ultnnl W.chlnM Inc.

AbacusliiHHiiil Software P.O. Box 7219 Grand Rapids, Ml 49510- Telex 709-101 -Phone (616) 241-5510 Call now for the name of your nearest dealer. Or to order directly by credit card, MC, AMEX of VISA call (616) 241-5510. Other software and books are available-Call and ask for your free catalog. Add $4.00 for shipping per order. Foreign orders add $12.00 per item. Dealer inquires welcome-1400+ nationwide. ..,,,,,

Page 163: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

REQUIRED READING

INTERNALS Essential guide to learning the inside information of the ST. Detailed deacrlptions of sound & graphics chips, internal hardware, various ports, GEM. Commented BIOS listing. An indispensible reference for your library. 450pp. $19.95

GEM Progr1rnmer'1 Rel. TRICKS & TIPS Fantastic collection of pro­grams and Info for the ST. Complete programs include: super-fast RAM disk; tlme­saving printer spooler; color print hardcopy; plotter output hardcopy. Money saving tricks and tips. 200 pp. $19.95

GRAPllCS & SOUND Detailed guide to understand· Ing graphics & oound on the ST. 20 & 30 function plotters, Moir6 pattern•, various reso­lutions and graphic memory, fractals. waveform generation. Examples written In C, LOGO, BASIC and Modula2. $19.95

PRESENTING THE ST Gives you an in-depth look at this sensational new computer. Discusses the architecture of the ST, working with GEM, the mouse, operating system, all the various interfaces, the 68000 chip and its instructions. LOGO. $16.95

For serious programmers In need of detailed Information on GEM. Written with an easy-to-understand format. All GEM examples are written In C and assembly. Required reading for the serious pro­grammer. 450pp. $19.95

MACHINE LANGUAGE Program in the fastest language for your Atari ST. Learn the 68000 assembly language, its numbering system, use of registers, the structure & important details of the instruction set, and use of

~~Kl~.ter~pp s$~~~~

LOGO PEEKS & POKES BEGINNER'S GUIDE Take control of your Enhance your programs Finally a book for those ATARI ST by learning with the examples found new to the ST wanting to LOGO-the easy-to-use, within this book. Explores understanding ST basics. yet powerful language. using the different lang- Thoroughly understand Topics covered include uages BASIC, C, LOGO your ST and its many structured programming, and machine language, devices. Learn the funda­graphic movement, file using various interfac~s, mentals of BASIC, L~O handling and more. An memory. usage, reading '.ind more. Complete. wrth excellent book tor kids as and saving from and to mdex, glossary and Illus­well as adults. $19.95 disl<, nnora. $16.96 !rations. +200pp $14.95

= BASIC Trolnlng Gulde

lndispensible handbook for beginning BASIC program­mers. Learn fundamentals of programming. Flowcharting, numbering system, logical operators, program structures, bits & bytes, disk use, chapter quizzes. 200pp. $16.95

BASICTOC If you are already familiar with BASIC, learning C will be all that much easier. Shows the trans­ition from a BASIC program, translated step by step, to the final C program. For all users interested in taking the next step. $19.96

Abacus liiiHHHI Software···--P.o. Box7219 Grand Rapids, Ml 49510- Telex709-101- Phone(616) 241-5510 Optional diskettes are available for all book titles at $14.95 Call now for the name of your nearest dealer. Or order directly from ABACUS with your MasterCard, VISA, or Amex card. Add $4.00 per order for postage and handling. Foreign add $10.00 per book. Other software and books coming soon. Call or write for your free catalog. Dealer inquiries welcom~ver 1400 dealers nationwide.

Page 164: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

,...,

Page 165: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL
Page 166: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL
Page 167: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

REGISTRATION CARD

Registration #. 5 0 4 0 7 ~ Prodoct. ______ _

Nam:'----------------------~ Address·--------------------~ City Stare Zip~----

Purchase Inrormation: Deal~.~~~~~~~~~~~~~~~~~~~~~~~-

Address.~--------------------~ City Stare Zip. ____ _

Returning this registration card entitles you to phone support for the above product. You may also obtain a backup copy of the diskette for a handling charge of $10.00. This card and a check, money order or credit card number must accompany this request Purchase orders are not acceptable.

BACKUP COPY? __ No, do not send a backup, but register my purchase __ Yes, send a backup copy, payment is enclosed

Credit card# __________________ _

Expiration Date,_____. _ __. __

Page 168: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

Return this Certmcare for a FREE ISSUE of RUN Magazine! Canplete this certiOCate and mai today to see fa" youiselt, the money-saving, tine­saving help yru'I Qti in fM!Jy isrue ol RUN-the Coornodore C-128/C04 Hane

Canl)Jting Guide! IC. OON and ~ the many ways YES, send my FREE EXAMINAl'ION ISSUE of RUN can increase the value ol yrur canputer fM!Jy RUN and enter my no-risk Subscription fOf one year

I001lh wilt . . (ll mOfe monthly issues), fOf 1JSI S1U7-a savings • ProgrllllS I Ulllllll that give yru a D" range of o1 $15.43 (44~) off the newsstand price. If I decide

apii::ations . .. ~ Mning programs than eYef not to subscribe, I will mark your invoice "cancel" before. and owe nothing. The FREE issue is mine to keep .

• Expert fll¥lewl of ha'<t.vare and software for yrur C-128 or C04 that wil steer yru straiglt .. . help yru save money . •. avoid ~ mSakes.

• Specill Dlplrlmenll Oil 1ef9:oovnurtalions, educa­tion, News tran Coovnodore, sdving protms, and more!

11*1 ilme -°'' - ""

Page 169: COBOL 128 Software System - VTDAvtda.org/docs/computing/Abacus/Abacus_COBOL128... · Any references to COBOL 64 throughout this manual also apply to COBOL 128. II CONVERTING COBOL

BUSINESS REPLY MAIL FIRST-CLASS MAIL PERMIT NO. 73 PETERBOROUGH, NH

POSTAGE WILL BE PAID BY ADDRESSEE

CW Communications/Peterborough RlJN P.O. Box 954 Farmingdale, NY 11737

I, II 11 ••• 111 ••• 1 .. 11.1 ••• 11.1 •• 1 •• 1 •• 1.1 .. 1 •• 1.1.1.1

NO POSTAGE NECESSARY IF MAILED

IN THE UNITED STATES