i.'.:: - . cobol manual addendum ' · cobol manual addendum versions 3.01 and higher...

62
COBOL MANUAL ADDENDUM ' Part no .. 023-4000 ,:" . .. ,i.'.:: - . VERSIONS 3.01 AND HIGHER CROMEMCO, Inc. 280 Bernardo avenue Mountain View,CA 94043 March 19'aO

Upload: others

Post on 26-Mar-2020

22 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

COBOLMANUAL ADDENDUM '

Part no .. 023-4000

,:" . .. ,i.'.:: - .

VERSIONS 3.01 AND HIGHER

CROMEMCO, Inc.280 Bernardo avenue

Mountain View,CA 94043

March 19'aO

Page 2: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules
Page 3: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

(

(

(

(

(

(

CromemeoCOBOL

MANUAL ADDENDUM

VERSIONS 3.01 AND HIGHER

CROMEMCO. Inc.280 Bernardo avenue

Mountain View,CA 94043

Part no. 023-4000

Copyright © 1979, 1980By CROMEMCO, Inc.

ALL RIGHTS RESERVED

Marcil 1980

Page 4: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

This manual was produced in itsentirety with the Cromemco WordProcessing System' and waspr inted on a Cromemco Model3355A printere

Page 5: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

(

Cromemco COBOL Manual Addendum

Table ~ Contents

Section Page

Introduction • ~ • • e _ • 0 0 0 • e e • e e • c • 1

(" 1 New Features Summary 3'- • • • " .. .. • " • " " .. " • •

2 Language Overview • • • • • .. .. .. • • • • • • .. • • 5

3 Amendment to Reference Manual • • · • • .. • • .. • · 7

103 Word Formation .. • • • .. .. • • • • .. " .. • 71012 Coding Rules • • • • .. • • .. • • • • • .. • 71013 Qualification of Names • • • • • • • • • • 81,,14 COPY Statement • • • • • • • • • • • • • · 82.2.2.1 FILE-CONTROL Entry • • • • • • • • • • • 82 .. 2.2.2 I-O-CONTROL Paragraph • • • • • · • • • • 103013 FILE SECTION, FD Entries • • • • • • • • • 103.13 .. 2 VALUE OF FILE-ID Clause • • • • • · • • • 113.13.7 LINAGE Clause • • • • • • • • • • • • • • 113.,17 DATA DIVISION Limitations • • • • • • • • 124 .. 8 ACCEPT Statement • • • • • • • • • • • • • 13

4.8.1 Format 1 • • ., • • • • · • • • • • 144.8.2 Format 2 (Scrolling) • • • • • • • 144.8.3 Format 3 (Cursor Control) • • • • • 15

4.8.3.,1 Data Input Field i 16• • • • •4.8.3.2 Data Input and

Data Transfer • • • • • 184.8.3.,3 WITH Phrase Summary • • • 22

409 DISPLAY Statement • • • • ., • • • • • • • 274.16 WRITE Statement • • • • • • • • • • • • • 294.18 REWRITE Statement • • • • • · • • • • • • 314.22 Dynamic Debugging Statements • .. • • • • • 31702.1 RECORD KEY Clause • • • ., .. • • • ., • • • 31702 .. 2 File Status Reporting • • • • • • • • .. .. 328.1 Definition of Relative File Organization • 32

APPENDIX V Reserved Words • • .. • • • .. • .. • • • 33

4 Amendment to User's Guide • • • • • • • • • .. .. • .. 37

1.2 Output Listings and Error Messages .. • " " 372,,2 LINK Switches , 38" " • .. • • • .. .. .. • .. • •2.3 Format of LINK-Compatible Object Files • • 392.4 LINK Error Messages .. • • • • • .. .. · • • 392.6 Separating Data and Program Areas • • .. • 40

I,-- 3.2 Disk File Handling 41., • • • • • .. • • • • •3 .. 3' Runtime Errors • • • • " • • • • • " • .. • 423.4 Subprogram Calling Mechanism • " • • • .. • 42

Page 6: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

5

6

7

!

A Sample Program Q ~ ~ Q e

Using Non=Cromemco Terminals

Errata e Q Q e Q 0 Q 0 Q Q

e

o

e

e

Q o

G

e

Q

o

45

47

53

Page 7: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUM(. Introduction

Introduction

Cromemco COBOL, versions 3.01 and higher, contains severalimportant new features not available in previous versions ofCOBOL, along with several enhancements to existing features.This addendum has seven sections. The first contains a listof new features and enhancements. The second contains anoverview of the compiler and runtime system. The thirdamends the reference manual portion of the Cromemco COBOLInstruction Manual and includes descriptions of the syntaxrequired to use the new features of COBOL. The fourthsection amends the User's Guide portion of the InstructionManual, the fifth contains the compile-time listing of aprogram that illustrates some of the ACCEPT and DISPLAYcapabilities, and the sixth describes how to create and use aterminal driver module for non-Cromemco terminals. The finalsection contains errata noted in the COBOL InstructionManual, part number 023-0049, April, 1979.

The implementation of several of the new features of COBOLincludes changes which would cause some programs to executesomewhat differently were they to be compiled without changeusing version 3.01 or higher. Programs that use .Sequentialfiles, the DISPLAY verb, and the EXHIBIT verb will probablyrequire some· modification.

In previous releases of Cromemco COBOL, there was only onetype of Sequential file organization, that using carriagereturn, line feed characters to terminate all records. Thiscaused problems for records containing COMPUTATIONAL orCOMPUTATIONAL-3 data types since these items can containbinary values identical to the carriage return, line feedcharacters. Therefore, another type of Sequential fileorganization has been implemented, in which each record ispreceded by a two-byte count containing its length. Thisallows all possible values in all types of data fields, andis actually the organization that variable-length sequentialfiles have in many other COBOL systems.

It was considered desirable to retain the old organizationwhile implementing the new, and this was done. However"ORGANIZATION IS SEQUENTIAL" now selects the new byte-countorganization because this is the more complete organization.This means that existing data files cannot be used whenexisting programs are recompiled without change using version3.,01 or higher. In order to continue to use existing datafiles, the user may eithet convert them to the neworganization using the program named "SEQCVT" supplied on thedistribution diskette, or he may modify his COBOL programs toselect "ORGANIZATION IS LINE SEQUENTIAL" and recompile them.

1

Page 8: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMIntroduction

SEQCVT is executed with the command string

SEQCVT <newfile>=<oldfile>

where <oldfile> is the name of the file to be converted and<newfile> is to be the name of the resulting converted file.The old file is not deleted.

In previous versions of COBOL, the execution of DISPLAY andEXHIBIT included the conversion of values in numericidentifiers from the internal form to the report form beforethe value was actually displayed on the terminal. Versions3.01 and higher no longer include this conversion, so it hasbecome the responsiblity of the user first to move the valueto an identifier described. with a report=form PICTURE, thento DISPLAY that report=form identifiero

2

Page 9: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

(

(

CROMEMCO COBOL MANUAL ADDENDUMSECTION 1 - New Features Summary

SECTION 1

New Features Summary•

ACCEPT AND DISPLAY

ACCEPT and DISPLAY now offer both the ANSI standardline-by-line console I/O and I/O with the use of cursorpositioning and numerous options to aid the input ofdata from a CRT ..

COMPILER MEMORY OPTIMIZATION

A new memory management mechanism allows compilation ofprograms containing more than 1000 lines in a 48K systemwith 2 or 4 large drives, and more than 3000 lines in a64K system with two large or small floppy drives and onehard disk. These program sizes were calculated underthe assumption that the programs contain four PROCEDUREDIVISION lines for each DATA DIVISION line. The maximumcompilable program size increases as the number ofPROCEDURE DIVISION lines increases relative to thenumber of DATA DIVISION lines.

DIGITS IN IDENTIFIERS

Any user-defined identifiers, including data names, filenames, and procedure names may now begin with a digitcharacter.

ERROR SUMMARY

COBOL now displays the total number of errors detectedduring compilation on the console at. the end ofcompilation. This allows the programmer to learnwhether a compile is error-free even when he hasselected not to receive a listing.

EXHIBIT

"EXHIBIT now has the same cursor positioning facility asDISPLAY.

LINAGE FOR PRINTER FILES

The LINAGE clause for files assigned to the printerallows the specification of the number of lines in thepage body, the top and bottom margins, and the footingarea for each printed page. Refer to the notes onLINAGE and WRITE in Section 2 for details.

3

Page 10: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 1 = New Features Summary

LISTING

The headings on compile listings are now printed down 3lines from the top of the page and are followed by twoblank linese

OVERLAY NAMES

The file names of the COBOL compiler overlays have beenchanged to nCOBOLnoOVR" where n ranges from 1 to 4e

SEQUENTIAL AND LINE SEQUENTIAL FILES

The ORGANIZATION IS SEQUENTIAL clause in the FILE=CONTROL entry now has the correct and complete effectfor compliance with the ANSI standard specifications,and ·the ORGANIZATION IS LINE SEQUENTIAL clause allowsthe use of files containing records delimi ted by_carriage return, line feed characters ..

4

Page 11: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMC SECTION 2 - Language Overview

SECTION 2(

(

(

Language Overview

Cromemco COBOL is based on the 1974 ANSI standard andcontains all Level I features and the most useful Level 2options for the "Nucleus" and for Sequential, Relative andIndexed file handling facilities. Additionally, Level 1Table Handling, Library and Inter-program Communicationfacili ties are provided e Of the advanced Level 2 features,Cromemco COBOL includes the verbs STRING, UNSTRING, COMPUTE,SEARCH, and PERFORM (VARYING/UNTIL), along with convenientcondition-names, compound conditions and abbreviatedcondi tiona e The ANSI COBOL language has been extended inthree ways to take advantage of microcomputer features.First, there is a versatile interactive screen handlingfacility allowing COBOL programs to take advantage of CRTterminals. Second, a data format called COMPUTATIONAL-3allows numeric data to be packed two digits to the byte sothat mass storage requirements are reduced. Third, specialdebugging inst;ructions are implemented to get programsrunning in a minimum of time.

~ COMPILER

The compiler is written in carefully designed, machine­independent pseudo-code rather than Z80 machine lanquage.There is an interpreter written in Z80 machine language whichexecutes the algorithms specified by the pseudo-code. Speeddegradation is slight because the time spent to interpreteach pseudo-code instruction is insignificant compared to thetime required for its total function.

The compiler consists of five, overlays, each one executed inturn in the same memory space. The compiler is "two-pass" ,which means that the source code is read while anintermediate file is written, then the intermediate file isread and the generated object code is written. An optionallisting file showing source lines and errors may also beproduced.

Memory usage is approximately 26K bytes for the compiler andinterpreter , plus a minimum of SK bytes for table space,plus about 14 bytes for each DATA DIVISION line, plus 3 1/4bytes for each PROCEDURE DIVISION line. This memoryrequirement plus the CDOS memory requirement, which variesaccording to the declarations given by the user during theCDOSGEN program, determines the largest COBOL program thatmay be compiled in a computer with a given amount of memory.

The compilation rate is about 300 lines per minute for lines

5

Page 12: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 2 = Language vverview

before the Procedure Division, and about 150 lines per minutefor lines within the Procedure Divisione

xaE RUNTIME SYSTEM

The object code generated by the compiler is alsointerpretede The runtime system handles all algorithmicfunctions such as arithmetic, string manipulation and editingin addition to managing sequential, relative and indexed r/OeIt also controls program flow as specified at the sourcelevel by conditions, GOs and PERFORMse In short, the runtimesystem handles, at the machine level, anything that can bewritten in Cromemco COBOL.

As in the compiler, the generated pseudo-code specifies thecomplete algorithmic logic to be executed, and the runtimeinterpreter performs the algorithms for a. given machine ..Again, as with the compiler, the overhead is insignificantwhen compared to the benefit of memory space reduction ..Since all parsing and address resolution is done at compile=time, one can simply think of the pseudo-code as subroutinecalls to accomplish given tasks with given parameters ..

The amount of memory required at runtime equals the amountrequired to store the data items defined in the DataDivision, plus about 500 bytes per file, plus about 12 bytesper Procedure Division line, plus between 17K and 20K ofruntime support software.

Linking and loading time is approximately 50 seconds for theData Division and support software, plus the time required toload the Procedure Division y which is done at a rate of about400 Procedure Division lines per minute ..

6

Page 13: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

(

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

SECTION 3

Amendment to Reference Manual

This section contains descriptions of the syntax required touse the new features of COBOL. The section numbers precedingthe paragraphs refer to those sections in the Cromemco COBOLmanual amended by these paragraphs. In some cases, theaddi tion of new features has required the addition of newsections. These are presented in the appropriate order. Inaddi tion, some of these paragraphs serve only to clarifyoperational details of Cromemco COBOL, not to reflect theaddition of features.

(

1.3

1 .. 12

Word Formation

User-defined and reserved words are composed of a combinationof not more than 30 characters, chosen from the following setof 37 characters:

o through 9 (digits)A through Z (letters)- (hyphen)

All words must contain at least one letter or hyphen, exceptprocedure-names which may consist entirely of digits. A wordmay not begin or end with a hyphen. A word is ended by a"space or by proper punctuation." A word may contain more thanone embedded hyphen; consecutive embedded hyphens are alsopermitted. All words are either reserved words, which havepreassigned meanings, or programmer-supplied names.. If aprogrammer-supplied name is "not unique, there must be aunique method of reference to it by use of name qualifiers,e",g .. , TAX-RATE IN STATE~TABLE. Primarily, a non-reservedword identifies a data item or field and is called a data­name. Other cases of non-reserved words are file-names,condition-names, mnemonic-names, and procedure-names.

Coding Rules

7 • Any tab characters in a line are expanded as if therewere tab stops at every eighth column past column 1,except that the first tab stop is in column 7, just pastthe six sequence-number columns. Subsequent tab stopsare columns 17, 25, 33, etc. as determined by thegeneral rule.

.,

Page 14: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 ~ Amendment to Reference Manual

1613 Qualification --clarification--

Data names used as qualifiers cannot be subscripted ..

1 .. 14 COPY Statement --clarification--

The COpy statement must begin in column 8, and the name ofthe copy file is not enclosed in either single or doublequotese

The file named in the COPY statement must contain a singlemodule of COBOL source statements.. The.se statements will beinserted without change in place of the COpy statement Q

There is no COpy library as such--each module of source coderesides on disk in a uniquely named file ..

Example;

"..DATA DIVISION"COpy BgPRINTER.. LIB o

..

..

For each file having records described in the Data DivisionisFile Section, a Sentence-Entry (beginning with the reservedword SELECT) is required in the FILE-CONTROL paragraph.. Theformat of a Select Sentence-Entry for a sequential file isg

SELECT file-name ASSIGN TO DISK I PRINTER

[RESERVE integer AREAS I AREA]

[FILE STATUS IS data-name-I]

[ACCESS MODE IS SEQUENTIAL]

[ORGANIZATION IS USNE] SEQUENTIAl.].,

The SELECT entry must begin to the right of Area A of· thesource line., All phrases after "SELECT filename" can be inany order.. Both the ACCESS and ORGANIZATION clauses areoptional for regular sequential input-output processing., For

8

Page 15: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUM( SECTION 3 - Amendment to Reference Manual

(

(

Indexed or Relative files, alternate formats are availablefor this' section, and are explained in the chapters onIndexed and Relative files.

Two formats are available for sequential disk files. One isthe regular form which is requested by ORGANIZATION ISSEQUENTIAL, and the other is requested by ORGANIZATION ISLINE SEQUENTIAL. Both forms assume the records in the fileare variable-length. The regular Sequential Organization isthat of a two-byte count of the record length followed by theactual record, for as many records as exist in the file. TheLine Sequential Organization has the record followed by acarriage return/line feed delimiter, for as many records asexist in the file. No COMP or COMP-3 information should bewritten into a Line Sequential file because these data itemsmay contain the same binary codes used for carriage returnand line feed which therefore would cause a problem whensubsequently reading the file. Both organizations pad anyremaining space of the last physical block with Control-Zcharacters, indicatingend-of-file. All records are placedin the file with no gaps; they span physical blockboundaries.

The RESERVE clause is not functional in Cromemco COBOL, butis scanned for correct syntax. One physical block buffer isalways allocated to the logical record area assigned to it.This allows logical records to be spaqned over physical blockboundaries. For files assigned to PRINTER, the logicalrecored 'area is used as the physical buffer as well.

In the FILE STATUS entry, data-name-l must refer to a two­character Working-Storage or Linkage item of categoryalphanumeric into which the run-time data management facilityplaces status information after an I-O statement. The left­hand character of data-name-l assumes the values:

'a' for successful completion'I' for End-of-File condition'2' for Invalid Key (only for

Indexed and Relative files)'3' for a non-recoverable (I-O) error

The right-hand character of data-name-l i$ set to '0' if nofurther status information exists for the previous I-Ooperation. The following combinations of values arepossible:

9

Page 16: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

File Status Left File Statu$ Right Meaning

'0 ' '0 ' O.. K..'1 ' '0 ' EOP'3 ' , 0 ' Permanent error'3 ' '4 11 Disk space full

In an OPEN INPUT or OPEN I-O statement, a File Status of '30'means 'File Not Found.'

For values of status-right when status-left has a value of'2', see the chapters on Indexed or Relative files ..

2 .. 2.2 .. 2 I=Q CONTROL PARAGRAPH

The SAME AREA clause is optional.. Only the SAME RECORD AREAform is functional in Cromemco COBOL., The other forms arechecked for correct syntax but do not cause any sharing ofphysical buffer space.

The SAME RECORD AREA form causes all the named files to sharethe same logical record area in order to conserve memoryspace ..

The format of the SAME AREA entry

SAME [RECORD] AREA FOR filename

is:

.. c ..

3 .. 13 FILE SECTION, .fD. ENTRIES (SEQIIENTTAT. .I.:::.O. ONLY).

In the FILE SECTION of the Data Division, an PD entry (filedefinition) must appear for every Selected File. This entryprecedes the descriptions of the file's record structure(s).

The general format of an PD entry is:

m file name LABEL-clause [VALUE-OF-clause]

[DATA-RECORD(S}-clause] [BLOCK-clause] [RECORD-clause] ~

[CODE"'SET~clause] [LINAGE clause] •

.. After "FO filename," the order of the clauses is immaterial ..

10

Page 17: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

(

(/"13.2\

3.13 .. 7

VALUE .Qf. CLAUSE

The VALUE OF clause appears in any FD entry for a DISK­assigned file, and contains a file ID expressed as a data­name or COBOL-type "quoted" literal of at most 16 characters ..The general form is:

VALUE .Qf. FILE-In IS { data-name }nliteral l1l

Examples:

VALUE OF FILE-ID I1IA:MASTER.. DAT I1IVALUE OF FILE-ID IS "PAYROLL. PAY"VALUE OF FILE-ID "B:ITEMFILE"

data-name is the name of an elementary or group item thatcontains 14 characters. The item may be shorter than 14characters, at the expense of file naming flexibility.

A reminder: if a file is ASSIGNed to PRINTER, it isunlabeled and the VALUE clause must -DJlt.be included in theassociated FD. If a file is ASSIGNed to DISK; it isnecessary to include both LABEL RECORDS STANDARD and VALUEclauses in the associated FD.

LINAGE CLAUSE

For a file assigned to PRINTER, the LINAGE clause provides ameans of specifying the 'size of the printable portion of apage, called the "page body.," The number of lines in thepage body is specified along with, optionally, the size ofthe top and bottom margins and the line number within thepage body at which a footing area begins.. The general formatis:

IS {data-name-I}

LINAGEinteger-l {

- data-name-2} -LINES, [WITH FOOTING. AT- . J

integer-2

- { data-name-3 }[LINES AT mE. ]

-integer-3

-- {data-name-4}[LINES AT BOT'i'OM - . ~_ _ _J

integer-4

All data-names must refer to unsi.gned numeric integer dataitems. Integer-l must be greater than zero, and integer-2

11

Page 18: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

must not be greater than integer-Ie

The total page size is the sum of the values in each phrasee~cept for FOOTING. If TOP or BOTTOM margins are notspecif ied, their size is assumed zero.. The footing areacomprises that part of the page body between the lineindicated by the FOOTING value, and the last line of the pagebody, inclusive ..

The values in each phrase at the time the file is opened (bythe execution of an OPEN OUTPUT statement) specify the numberof lines that comprise each of the sections of the firstlogical page. Whenever a WRITE statement with the ADVANCINGPAGE phrase is executed or a "page overflow" condition occurs(see the WRITE statement), the values in each phrase, at thattime, will be used to specify the number of lines in eachsection of the next logical page ..

A LINAGE-COUNTER is created by the presence of a LINAGEclausee The value in the LINAGE-COUNTER at any given timerepresents the line number at which the printer is positionedwithin the current page body.. LINAGE-COUNTER may bereferenced but may not be modified by Procedure Divisionstatements. It is automatically modified during execution ofa WRITE statement f according to the following rulesg

I.

3.

When the "ADVANCING PAGE" phrase of the WRITE statementis specified or a "page overflow" condition occurs (seethe WRITE statement), the LINAGE COUNTER is reset toone ..

When the I1lADVANCING identifier or integer" phrase isspecified, LINAGE-COUNTER is incremented by theADVANCING value",

When the ADVANCING phrase is not specified, LINAGE~

COUNTER is incremented by onee

3.17 DATA PIVISION LIMITATIONS

There is a limitation on the number of items in the Working=Storage, Linkage, and File sections of the Data Division ..The limitation is that the number of 4K=byte blocks ofworking-storage dataf plus the number of Level 01 or 77 itemsin. the Linkage section, plus the number of files described inthe File section must be less than 14. However there is no­limitation on the number of files which may be opensimultaneously.

12

Page 19: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

Other l:j.mi tations are that the maximum size of a· level 01item is 4095 bytes, and the maximum size of a record ineither a SEQUENTIAL or LINE SEQUENTIAL file is 4093 bytes.

408 ACCEPT STATEMENT

The ACCEPT statement is used by a processing program toobtain low-volume input at runtime. Three formats areavailable:

Format 1..:..

ACCEPT identifier-l FROM {:iE}

TIME

(.

Format 2,:

ACCEPT identifier-2

Format .3,:

ACCEPT position-spec identifier-3 [WITH

SPACE-FILLZERQ-FILLLEFT-JUSTIFYRIGHT-JUSTIFYTRl\II,ING-SIGNPROMPTUPPATEI.ENGTH-CHECKAUTO-SKIPBEEP

... ]

The function of each form of the ACCEPT statement is toacquire data from a source external to the program and placeit in the receiving field specified by identifier-l,identif ier-2, or identifier-3 G The three formats differprimarily in the data source with which they are designed tointe-rface. The format 1 ACCEPT obtains date or timeinformation from the operating system clock. The other twoformats of the ACCEPT statement receive data keyed in by an._operator at the system console device. For format 2, thisdevice is assumed to be a teletype, a glass teletype, or aCRT terminal in scrolling mode. For format 3, it is assumedthat .the input device is a video terminal and that scrollingis not desired. Note that an ordinary CRT terminal issuitable as an input device fo.r either a format 2 or a format3 ACCEPT, although the effects on the appearance of thescreen will differ as indicated in the discussion below. Theeffects of the various WITH phrase options of the format 3ACCEPT statement are summarized in Section 4.8.3.3.

13

Page 20: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 = Amendment to Reference Manual

4.8.1

4.8 .. 2

FORMAT ~ ACCEPT STATEMENT

The Format 1 ACCEPT statement is not implemented in CromemcoCOBOL ..

FORMAT 2 ACCEPT STATEMENT

Format 2 of the ACCEPT statement is used to accept a stringof input. characters from a scrolling device such as ateletype or a CRT in scrolling mode.. When the ACCEPTstatement is executed,. input characters are read from theconsole device until a carriage return is encountered, then acarriage return/line feed pair is sent back to the console.The input data string is considered to consist of allcharacters keyed prior to (but not including) the carriagereturn.

For a Format 2 ACCEPT with an alphanumeric receiving field,the input data string is transferred to the r~ceiving fieldexactly as if it were being MOVEd from an alphanumeric fieldof length. equal to the number of characters in the string ..(That is; left justification, space filling, and righttruncation occur by default, and right justification and lefttruncation occur if the receiving field is described asJUSTIFIED RIGHT .. ) If the receiving field is alphanumeric­edited, it is treated as an alphanumeric field of equallength (as if each character in its PICTURE were "X ill ), sothat no insertion editing will occur.

For a Format 2 ACCEPT wi th a numeric or numeric-editedreceiving field, the input data string is subjected to avalidity test which depends on the PICTURE of the receivingfield.. (If the receiving field is described as COMP, itsPICTURE is treated as "59(5)" for purposes of thisdiscus.sion .. ) The digits 0 through 9 are considered validanywhere in the input data string.

The decimal point character (period or comma, depending onthe DECIMAL POINT IS clause of the CONFIGURATION SECTION)- isconsidered valid if~

1.. it occurs only once in the input data string,. and

2. if the PICTURE of the receiving field contains afractional digit position, that is, a "gill, "Z~, "*", orfloating insertion character which appears to the right

14

Page 21: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

(

5 •

6 •(

(

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

of either an' assumed decimal point ("V") or an actualdecimal point (".").

The operational sign characters "+" and "-" are consideredvalid only as the first or last character of the input stringand only if the PICTURE of the receiving field contains oneof the sign indicators "S", "+", It_", nCR", or "DB".

All other characters are considered invalid. If the inputdata string is invalid, the message

"INVALID NUMERIC INPUT --PLEASE RETYPE"is sent to the console, and another input data string isread.

When a valid input data string has been obtained, data istransferred to the receiving field exactly as if theinstruction being executed were a MOVE to the receiving fieldfrom a hypothetical source field with the followingcharactel:istics:

1. a PICTURE of the form S9 •••9V9 ••• 9

2. USAGE DISPLAY

3. a total length equal to the number of digits in theinput data string

4. as many digit positions to the right of the assumeddecimal point as there are digits to the right of theexplicit decimal point in\ the input data string (zero ifthere is no decimal point in the input data string)

current contents equal to the string of digits embeddedin the input data string

a separate sign with a current negative status if theinput da ta s~ring contains the character "_It, and acurrent positive status otherwise.

4 .. 8 .. 3 FORMAT ~ ACCEPT STATEMENT

Format 3 of the ACCEPT statement is used to accept data intoa field from a non-scrolling video terminal. The followingsyntax .rules must be observed· when the format 3 ACCEPT isused:

(

1. identifier-3 must reference a data item whose length isless than or equal to 1920 characters

15

Page 22: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

2" the options SPACE-FILL and ZERO=FILL may not both bespecified in the same ACCEPT statement

3" the options LEFT-JUSTIFY and RIGHT-JUSTIFY may not bothbe specified within the same ACCEPT statement

4.. if identifier-3 is described as a numeric-edited item,the UPDATE option must not be specified

5.. the TRAILING-SIGN option may be specified. only ifidentifier-3 is described as an elementary numeric dataitem.. If identifier-3 is described as unsigned, theTRAILING-SIGN option is ignored

6.. for alphanumeric or alphanumeric-edited identifier-3,the SPACE-FILL option is assumed if the ZERO-FILL optionis not specified, and the LEFT-JUSTIFY option is assumedif the RIGHT-JUSTIFY option is not specified7., for numeric or numeric-edited identifier-3, theZERO-FILL option is assumed if the SPACE-FILL option isnot specified.

4.S.3.1 nata Input Field

The position-spec and receJ.vl.ng field (identifier-3)specifications of the format 3 ACCEPT statement are used todefine the location and characteristics of a data input fieldon the screen of the console video terminal.

Location ~ ~ Data Input Field

The position-spec is of the form

(

[{ :} intege~-l]

integer-2,

em. [{ : } intege~-3]

integer-4)

The opening and closing parentheses and the comma separatingthe two major bracketed groups are required.. The position­spec specifies the position on the console CRT screen atwhich the data input field will begine LIN and COL are COBOLspecial registers. Each behaves like a numeric data - itemwith USAGE COMP, but they may be referenced by every COBOLprogram without being declared in the DATA DIVISION..

If LIN is specified, the data input field will begin on the

16

Page 23: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

(

(

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

screen row whose number is equal to the value of the LINspecial register, incremented (or decremented) by integer-lif "+ integer-I" (or "-integer-I") is specified. If integer­~ is specified, the data input field will begin on the rowwhose number is integer-2. If neither LIN nor integer-2 isspecified, the data input field will begin on the screen rowcontaining the current cursor position.

If COL is specified, the data input field will begin in thescreen column whose number is equal to the value of the COLspecial register, incremented (or decremented) by integer-3if "+ integer-3 (or "-integer-3") is specified. If integer-4is spe~ified, the data input field will begin in the screencol umn whose number is integer-4. If nei ther COL norinteger-4 is specified, the data input field will begin inthe screen column containing the current cursor position.

Characteristics At~ Data Input Field

The characteristics (other than position) of the data inputfield on the CRT screen are determined by the receivingfield's PICTURE specification (which is treated as 59(5) inthe case of an item whose USAGE is COMP). For alphanumericor alphanumeric-edited identifier-3, the data input field issimply a string of data input character positions starting atthe screen location specified by position-spec. The lengthof the data input field in character positions is equal tothe length of the receiving field in memory.

For numeric or numeric-edited identifier-3, the data inputfield may contain any or all of the following: integer digitpositions, fractional digit positions, sign position, decimalpoint position. There will be one digit position for each"9", "Z", "*", "P", or non-initial floating insertion SYmbol(a floating insertion symbol is a "+", "-", or "$" which isnot the last symbol in a PICTURE character string) in thePICTURE of identifier-3.. Each digit position in the datainput field is a fractional digi t posi tion if thecorresponding PICTURE character is to the right of an assumeddecimal point ("V" ) or actual decimal point .. (" • ") in thePICTURE of identifier-3. Otherwise it is an integerdigi tposition. There will be one sign position if identifier-3 isdescribed as signed, and no sign position otherwise. Therewill be one decimal point position if there is at least onefractional digi t position, and no decimal point positionotherwise ..

The data input posi tions which are defined will occupysuccessive character positions on the CRT screen beginningwith the position specified by position-spec. If' TRAILING~SIGN_ is specified in the ACCEPT statement, the data input

17

Page 24: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 = Amendment to Reference Manual

positions will be in the following sequenceg integer digitpositions (if any), decimal point position (if any),fractional digit positions (if any), sign position (if any)~

If TRAILING-SIGN is not specified, the data input positionswill be in the following sequence: sign position (if any),integer digit positions (if any), decimal point position (ifany), fractional digit positions (if any).,

4~8 .. 302 nata Input and Data Transfer

A character entered into the data input field by the terminaloperator may be treated either as an editing character or asa data character e The editing characters are line~delete,

forward-space, backspace, and rubout.. On most terminals,these characters may be entered as control-U, control=F,control-H, and DEL (or RUB) respectively., The action of theediting characters is described later in this section~ fornow, only data characters will be considered ..

Alphanumeric Receiving Field

Consiqer first the execution of the format 3 ACCEPT statementwith an alphanumeric or aiphanumeric=edited receiving field ..An alphanumeric-edited receiving' field is treated as analphanumeric field of the same length (as if every characterin its PICTURE were °X O

) .. Specifically, no insertion editingwill occur ..

The initial appearance of the data input field depends on thespecifications in the WITH phrase of the ACCEPT statement ..If UPDATE is specified, the current contents of identifier=3are displayed in the input field.. In this case all datainput positions will be treated as if they were keyed by theterminal operator. If UPDATE is not specified, but PROMPT isspecified, a period (o.n) is dispJ,ayed in each input datapositione If neither UPDATE nor PROMPT is specified, thedata input field is not changedc The cursor is placed in thefirst data input position, and characters are accepted asthey are keyed by the operator until a terminator character(normally carriage return) is encountered.. If AUTO-SKIP isspecified in the ACCEPT statement; the ACCEPT will also beterminated if the operator keys a character into the last(rightmost) data input position~

As each input character is received, it is echoed to the CRTscreen, except that non-displayable characters are echoed asO?O., If all positions of the data input field are filled,additional input is ignored until a terminator character orediting character (listed above) is encounteredc If RIGHT-

18

Page 25: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

(

(

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

JUSTIFY was specified in the ACCEPT statement, the operator­keyed characters are shifted to the rightmost positions ofthe data input field when the ACCEPT is terminated. Allunkeyed character positions are filled on termination1 thefill character is either space (if SPACE-FILL is in effect)or zero (if ZERO-FILL was specified).

The contents of the receiving field will be the same set ofcharacters as appear in the input field1 however, thejustification of operator-keyed characters will be controlledby the JUSTIFIED specification in the receiving field's datadescription, not by the RIGHT-or LEFT-JUSTIFY option of theACCEPT.. Excess positions of the receiving field will befilled with spaces or zeroes based on the SPACE-or ZERO-FILLspecification in the ACCEPT statement.

Numeric Recei'ving Field

Next, consider the execution of a format 3 ACCEPT statementwith a numeric or numeric-edited receiving field. Asdescribed above, the data input fieldon the console CRTscreen may contain integer digit positions, fractional digitpositions, or both. First assume that both are present1 theother cases will be treated as variations.

As with the alphanumeri~ ACCEPT, the data input field may beinitialized in a way determined by the WITH options specifiedin the ACCEPT statement. If UPDATE is specified (notpermitted for a numeric-edited receiving field), the integerand fractional parts of the data input field will be set tothe integer and fractional parts of the decimalrepresentation of the initial value of the receiving field,with leading and trailing zeroes included, if necessary, tofill all digit positions. Except for leading zeroes, theseinitialization characters are treated as operator-keyed data.If UPDATE is not specified, but PROMPT is specified, a zerowill be displayed in each input digit position. In either ofthese cases (UPDATE or PROMPT) a decimal point will bedisplayed at the decimal point position.

If neither UPDATE nor PROMPT is specified, the input field onthe screen will not be initialized, except for the signposition. The sign position is always initialized positiveexcept when UPDATE is specified, in which case it isinitialized according to the sign of the current contents ofthe receiving field. On most systems, a positive signposition is shown as a space, and a negative sign position isshown as a minus sign.

The cursor is initially placed in the rightmost integer digitposition, and characters. are accepted one at a time as they

19

Page 26: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 = Amendment to Reference Manual

are keyed by the operator. A received character may betreated in one of several ways. If the incoming character isa digit, previously keyed digits are shifted one position tothe left in the input field and the new digit is displayed inthe rightmost integer digit position.

If all integer digit positions have not been filled, thecursor remains on the rightmost digit position and anothercharacter is accepted. If the entire integer part of theinput field has been filled and AUTO-SKIP was specified, theinteger part is terminated and the cursor is moved to theleftmost fractional digit position. If the integer part hasbeen filled and AUTO-SKIP was not specified, the cursor ismoved to the decimal point position, and any further digitskeyed are ignored until the integer part is terminated with adecimal point.,

If the character entered is one of the sign characters "+" or"_W, the sign position is changed to a positive or negativestatus respectively. Cursor position is not affected.

If the character entered is a decimal point character, theinteger part is terminated and the cursor is moved to theleftmost fractional digit position.

If the character entered is a field terminator (normallycarriage-return), the ACCEPT is terminated and the cursor isturned off. Any other character is ignored ..

When the integer part is terminated, the cursor is placed inthe leftmost fractional digit position, and operator-keyedcharacters are again acceptede Digits are simply echoed tothe terminal. The sign characters "+" and 011=111 are treatedexactly as they were while integer part digits were beingentered. The field terminator character terminates theACCEPT., (If AUTO-SKIP is in effect, filling the entirefractional part also terminates the ACCEPT.,) Othercharacters are ignored" After all digit positions of thefractional part have been filled, further digits are alsoignored.

If no fractional digit positions are present, the decimalpoint is ignored as an input character, and entry of integerpart digits may be terminated only by terminating the entire

. ACCEPT. If no integer digit positions are present, thecursor is initially placed in the leftmost fractional digitposition and entry of the fractional part digits proceeds asdescribed above.

On termination of the format 3 ACCEPT of a numeric ornumeric-edited item, data is transferred to the receiving

20

Page 27: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

(

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

field. The exact form of the data in the receiving fieldafter execution of the ACCEPT is as described in the lastparagraph of the discussion of the format 2 ACCEPT, where therole of the ninput data stringn mentioned in that paragraphis taken by the string of characters displayed in the datainput field. After termination, if SPACE-FILL is in effect,leading zeroes in the integer part of the data input field(not in the receiving field) will be replaced by spaces, andthe leading operational sign, if present, will be moved tothe rightmost space thus created.

Editing Characters

The editing characters (line-delete, forward-space,backspace, and rubout) may be used to change data which hasalready been keyed (or supplied by the COBOL runtime systemas a result of a WITH UPDATE specification). Entering theline-delete character will cause the ACCEPT to be restartedand all data keyed by the operator or initially present inthe receiving field to be lost. The data input field on theconsole screen will be re-initialized if PROMPT is in effect.Otherwise, the data input field will be filled with spaces orzeroes according to the SPACE-FILL or ZERO-FILLspecification.

Typing the forward-space or backspace characters will movethe cursor forward or back one data input position in thecase of an alphanumeric or alphanumeric-edited receivingfield, or one digit pos; ti on in the case of a numeric ornumeric-edi ted receiving field. In no case, however, willthe forward-space or backspace characters move the cursoroutside the range of positions including (1) the positionsalready keyed by the operator (or filled by COBOL runtimesupport when WITH UPDATE is specified), and (2) the rightmostdata input position which the cursor has occupied during theexecution of this ACCEPT. If the cursor is moved to aposition of this range other than the rightmost, and a legaldata character is entered, it is displayed at the currentcursor position and the cursor is moved forward one dataposition (alphanumeric or alphanumeric-edited) or digitposition (numeric or numeric-edited).

Typing the rubout character effectively cancels the last datacharacter entered. The cursor is moved back one dataposition (digit position if the receiving field is numeric ornumeric-edited) and a fill character (space or zero) . isdisplayed under the cursor (except when the cursor is to theleft of the decimal point for a numeric ACCEPT. Then no fillcharacter is displayed and the cursor is not moved, but the

- digit at the cursor position is deleted and all digits. to theleft of it are shifted one position to the right.) The

21

Page 28: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 ~ Amendment to Reference Manual

rubout character has no effect unless the cursor is inposition to accept a new data character1 in other words, ithas no effect if backspace character (s) have been used tomove the cursor back over already keyed positions.

Three additional cursor movement keys present on the Cromemcomodel 3102 terminal keyboard may also be used to key editingcharacters. The CE (clear entry) key causes a line delete;the left arrow key causes a backspace; and the right arrowkey causes a forward-space"

408.3,,3 WITH Phrase Summary

The following list summarizes the effects of the WITH phrasespecifications for a format 3 ACCEPT with an alphanumeric oralphanumeric-edited receiving field:

1. SPACE-FILL causes unkeyed character pos~tions of thedata input field and the receiving field to be space"'"filled when the ACCEPT is terminated.

2. ZERO-FILL causes unkeyed character positions of the datainput field and the receiving field to be set to ASCIIzeroes when the ACCEPT is terminated"

3. LEFT-JUSTIFY is treated by this compiler as commentary"

4. RIGHT-JUSTIFY causes operator-keyed characters to occupythe rightmost positions of .the data input field afterthe ACCEPT is terminated. Note that the justificationof transferred data in the receiving field is controlledby the JUSTIFIED declaration or default of the receivingfield's data description, not by the WITH RIGHT-JUSTIFYphrase.

50 PROMPT causes the data input field on the screen to beset to all periods (it. it) before input characters areaccepted ..

6. UPDATE causes the data input field to be initializedwith the initial contents of the receiving field and theinitial data to be treated as operator-keyed data.

7. LENGTH-CHECK causes a field terminator character toignored unless every data input posi tion has beenfilled ..

8., AUTO-SKIP forces the ACCEPT to be terminated when alldata input positions have been filled" A terminator

22

Page 29: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

ch"aracter explicitly keyed has its usual effect.

9. BEEP causes an audible alarm to sound when the ACCEPT isinitialized and the system is ready to accept operatorinput.

The following list summarizes the effects of the WITH phrasespecifications for the format 3 ACCEPT with a numeric ornumeric-edited receiving field:

10 SPACE-FILL causes unkeyed digit positions of the datainput field (not of the receiving field) to the left ofthe (possibly implied) decimal point to be space-filledwhen the ACCEPT is termina ted and any leadingoperational sign to be displayed in· the rightmost spacethus created.

2. ZERO-FILL causes all unkeyed digit positions of the datainput field to be set to zero when the ACCEPT isterminated.

3. LEFT-JUSTIFY and RIGHT-JUSTIFY have no effect for anumeric or numeric-edited receiving field.

4. TRAILING-SIGN causes the operational sign to appear asthe rightmost position of the data input field.Ordinarily the sign is the leftmost position of thefield.

5 ..PROMPT causes the data input field positions to beini tialized as follows before input characters areaccepted: digi t posi tions to zero, decimal pointposition (if any) to the decimal point character, andsign position (if any) to space.

6.. UPDATE causes the data input field to be initialized tothe current contents of the receiving field and thisinitial data to be treated like operator-keyed data.

\.

7. LENGTH-CHECK causes a received decimal point characterto be ignored unless all integer digit positions havebeen keyed and a field terminator character to beignored unl-ess all digit positions have been keyed.

8. AUTO-SKIP causes the integer part of the ACCEPT to beterminated when all integer digit positions h.ave beenkeyed and the entire ACCEPT to be terminated when alldigit positions have been keyed.

9. BEEP causes an audible alarm to sound when the ACCEPT isinitialized and the system is ready to accept operator

23

Page 30: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 = Amendment to Reference Manual

input.,

Examples PsinS ~ ACCEPT Statement

The following pages contain examples illustrating theexecution of the ACCEPT statement"

Example 1:

Receiving Field::

as RS=DISCOUNT PIC X(8)"

Initial Contents::

ABCDEfGH

ACCEPT Statement: .ACCEPT (:11, 1) RS-DISCOUNT WITH PROMPT

At Start of ACCEPT:Q lID e «9 • Cl: 0 0

operator Enters N:Neeoo.sCl)

Operator Enters ONE:NONE.:,,, ....

operator Enters Carriage Return:

NONElzSJ6JzS16

Set=upprior to executing

Executing­the ACCEPT

Final Contentsof Receiving Field:

NONElzSlDl61z$

Re.fJult

24

Page 31: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

Example 2:

Receiving Field:10 VEND-NAME PIC X(12).

Initial Contents:

ACME16WIDGETS

ACCEPT Statement:ACCEPT (1, 1) VEND-NAME

WITH PROMPT UPDATE.

At Start of ACCEPT:

ACME16WIDGETS(If operator enters carriagereturn here, the receivingfield will not be changed.)

Set-upprior to-- executing

Operator Enters Line-delete:• 0 • e G e. • e _ • • •-

Operator Enters XYZ:XYZGII ••• C1C ••

4

Executing __ __the ACCEPT

Operator Enters Carriage Return:

XYZlzSJzStlSJzS161DlrS16lzS

Final Contentsof Receiving Field:

XYZlzSlz$lzSlz$16lzSlrSlz$JzS

(

-- .....L ...L- _

25

Page 32: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 = Amendment to Reference Manual

Example 3:

Receiving Field:as CREDIT PIC S9(4)V99"

Initial Contents:+

111111

ACCEPT Seatement :.

ACCEPT (LIN + 4~ COL - 3) eRE»ITWITH PROMPT TRAILING-SIGN ..

At Start of ACCEPT:- - .

OOOQ"OOJD

operator Enters 8:

lJOO~"alJ1zS

operator Enters 7:

0081, 0 0016

Operator Enters =:

0087.,aO~

Operat.or Enters 6:087!,,!J(J-

Ot)erator Enters N:..aa7!"QO=

Operator Enters G :

0876 .. Q!I=

Ocerator Enters 5:

0876oSg-

Ooerator Enters Carriage Return:

Final Contentsof Receiving Field:

Q!76"Sa

\

a

Set-upprior to executing

Executingthe ACCEPT

-- --_..- -""-, -_.__._,.----" --

Result .. --.------.

.... -.- ----------------~_ _== =""__ ~ .."J...... ._

26

Page 33: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

J DISPLAY STATEMENT·

The DISPLAY statement provides the capability of outputtinglow-volume data at runtime without the complexities of filedefinition. The format of "the DISPLAY statement is:

{ {identifier}}

PISPLAY [position-spec] literal .00 [UPON mnemonic-name]ERASE

The DISPLAY statement must be coded in accordance wi th thefollowing rules:

1.. identifier must reference a data item whose 'length isless than or equal to 1920 characters

2. mnemonic-name must be defined in the PRINTER IS clauseof the SPECIAL-NAMES paragraph of the CONFIGURATIONSECTION

The DISPLAY statement will cause output to be sent to thesystem console device unless UPON mnemonic-name is specified,in which case output will be sent to the printer. Eachdisplay-item (that is, each occurrence of identifier,literal, or ERASE) will be processed in turn as described inthe paragraphs below; then, if no position-spec is coded inthe enti re DISPLAY statement, a carriage return/line-feedpair will be sent to the receiving device.

4 .. 9.1 Position-spec

For· each display-item, if position-spec is specified, thecursor is positioned prior to the transfer of data for thisitem. position-spec is of the form:

The position-spec is of the form

I.LIN. [{ : } integer-lJ COL. [ { : } integer-~J

( , )integer-2 integer-4

The opening and closing parentheses and the comma separatingthe two major bracketed groups are required. The position­spec specifies the position on the console CRT screen atwhich the cursor will be placed. LIN and COL are COBOL

27

Page 34: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 ~ Amendment to Reference Manual

special registers. Each behaves like a numeric data itemwith USAGE COMP, but they may be referenced by every COBOLprogram without being declared in the DATA DIVISION&

If LIN is specified, the cursor will be placed on the s,creenrow whose number is equal to the value of the LIN specialregister, incremented (or decremented) by integer~l if 1Il+integer~l n (or ft-integer-l II) is specified., If integer=2 isspecified, the cursor will be placed on the row whose numberis integer-2., If neither LIN nor integer=2 is specified, thecursor will be placed on the screen row containing thecurrent cursor position.

If COL is specified, the cursor will be placed in the screencolumn whose number is equal to the value of the COL specialregister, incremented (or decremented) by integer-3 if 1Il+integer-3 n (or "-integer-3") is specified., If integer-4 is

'specified, the cursor will be placed in the screen columnwhose number is integer-4. If neither COL nor integer=4 isspecified, the cursor will be placed in the screen columncontaining the current cursor position.

Identifier, Literal, and ERASE

If identifier or literal is specified for a given display­item, the contents of identifier or the value of literal aresent to the receiving device. Since the data transfer occurswithout· conversion or reformatting, it is recommended that"numeric data be moved to numeric-edited fields for purposesof DISPLAY.,

If ERASE is specified and if position-spec is coded for thisor a previous display-i tem, the console screen will ..becleared from the current cursor position to the end of thescreen. The initial cursor position for the next display­item will be that specified by the position-spec coded in, theERASE display-item, if present, or the position in which thecursor was left by the previous display-item. If ERASE isspecified and no position-spec has been encountered up tothis point in the DISPLAY statement, no action will be taken.,

28

Page 35: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

16 WRITE STATEMENT (Sequential I-D)

The general format of a WRITE statement is:

WRITE record-name [FROM data-name-l]

[{ AFTER } ADVANCING { operand LINE (5) }]BEFORE PAGE

[AT { END-OF-PAGE } imperative-statement ]mE.

Ignoring the ADVANCING option for the moment, we proceed toexplain the main functions of the WRITE statement.

In COBOL, file output is achieved by execution of the WRITEstatement. Depending on the device assigned, \ "written"output may take the form of printed matter or magneticrecording on a floppy disk storage· medium. The user isreminded also that you READ file-name, but you WRITE record­name. The associated file must be open -in the OUTPUT mode attime of execution of a WRITE statement.

Record-name must be one of the -level 01 records defined foran output file, and may be qualified by the filename. The'execution of the WRITE statement releases the logical recordto the file and updat.es its FILE STATUS item, if one isspecified.

If the data to be output has been developed in Working­Storage or in another area (for example, in an input file'srecord area) , the FROM suffix permits the user to stipulatethat the designated data· (data-name-l) is to be copied intothe record-name area and then output from there. Record-nameand data-name-l must refer to separate storage areas ..

When an attempt is made to write beyond the externallydefined boundaries of a sequential file, a Declarativeprocedure will be executed (if available) and the FILE STATUS-(if available) will indicate a boundary violation. Ifneither is available, a runtime error occurs.

The ADVANCING option is restricted to line printer outputfiles, and permits the programmer to control the line spacingon the paper in the printer., Operand is either an unsignedinteger literal or data-name; values from 0 to 120 arepermitted:

29

Page 36: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 = Amendment to Reference Manual

Integer

o123e

o

Carriage Control Action

No spacingNormal single spacingDouble spacingTriple spacing

..

Single spacing (i.e., "after advancing 1 linen) is assumed ifthere is no BEFORE or AFTER option in the WRITE statemente

Use of the key word AFTER implies that the carriage controlaction precedes printing a line, whereas use of BEFOREimplies that writing precedes the carriage control actic)fieIf PAG~ is specified, the data is printed BEFORE or AFTER theprinter is repositioned to the next physical page.. However,if a LINAGE clause is associated with the file, therepositioning is to the first line that can be written on thenext logical page as specified in the LINAGE clause ..

If the END-Or-PAGE phrase is specified, the LINAGE clausemust be specified in the file description entry for theassociated file.. BOP is equivalent to END-OF-PAGE ..

An end-of-page condi tion is reached whenever a WRITEstatement with the END=OF=PAGE phrase causes printing orspacing within the footing area of a page body.. This occurswhen such a WRITE statement causes the LINAGE-COUNTER toequal or exceed the value specified by the FOOTING value, ifspecifiedo In this case, after the WRITE statement isexecuted, the imperative statement in the END-OF-PAGE phraseis executedo

A "'page overflow" condi tion is reached whenever a WRITEstatement cannot be fully accommodated within the currentpage body. This occurs when a WRITE statement would causethe LINAGE-COUNTER to exceed the value specified as the sizeof the page body in the LINAGE clause. In this case, therecord is printed before or after (depending on the· phraseused) the printer is repositioned to the first line of thenext logical page.. The imperative statement in the END=OF~

PAGE clause, if specified, is executed after the record iswritten and the printer has been repositioned ..

Clearly, if no FOOTING value is specified in the LINAGE .clause, or if the end=of-page and overflow conditions occursimultaneously, then only the overflow condition iseffective.,

30

Page 37: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

(

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

.8 REWRITE STATEMENT (Sequential I-O) --clarification-­

Execution of REWRITE replaces the record that was accessed.bythe most recent READ statement, which must have beencompleted successfullyc If the record which is rewriting therecord in the file is longer than the file's record, only asmany bytes as will fit are actually rewrittenc On the otherhand, if the record which is rewriting the record in the fileis shorter than the file's record, unpredictable informationwill be written after the record, until the beginning of thenext record in the filec

4 .. 22 DYNAMIC DEBUGGING STATEMENTS

Another debugging feature may be r-equired in order to revealcritical data values at specifically designated points in theprocedure. The EXHIBIT statement provides this facility.

The statement form

{ {identifier }}

EXHIBIT NAMED [position-spec]. literal.· •••ERASE

[UPON mnemonic-name]

produces a display of values of the indicated literal, ordata items in the format data-name =value. For more detailsconcerning the position-spec syntax, see the DISPLAYstatement.

RECORD ~ CLAUSE --clarification--

The general format of this clause, which is required in theSELECT entry for the file, is:

RECORD KEY IS data-name-l

wher e da ta-name-l is an item def ined within the recorddescriptions of the associated file description, and is agroup -item or an elementary alphanumeric item. The maximumkey length is 60 bytes and the key should never be made tocontain all nulls.

If random access mode is specified, the value of data-name-ldesignates the record to be accessed by the next DELETE,READ, REWRITE or WRITE statement. Each record must have a

31

Page 38: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

unique record key value.

7.2.2 File Status Reporttng ==clarification==

Attempting to continue adding records to a file once the"Disk Space Full" situation occurs can lead to undesiredresults.. Therefore, the program should not ignore a filestatus of '24'.,

8 .. 1 Definition ~ REtATIVE File Organization -=clarification==

COBOL marks deleted records and records that have .. not yetbeen written by the p.rogram by inserting a value of 0 (binary00000000) into the first byte of the record.. Consequently,the first field of a record should not be a COMPUTATIONAL orCOMPUTATIONAL-3 item.,

32

Page 39: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

APPENDIX V

Reserved Words

+ - additional words required by COBOLfor interactive screens, Debug extensions,and packed decimal format

ACCEPTACCESSADDADVANCINGAFTERALLALPHABETICALSOALTERALTERNATEANDAREAREA(S)ASCENDING

+ASCIIASSIGNATAUTHOR

+AUTO-SKIP

+BEEPBEFOREBLANKBLOCKBOTTOMBY

CALLCANCELCDCFCHCHARACTER(S)CLOCK-UNITSCLOSECOBOLCODECODE-SET

+COLCOLLATINGCOLUMNCOMMACOMMUNICATIONCOMPCOMPUTATIONAL

33

+COMPUTATIONAL-3+COMP-3

COMPUTECONFIGURATIONCONTAINSCONTROL(S)COpyCORR(ESPONDING)COUNTCURRENCY

DATADATEDATE-COMPILEDDATE-WRITTENDAYDEBUGGINGDEBUG-CONTENTSDEBUG-ITEMDEBUG-LINEDEBUG-NAMEDEBUG-SUB-lDEBUG-SUB-2DEBUG-SUB-3DECIMAL-POINTDECLARATIVESDELETEDELIMITEDDELIMITERDEPENDINGDESCENDINGDESTINATIONDE (TAIL)DISABLE

+DISKDISPLAYDIVIDEDIVISIONDOWN .DUPLICATESDYNAMIC

EGIELSEEMI

Page 40: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

ENABLE JUST (IFIED)ENDEND-OF-PAGE KEYENTERENVIRONMENT LABELEOP LASTEQUAL LEADING

+ERASE LEFTERROR +LEFT-JUSTIFYESI LENGTHEVERY +LENGTH-CHECKEXCEPTION LESS

+EXHIBIT LIMIT{S)EXIT" +LINEXTEND LINAGE

LINAGE-COUNTERFD LINE(S)FILE LINE-COUNTERFILE CONTROL LINKAGE

+FILE-ID LOCKFILLER LOW-VALUE(S)FINALFIRST ME;MORYFOOTING MERGEFOR MESSAGEFROM MODE

MODULESGENERATE MOVEGIVING MULTIPLEGO MULTIPLYGREATERGROUP +NAMES

NATIVEHEADING NEGATIVEHIGH-VALUE{S) NEXT

NOIDENTIFICATION NOTIF NUMBERIN NUMERICINDEXINDEXED OBJECT-COMPUTERINITIAL OCCURSINITIATE OFINPUT OFFINPUT-OUTPUT OMITTEDINSPECT ONINSTALLATION OPENINTO OPTIONALINVALID ORIS ORGANIZATION1=0 OUTPUTI-O-CONTROL OVERFLOW

34

Page 41: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 - Amendment to Reference Manual

PAGEPAGE-COUNTERPERFORMPFPHPIC (TURE)PLUSPOINTERPOSITIONPOSITIVE

+PRINTERPRINTINGPROCEDURE(S)PROCEEDPROGRAMPROGRAM=ID

+PROMPT

QUEUEQUOTE(S)

RANDOMRDREAD

+READYRECEIVERECORD(S)REDEFINESREELREFERENCESRELATIVERELEASEREMAINDERREMOVALRENAMESREPLACINGREPORT(S)

. REPORTINGRERUNRESERVERESETRETURNREVERSEDREWINDREWRITERFRHRIGHT

+RIGHT-JUSTIFYROUNDRUN

35

SAMESDSEARCHSECTIONSECURITYSEGMENTSEGMENT-LIMITSELECTSENDSENTENCESEPARATESEQUENCESEQUENTIALSETSIGNSIZESORTSORT~MERGE

SOURCESOURCE-COMPUTERSPACE(S)

+SPACE-FILLSPECIAL-NAMESSTANDARDSTANDARD-lSTARTSTATUSSTOPSTRINGSUB-QUEUE-l,2,3SUBTRACTSUMSUPPRESSSYMBOLICSYNC (HRONIZED)

TABLETALLYINGTAPETERMINALTERMINATETEXTTHANTHROUGHTHRUTIMETIMESTOTOP

+TRACETRAILING

Page 42: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 3 = Amendment to Reference Manual

+TRAILING-SIGNTYPE

UNITUNSTRINGUNTILUP

+UPDATEUPONUSAGEUSEUSING

VALUE(S)VARYING

36

WHENWITHWORDSWORKING~STORAGE

WRITE

ZERO ( (E) S)+ZERO=FILL

+

*I**<>

Page 43: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

(

CROMEMCO COBOL MANUAL ADDENDUMSECTION 4 - Amendment to User's Guide

SECTION 4

Amendment to User's Guide

This section contains descriptions of changes and additionsto the COBOL User's Guide portion of the Cromemco COBOLInstruction Manual.

1.2 Output Listings and Error Messages

Regardless of whether there is a list device, or what thelist device may be physically, a message displaying the totalnumber of errors and warnings is displayed on the user'sconsole at the end of compilation. This allows a user tomake a change to a COBOL program, recompile it without alisting and still learn whether any errors occurred duringcompilation.

There are two error messages that are displayed on the user'sconsole to advise the user that the compiler cannot continue.One is "?Out of Memoryn which occurs when there isinsufficient memory for all the SYmbols and other informationthe compiler obtains from the source program. This message·should appear only infrequently with the new memory usagemechanism present in this version of COBOL. When it doesoccur, it indicates that the program is too large and must bedecreased in size. Data Divison lines require about 14 bytesof memory each during compilation, and Procedure Divisionlines require 3 1/4 bytes, so shrinking the size of the DataDivision will have more of an effect than shrinking the sizeof the Procedure Division.

Currently, Cromemco COBOL uses a minimum of about 3lK bytesof memory, with 14 bytes for each Data Division line, and 31/4 bytes fQr each Procedure Division line. The memoryrequired by CDOS varies according to the number of diskdrives declared during the execution of the program CDOSGEN,so another method to use when attempting to compile verylarge programs is to use a minimumly configured CDOS.

The other error message is "?Compiler Error", which indicatesthat the compiler has become confused and cannot continue.In this case, the user may sometimes determine the cause bycompiling increasingly larger chunks of his program, startingwith only a few lines, until the error recurs.

There are several errors that the compiler cannot detect andwhich will cause it to behave incorrectly. The compiler mustrecognize both the nDATA DIVISIONn and "PROCEDURE DIVISION"lines in a program in order to bring the correct COBOL

37

Page 44: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 4 ~ Amendment to User's Guide

overlay ~n from disk and continue the compile.. COBOL willnot recognize ei ther of these lines if any words aremispelled, if hyphens are inserted between the words, or ifthe line is declared to be a comment by the presence of a n*nor a. ,,/n in column 7. A missing "DATA DIVISION"' usuallyyields the "DISK FULL" error message, and a missing"PROCEDURE DIVISION" usually yields the "?Compiler Error n

message, although it is possible that the compiler willfinish the compile, without creating the relocatabl'e objectfile .. '

2.2 LINK Switcbes

N

P and D

Specifying <filename>/N will cause the linkedprogram to be saved on disk when a /E or a /G isentered. <filename> will be the name assigned tothe program" with a default extension of .COM whenno extension is specified. A jump to the start ofthe program is inserted if the program's programarea is loaded starting at a location other than100 hex ..

/P and /D allow the program and data origins to beset for the next program loaded., IP and ID takeeffect when entered and they have no effect onprogram modules already loaded.. The form is/P:I <address> and /0: <address>, where <address> isthe desired origin in the current typeout radix"(The default radix is hexo /0 sets the radix tooctal: /H sets the radix to hexo) LINK defaults to/pg <link origin>, + 3 (103 hex) to leave room forthe jump to the start of the program! s programarea.

Do not use /p or /0 to load programs or data intolocations 100 hex to 102 hex, which is where LINKinserts the jump to the start of the prog'ram'sprogram area, unless the start of the program areais loaded there. LINK will not generate and insertthe jump instruction if these locations are used.

If no ID is entered, data areas are loaded beforeprogram areas for each module. If a ID is entered,all data and Common areas are loaded starting atthe data origin and the program area at the programorigin. .

38

Page 45: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 4 - Amendment to User's Guide

Example:

/D:400,EXAMPL400 480200 280

*/P:200,EXAMPLData 200*/R*/P:200DataProgram

300

203 Format ~ LINK Compatible Object Files

LINK now recognizes two additional special items.

Type 3 requests a search of the library file named in the B"field. LINK performs the search only when unresolvedexternal references remain at the time the user instructsLINK to exit to coos. A type 3 item has only a B field.

Type 9 is external + offset. This type has only an A field.The value for type 9 will be added to the two bytes startingat-the current location counter. This addition is done aftera /E or /G is entered, so unless undefined SYmbols remain,the effect is external + offset.

This type can also be used to add program and data relativesor almost any other combination of relocation types.

204 LINK Error Message$

,."

tOut of Memory

?<file> Not Found

The program being loaded will notfit into the available memory.

Link cannot find a file named <file>on the specified disk. The COBOLlibrary file, COBLIB.REL, contains arequest to search another libraryfile called CRTDRV.REL if there areunresolved external references atthe time the user instructs LINK toexit to CDOS. This will cause LINKto display the message n?CRTDRV NotFoundn whenever a COBOL user forgetsto include the name of a CALLedsubprogram in his LINK commandstring.

39

Page 46: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 4 = Amendment to User's Guide

%Overlaying [Program] Area[Data ]

A /D Qr /p will cause previouslyloaded da ta or program to bedestroyed"

?Intersecting [Program] Area[Data ]

The program and data area intersectand an address or external chainentry is in this intersection" Thefinal value cannot be converted to acurrent value since it is in thearea intersectionw

?Start Symbol -<name> -Undefined

After a /Eg or /G: is entered, thesymbol specified was not definedo

Origin [Above] Loader Memory, Move Anyway (Y or N)?[Below]

After a /E or /G was entered, eitherthe data or program area has anorigin or top which lies outsideloader memory (i.,e., loader originto top of memory) <> If a Y <cr> isentered, LINK will move the area andcontinueo If anything else isentered, LINK will exit" In eithercase, if a /N had already beenentered, the program image will havealready been saved on disk.

?Can't Save Object File

Available disk· was exhausted, or adisk error occurred when LINK wasattempting to save the program"

2.6 Separating nata .and Program Areas

By default, LINK loads the data area first in memory,followed immediately by the program area. The user may useswitches /D and /P to set the beginning "addresses of the dataand program areas, with the following considerations.

When linking FORTRAN subprograms, one should be aware that

40

Page 47: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

c

CROMEMCO COBOL MANUAL ADDENDUMSECTION 4 - Amendment to User's Guide

the disk driver module in the FORLIB relocatable library filehas declared an ENTRY global symbol called $MEMRY in order toobtain from LINK ~ pointer to the first available bytefollowing a program's data area. When LINK finds this symbolin the module being loaded, it loads into it the address ofthe top of the data area + 1.

In the default case, where neither /D nor /p has been used,the program area is considered part of the data area, andLINK loads the two-part data area (data and program), thensets $MEMRY to point to the top of the two-part data area +1 ..

..• When either /D or /p has been used to separate the two areas,$MEMRY will be set to point to the top of the data area + 1.

Thus, when /D is used to load the data area below the programarea, the user must be certain that there is enough memorybetween the top of the data and the bottom of the programarea. Otherwise the program area will be overwritten and theprogram destroyed at runtime.

The FORTRAN disk driver· module uses $MEMRY to allocate diskbuffers (128 decimal bytes each) and FeB's (33 decimal byteseach). These follow the address pointed to by $MEMRY (top ofdata area + 1), so the user must have an idea of their totallength in order to start the program area above their endingaddress.

DiSk File Handling

The format of regular SEQUENTIAL organization files is thateach record in the file is preceded by a two-byte count ofthe number of bytes in that record. The format of the LINESEQUENTIAL organization is that each record ~n the file isfollowed by a carriage return, line feed delimiter. Bothorganizations pad any remaining space of the last physicalbl.ock with Control-Z characters, indicating end-of-file.. Tomake most efficient use of disk space, records are packedtogether with no unnecessary bytes in between.. .The number ofbytes written to disk is the number contained within the 01level record identifier used in the WRITE statement, not thenumber of bytes within the 01 level record identifier of thelargest record declared under the FD level of.that-file.

41

Page 48: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ·ADDENDUMSECTION 4 - Amendment to User's Guide

3 .. 3 Runtime Errors

Open files are not closed when a runtime error causes programtermination. Therefore, the user should handle errors withinhis program by use of the INVALID KEY clause, the FILE STATUSitem, or a DECLARATIVES procedure.. COBOL will terminate anyprogram encountering a disk 1-0 error if none of thesefacilities are used ..

One runtime error has been added:

NO CRT DRIVER An ACCEPT or DISPLAY statement using cursorpositioning is being executed, but no CRTdriver was loaded with the program at Linktime ..

3.4 Subprogram Calling Mechanism

It is possible for a COBOL program to call COBOL SUbprogramsor to call FORTRAN or Assembler subroutines.. It is notcurrently possible for a FORTRAN or Assembler program to calla COBOL subroutine" Therefore, this section pertains toCOBOL programs which call FORTRAN or Assembler subroutines ..The <:alling sequence is identical to that of CromemcoFORTRAN ..

The COBOL interpreter transfers execution to a subroutine bymeans of an Z80 CALL instruction.. The subroutine shouldreturn via the normal Z80 RET instruction, or the FORTRANRETURN statement.

Parameters are passed by reference ~ the address of the loW'byte of the parameter is what is passed, not the parameteritself. The method of passing these addresses depends on thenumber of parameters. If the number of addresses is lessthan or equal to 3, they are passed in the registers:

parameter 1 in HLparameter 2 in DEparameter 3 in BC.

If the number of parameters is greater than 3, then HLcontains the address of parameter 1, DE contains the addressof- parameter 2, and BC contains the address of a contiguousblock of memory which holds the list of parameter addressese

The subroutine can expect only as many parameters -as arepassed, and the calling program is responsible for passingthe correct number of parameters. Neither the compiler notthe runtime system checks that the correct number ofpara.meters is passed. The programmer must check that the

42

Page 49: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 4 - Amendment to Userls Guide

type and length of all arguments' passed from the callingprogram are acceptable to the called subroutine. Note thatthe only type of data that is sbored in the same format inCOBOL and FORTRAN is alphanumeric data. None of the numerictypes of data are interchangeable.

The stack space used by the COBOL program is contained withinthe program, so Assembler programs that use the stack mustnot overflow the stack space. The most certain way to assuresafety is to save the COBOL stack pointer upon entering theAssembler routine and to set the stack pointer to anotherstack area. The Assembler routine would execute, then loadthe saved value into the stack pointer just prior to theexecution of the RET instruction to return to the COBOLprogram.,

To call a subprogram, use the name of the subprogram in theCOBOL CALL statement, then link the relocatable object codemodules together using Link., For example, suppose theAssembler routine SCAN is called from the COBOL programFINDTEXT. The COBOL program is compiled and the assemblerroutine is assembled, then the resulting relocatable codemodules are linked by Link:

AL LINK FINDTEXT,SCAN,FINDTEXT!N!E

43

Page 50: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 4 ~ Amendment to User 8 s Guide

44

Page 51: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 5 = A Sample Program

oECTION 5

A Sample Program

The following is a compiler listing of a sample program thatillustrates some of the features of the new interactiveACCEPT and DISPLAY verbs.

CROMEMCO COBOL-SO V3.01 •• ACPTSMPLCOB PAGE 1

PIC X(20) •PIC S9999V999.PIC X.PIC 9 COMP VALUE O.VALUE 1.

( .

I.

1234567S9

1011121314151617IS1920212223242526272S293031323334

IDENTIFICATION DIVISION.PROGRAM-ID. ACCEPT=SAMPLE

THIS PROGRAM ILLUSTRATES A FEW OF THEINTERACTIVE ACCEPT AND DISPLAY FEATURESAVAILABLE IN COBOL.

AUTHOR. CROMEMCO, INC.ENVIRONMENT DIVISION.DATA DIVISION.WORKING-STORAGE SECTION.77 ALPHA-NUM-FIELD77 NOM-FIELD77 DONT-CARE77 FALSE

8S TRUEPROCEDURE DIVISION.START-P ..

PERFORM DEMONSTRATE UNTIL TRUE.STOP RUN ..

DEMONSTRATE.DISPLAY (1, 1) ERASE.DISPLAY (3, 5) 'ENTER ALPHANUMERIC DATA: 'DISPLAY (8, 5) 'UPDATE THE EXISTING DATA: •DISPLAY (13, 5) 'ENTER NUMERIC DATA: •DISPLAY (18, 5) 'NOW UPDATE THIS DATA: •ACCEPT (3, 31) ALPHA-NOM-FIELD WITH PROMPT.ACCEPT (8, 31) ALPHA-NOM-FIELD WITH PROMPT

UPDATE.ACCEPT (13, 31) NOM-FIELD WITH PROMPT

TRAILING-SIGN.ACCEPT (IS, 31) NOM-FIELD WITH PROMPT

TRAILING-SIGNUPDATE ..

DISPLAY (24,40) 'PRESS <CR> TO REPEAT '.ACCEPT (24, 61) DONT-CARE.

CoThis program has been compiled and linked, and the executableobject program is contained in a file on the distributiondiskette for experimentation. Note that the numeric field is

45

Page 52: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 5 = A Sample Program

specified to contain a sign, so one may use the "+n and w=nkeys when entering data into this field to indicate that thedata is positive or negativeo

46

Page 53: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

\.

(

CROMEMCO COBOL MANUAL ADDENDUMSECTION 6 - Using Non-Cromemco Terminals

. SECTION 6

Using Non-Cromemco Terminals

The COBOL runtime library, COBLIB.REL contains a terminaldriver module to enable the use of the interactive ACCEPT andDISPLAY functions. This driver module contains several shortroutines-written to drive Cromemco terminals, models 3101 and3102. This section describes how to write a terminal drivermodule for those users wishing'to use the interactive ACCEPTand DISPLAY wi th terminals requi ring control charactersequences that are not compatible with the Cromemco terminalsequences.

A CRT module should be written in a'ssembly language andassembled wi th the Cromemco Macro Assembler. The modulecontains 9 entry points that must be declared as globallabels using the Assembler ENTRY statement.

Three of the entry points refer to locations that containdata describing the terminal and keyboard. $CRLEN refers toa byte that contains the number of lines on the terminal, and$CRWID contains.the number of columns. $CLIST is a sequenceof bytes that def inekeyboard codes that invoke tne functi..ons .of ACCEPT. Note that these codes are not sent to theterminal to perform the function, they merely declare thekeys that will be recognized by the ACCEPT logic. The drivercontained in COBLIB uses a 'standard' list whose codes can beseen in the listing of the driver example. The keys thatnormally return the codes are parenthesized in the followinglist. The codes must be listed in the following order:

1. Line delete key (control-U, and CE on the3102)

2. Character delete key (DELETE or RUBOUT)3. Forward space key (control-F, and right arrow

on the 3102)4. Backspace key (control-H, and left arrow

on the 3102)5. Plus sign key ( +)6. Minus sign key ( -)

The list is terminated by a byte containing the value zero.

The r~maining entry points are subroutines that performterminal functions by sending codes to the terminal. Eachcode is sent by calling the external routine $OUTCH with thevalue in the A register. SOUTCH preserves the values inregisters HL and DE. $SETCR moves the cursor to a specific

47

Page 54: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 6 - Using Non=Cromemco Terminals

position on the screen. Upon entry, register H contains thespecif ied row (line) number and register L contains thecolumn number. Note that COBOL considers the top line of thescreen to be row I and the leftmost column to be column Ie$CURBK moves the cursor to the left one position withoutdisturbing the displayed character at that positiono Mostterminals honor the ASCII backspace code to perform thisfunctione $ALARM sounds the terminal's audible tone or bell ..Most terminals honor the ASCII bell code to pe,r:form this

. ',' function. $CUROF and $CURON instruct the terminal to inhibit'or enable di splayof the' cursor.. Many terminals do notprovide this facility however, and a simple RET instructionis appropriate for drivers of those terminals.. Last, $ERASEclears that portion of the screen from the current cursorposition to the end. The cursor must be left in its originalposi tion. Upon entry, register HL contains the currentcursor position in sequential format ea number between landn, where n· is screen width times length).. Some terminals donot provide an escape sequence to perform this funtion.. Forthose terminals, the driver must send enough blanks to clearthe screen then return the cursor to its original position ..

The following listing provides an example of a CRT drivermodule for a non=Cromemco terminal., This driver would beassembled to produce a relocatable object code file which islinkgd wi th the relocatable file created by the COBOLcompiler.. The sequence of Link instructions would then beg

" A.... Link <program> ,USERDRVR, <program>/n/e

48

Page 55: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 6 - Using Non~Cromemco Terminals

Page 0001

;SENO SEPARATOR

;SENO ESC-[

;SENO LINE

;24 LINES;80 COLUMNS

;KEYBOARD CHARACTER; DEFINITIONS;LINE DELETE (AU); CHAR DELETE;FORWARD SPACE;BACK SPACE;PLUS SIGN;MlNUS SIGN;ENO OF LIST

2480

SETaPA,HSEND2A I. I, ,$OOTCH

$OUTCH

015H07FH06H08H02BH020Ha

$CRWIo,$CRLEN,$CURON,$COROF,$CURBK$SETCR,$ERASE,$ALARM,$CLIST

01BH08H07H

CALLLDCALLt.oCALL

SET CORSOR POSITION[HI • ROW NUMBER[Ll ... COLUMN NUMBER

EXT

TERMINAL SCREEN DIMENSIONS

DEFBoEFBDEFSoEFBDEFSDErBDEFB

ENTRYENTRY

TERMINAL CHARACTER DEFINITIONS

·,

·,$SETCR:

;;******************************************************

;$CRLEN: DErB$CawIo: DErB

;*********..*******************..**********...***********..

;ESCAPE: EQOBSPACE: EQUBELL: EQO$CLIST:

.*****..****************..***..************..**..*......**..****I

·I.***..***************************************......********,

·,.******************************************************,

.******************************************************,

(OOlB)(0008)(0007)

0009' CD4EOO'OOOC' 7C0000' C05800'0010' 3E3S0012' CoOOOO#

0007' 180008' 50

0000' 150001' 7F0002' 060003' 080004' 2B0005' 200006' 00

CROMEMCO Z80 Macro Assembler version 03.05 Dec 28, 1979 10:20:00OSERDRVR - CRT DRIVER FOR ANSI STANDARD TERMINAL

00020003000400050006000700080009001000110012-0013001400150016001700180019002000210022002300240025002600270028002900300031.00320033003400350036'0037003800390040004100420043004400450046004700480049

(

(

49

Page 56: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 6 - Using Non-Cromemco Terminals

CROMEMCO Z80 Macro Assembler version 03.05 Dec 28, 1979 10:20:00tlSERDRVR - CRT DRIVER FOR ANSI STANDARD TERMINAL

Paqe 0002

35ft MODE

;SEND ESC-[

;SEND >3MOO! NUMBER 5

;SEND J

; SEND COLOMN

;SEND ESC-[

; BACKSPACE

SETUPA, '0'$OOTCBA, '.1'$OOTCH

A, BSPACE$OOTCS

A,tSEND2A,' f'$OtrI'CB

A, vb'AFSETUPA, I>'$OOTCSA,' 5'$OOTCHAF$OOTCS

CURSOR ON/OFF

LDJP

LD.1P

toCALLtDJP

$COROF:

; ERASE '1'0 END OF SCREEN[SLI • SEQOENTIAL CURSOR POSITION

·,$ERASE:

LDCtJRSW: P05H

CALL1.DCALLLDCALLpop'lP

·•

·•$COR-ON:

;;******************************************************

; BACKSPACE CORSOR·•;******************************************************

;******************************************************;

00510052005300540055005600510058005900600061006200630064006500660061006800690070007100120073

it 0074007500160011001800790080008100820083008400850086008700880089009000910092009300940095009600970098

003<:' CD4EOO'0031" 3E300041' COOOOOI0044' 3E4A0046' C300001

0023' 311:6C0025' CJ2AOO'

0028' 3E68002A1 FS002S' CDUOO'002E' 3E3E0030' CDOOOOI0033' 3E350035 1 COOOOOI0038' n0039' C300001

0015' 7Il0016' C05800'0019' 3E66001S' C30000#

OOlE' JE080020' C300001

50

Page 57: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

,CROMEMCO COBOL MANUAL ADDENDUMSECTION 6 - Using Non-Cromemco Terminals

Page 0003

;SEND EIGH-ORDER DIGIT

;SEND LOW-ORDER DIGIT

;IF < 0;INCREMENT HIGH DIGIT

;CONVERT BINARY TO; 2 ASCII DIGITS;SAVE.RESULT

;RESTORE & CONVERT; LOW DIGIT

;SEND BELL CODE AND; RETURN

A,BELL$OOTCH

BTOA

BCA,B$OOTCHBCA,C$OUTCB

B,' 0'10C,BTOA2BSTOAl10+'0'

tD C,ARET

LD A, ESCAPECALL $OUTCBLD A,'['JP $OUTCH

PUSHtoCALLPOPLDJP

tDJP

SOUND AUDIBLE TONE

;$ALARM:

SEND2;

SETUP:

BTOA: toBTeAl: SOB

JPINCJP

STOA2: ADD

;;******************************************************

0072' 4F0013' C9

0074' (0000)

0065' 06300067' 060A0069' DA7000'OOGC' 040060' C36700'0070' C63A

0058' CD6S00'

OOSS' CSOOSC' 780050' COOOOOt0060' C10061' 790062' C30000t

004E' 3EIB0050' COOOOOt0053' 3E5S0055' C30000t

0049' 3E07004B' C30000#

CROMEMCO zao Macro Assembler version 03.05 Dec 28, 1979 10;20;00USERDRVR - CRT DRIVER FOR ANSI STANDARD TERMINAL

010001010102010301040105010601070108010901100111011201130114011501160117011801190120012101220123012401250126012701280129

R 01300131

R 0132013301340135013601370138

(

Errors 0Range Count 3

Program Length 0074 (116)

51

Page 58: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 6 = Using Non=Cromemco Terminals

52

Page 59: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 7 - Errata

SECTION 7

Errata

The following errata have been noted in the Cromemco COBOLInstruction Manual, part number 023-0049, April, 1979.

Page : 11, item "6", line 2

Incorrect: ••• in brackets is •••

Correct : ..... in brackets ([ ]) is .....

Page : 16, item "2.", line 1

Incorrect: •••Area B preceding ... ~

Correct

Page

: ••• Area B (see 1. 1 2 , Coding Rules)preceding•••

: 19, under ENVIRONMENT DIVISION

Incorrect: [CONFIGURATION SECTION.]

Correct : [CQNFIGURATION SECTION.

Page : 21, item "3.", line 2

Incorrect: .... columns 12-72 .....

Correct

Page

....

....

....Area B(co1umns 12-72) •••

26, 2.2.2.1, FILE-CONTROL ENTRY

Incorrect: ig' for implementor-related errors •• o'

Correct .... File Status ~alue 'g' is currently:not in use.

S3

Page 60: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL MANUAL ADDENDUMSECTION 7 - Errata

Page : 62, 40507 DIVInE STATEMENT

Incorrect: If GIVING is not written.,e ..

Correct : The GIVING clause is required when the BY .form of the DIVIDE statement is used ..

Page : 67, PERFORM, option 2

<><>Correct

{index name}Incorrect: PERfORM range VARYING {data name }

FR0ts amount-l 1\l: amount-2 UNTIT. condi tion o

{index name}PERFORM range [ VARyING {data name }fJiUH amoun t-l .:a~ amount-2 ] IUi~.lL.

condition ..

Page <><> 68, EXIT statement, add last paragraph

Add : The paragraph containing the EXIT statement., must be the final paragraph in a PERFORMS ed

section in order to function as an end­point from which control returl'lS to thestatement following the PERFORM ..

Page <> 73, OPEN STATEMENTe

{ INpUT }InCOrrect· " { OPEN { .I.:.Q } file-name }'" .. ., e ......

{ OUTPUT }{ EXTEND }

{ ,INPUT }Correct e OpEN ('1 '1:.0. } file-name }" .. .. .. ., " ..

{ OUTPUT }: \ ...

{ EXTEND }

54

Page 61: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

.CROMEMCO COBOL MANUAL ADDENDUMSECTION 7 - Errata

Page : 75, WRITE STATEMENT

Incorrect: WRITE record-name .f.BQM data-name-l

{AFTER } ADVANCING { operand LINE (5) }{BEFORE} {PAGE }

( Correct : WRITE record-name [ FROM data-name-l 1

[ {AFTER } ADVANCING { operand LINE (5) } 1[ {BEFORE} {PAGE } ]

,.!:.·..1.

Page

Add

........

83, first paragraph, add last sentence

Then the next receiving field (if any) inthe list becomes the current receivingfield and scanning continues.

Page .. 85, under 5.1, USING LIST APPENDAGE..

Incorrect .. PRQCEDIIRE DIVISION [ USING data-name • •• 1•..

Correct .. PROCEDURE DIVISION USING [ data-name • •• 1•..

c Page .. 86, CALL STATEMENT..

Incorrect .. CALL literal USING data-name • • •..

Correct .. CALL literal [ USING data-name .". ". 1..(

Page : 95, RECORD ~ CLAUSE

Incorrect: ••• required, is.•••

Correct : ••• required in the S,ELECT entry fo,t thefile, is ....

(

Page : 95, RECORD KKI CLAUSE

Incorrect: ..... group item, an elementary alphanumericitem or a decimal field. A decimal

55

Page 62: i.'.:: - . COBOL MANUAL ADDENDUM ' · COBOL MANUAL ADDENDUM VERSIONS 3.01 AND HIGHER CROMEMCO. Inc. 280 Bernardo avenue Mountain View,CA 94043 Part no. 023-4000 ... 1012 Coding Rules

CROMEMCO COBOL f~NUAL ADDENDUMSECTION 7 - Errata

keY~eosign~ No record key.,oe

Correct

Page

•·

•o

~eegroup item or an elementary alphanumerici tern. No record key.,,,.,

108, example 1

Incorrect: aooOR (E < F) andeee

Correct : a .. .. OR (E <= F) and .....

56