Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Automatic Tutorial COBOL Listings

IP.com Disclosure Number: IPCOM000077679D
Original Publication Date: 1972-Sep-01
Included in the Prior Art Database: 2005-Feb-25
Document File: 4 page(s) / 18K

Publishing Venue

IBM

Related People

Ragland, T: AUTHOR

Abstract

1) STANDARDIZED, REDUNDANT FORMAT. COBOL source language may be validly written in a variety of styles: one or many blanks may be placed between most "words", words may be continued across two or more lines, and a new line may begin at several possible points of indentation. This variety is possible because the coded characters of the program are generally sufficient to express intent, without recourse to the position of the characters on the line. Such variety is often confusing to the reader of such a program, however, and many computer installation managers establish "voluntary" coding standards that require all programmers to code in specific nonconfusing ways. Since these standards are "voluntary" the reader can never fully rely on compliance--hence must examine all characters thoroughly.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 36% of the total text.

Page 1 of 4

Automatic Tutorial COBOL Listings

1) STANDARDIZED, REDUNDANT FORMAT. COBOL source language may be validly written in a variety of styles: one or many blanks may be placed between most "words", words may be continued across two or more lines, and a new line may begin at several possible points of indentation. This variety is possible because the coded characters of the program are generally sufficient to express intent, without recourse to the position of the characters on the line. Such variety is often confusing to the reader of such a program, however, and many computer installation managers establish "voluntary" coding standards that require all programmers to code in specific nonconfusing ways.

Since these standards are "voluntary" the reader can never fully rely on compliance--hence must examine all characters thoroughly. The description here is a program which transforms a variably written COBOL program into a listing, which is formatted in a standardized way that is highly redundant with the specific characters coded; thus the reader need not examine these characters at such length. The standard format includes:
a. Beginning a new line for each division-header, section,

paragraph, verb, level-number (or FD, RD, etc.), or clause in

the environment division.
b. Indenting each new line by 2*N spaces where N increases as

the "scope" of the line's significance decreases. Divisions,

sections and FD's, etc., are indented no spaces; paragraphs

and 01's, two spaces; unconditionally executed verbs (i.e.,

verbs not governed by an "if", "at end", etc.) and 02's, four

spaces; singly conditioned verbs and 03's, six spaces; etc.
c. Creating other lines wherever there are too many characters

in the statements defined in point #A to be continued in one

printed line. These "continuation" lines are indented eight

positions further than the first line of the statement, and

are arranged such that no word which can fit on one line is

split between two lines.
d. Aligning occurrences of the same word on consecutive or

nearby lines so that a visual column is formed to the right

of the indentation margin to show repetitiveness. Examples

are "picture" and "value" clauses in the data division and

"to" following "move" in the procedure division.
e. Placing unusual and significant clauses at the right margin

of the listing where they "stand out" (e.g., "occurs"...

"depending").

The above points are widely practiced by programmers, and in some cases may be validated by computer program. Further, programs exist which mechanically translate one dialect of COBOL language into another. What is presented herein is the automatic translation of a COBOL source program into its logical equivalent which, through extensive use of visual redundancy and standard format, is much easier to read. Within this context two other points are presented:
a. Printing the COBOL source program in two columns on the page

1

Page 2 of 4

(with the entire right column following the en...