COMTRAN Reconstruction

The language reference is this project’s reading of the two manuals, not IBM’s text. Every claim in it cites a page, and each citation opens that page beside its scan.

Part 3 of 10 of the COMTRAN Language Definition.

3. Data description and storage model

This section defines the Data Description division of a COMTRAN source program: the file/record/field hierarchy, the fixed-column data description card, every type code, the pictorial (format-character) repertoire, constants, modes, justification and word-boundary rules, tables and subscript declaration, and every stated numeric limit. F28-8043 chapter 4 is the 1960 language description; J28-6169 section 02.05 (with 02.03 and 90.01) is authoritative for the implemented 709/7090 language. Divergences are flagged throughout and summarized in §3.11.

3.1 Files, records, and fields — the data hierarchy

The manuals define the three units of data by the verbs that may operate on them (F p. 63):

Unit Defined by Description
File Operable only by OPEN and CLOSE "a body of data stored in some external medium which can be made accessible to the system by the use of the verb OPEN" (F p. 63). A file is never itself brought into storage (F p. 64). There may be more than one file on a tape, and a file may extend over a number of tapes (F p. 63).
Record Operable by GET and FILE "a portion of a file which can be made accessible to the system by the verb GET, assuming the file has previously been 'opened'" (F p. 64). Its size and position in storage are determined by the data description; a record is an "internal" body of data (F p. 64).
Field Operable by arithmetic and data-movement commands (other than GET/FILE) "a block of data which can be operated on as a unit by the arithmetic commands and by the commands that control the movement of data within the system" (F p. 64). A record may contain only one field; parts of several records may be regrouped in storage to form a new field. "Fields must always be defined in the data description." (F p. 64)

3.2 The *DATA division and the data description card

A "division header" must be placed immediately before the first entry of each consecutive group of data description cards: "The name *DATA, placed so that the asterisk is in Column 7, should be the only entry on the line (i.e., card), except for the serial number and identification entries in Columns 1-6 and 73-80." (F p. 65) The *DATA header appears as such in the 7090 compiler's symbolic listings (J 90.02.02, 90.05).

One card is used per kind of data item. The card format is fixed-column: unlike the procedure description, it "does not allow 'free form' description" (F p. 65). Column layout (F p. 65):

Columns Width Use
1–6 6 Card Serial Number
7–22 16 Name
23–24 2 Level Indication
25–30 6 Type
31–35 5 Quantity
36 1 Mode
37 1 Justification
38–71 34 Description
72 1 Continuation Indication
73–80 8 Identification

Ctl. and Serial (Col. 1–6)

Data Name (Col. 7–22)

Level (Col. 23–24)

Type (Col. 25–30)

If blank, the entry describes an ordinary data field or group of fields (F p. 71). Type codes:

Type code F28-8043 (1960) J28-6169 (1962 implementation)
RECORD yes (F p. 71) yes (J 02.05.01)
COND yes (F p. 71–72) yes (J 02.05.02)
FUNCT yes (F p. 73) "no longer in the language" (J 02.05.03)
PARAM yes (F p. 73) "no longer in the language" (J 02.05.03)
REDEF yes (F p. 73–76) yes, with restrictions (J 02.05.02, 90.01.03)
COPY yes (F p. 76–77) "Implementation of COPY has been deferred." (J 90.01.03)
LABEL yes (F p. 77) yes, 14-word IOCS label area (J 02.05.03)
RCDMRK (not in F) new in J (J 02.05.03)

Full semantics of each code: §3.3.

Quantity (Col. 31–35)

Mode (Col. 36)

Justify (Col. 37)

Description (Col. 38–71)

Five kinds of information may appear, and when several are needed on one line they are written in this order, separated by one or more blanks (F p. 79):

  1. Format characters (the "field pictorial").
  2. Constants.
  3. Data names associated with the type codes REDEF and COPY.
  4. The word LIBRARY, followed by the name of a data description stored in the library.
  5. The words QUANTITY IN, followed by the name of a field which will contain a quantity at object time.

J adds a sixth kind of Description-field content not in F: the BLANK WHEN ZERO clause (J 02.05.07; see §3.4). Full detail on all of these: §3.4.

Cont. (Col. 72)

Identification (Col. 73–80)

Optional program-identification code; any characters from the basic character set; "the characters in these columns have no effect on either the processor or the object program" (F p. 84).

3.3 Type codes in detail

RECORD

COND

REDEF

COPY and library data descriptions

LABEL

RCDMRK (J only)

"The RCDMRK type code causes insertion of a single character record mark constant in the indicated position. No description field specification is required since the compiler automatically provides a pictorial with a single A. Information may be freely moved into or out of this position subject only to the restriction imposed by its single character alphameric format." (J 02.05.03) Not present in F.

PARAM and FUNCT (F only — removed)

3.4 The Description field in detail

Format characters (the field pictorial)

Format characters serve two functions: they show the number of character spaces a field occupies, and the kind of character occupying each space; the result is a "field pictorial" (F p. 79). For data brought in at object time, the pictorial must reflect the data as it already exists: "changes in input data cannot be effected by the field pictorial"; for data produced by the program, the pictorial directly controls how the data is handled (F p. 79). With the stated exceptions (V, S, F, overpunched signs, (n)), one format character is required per data character of reserved storage (F p. 79).

The complete repertoire (F p. 80):

Character Meaning and use (condensed from F p. 80)
A "Any non-numeric character, including the blank."
X "Alphameric character (any character in the machine's character set)." (A and X "are considered to be synonymous by the 7090 CT Compiler" — J 02.05.04.)
9 "Any numeric character."
8 "Numeric character, to be replaced automatically by a blank whenever it is a non-significant zero."
* "Numeric character, to be replaced automatically by an asterisk whenever it is a non-significant zero."
V "Assumed decimal point. ... The symbol is not required for integers. The symbol V will not reserve an actual space in storage."
. "True decimal point. This character will reserve an actual space in storage."
S "Scale factor. ... used as a 'filler' or 'spacer' when the input data does not show the position of the decimal point. E.g., a field containing percentages from 1 to 9 would be represented by the notation VS9; this would assure that the values 1 to 9 would be interpreted as .01 to .09. Similarly, if a field contains values that represent thousands, each unspecified digit must be represented by an S; thus, the notation 999SSS would provide for values from 000,000 to 999,000, even though the three right-hand zeros would not appear as input."
$ "Dollar sign. An actual dollar sign will be placed in the indicated position, provided it is not followed by the symbol 8. In the latter case, the dollar sign will 'float' — i.e., it will be placed immediately to the left of the first significant digit remaining."
, "True comma. This symbol will reserve an actual space in storage, to be occupied by the comma. The comma itself may be replaced by a blank, asterisk, or dollar sign, if the operation of a preceding 8 or * has resulted in the elimination of non-significant zeros to the left."
+ "Plus or minus sign, one of which will always be placed in the space reserved for it, depending on whether the value is positive or negative. ... This sign may be placed in a column by itself, in which case it will reserve an actual space in storage. Alternatively, it may be entered as an 'overpunch' with either of the format characters 8 or 9, in either the units or high-order position of a field; in this case, a special space will not be reserved, and the sign of the field will be indicated in accordance with the operating characteristics of the particular system."
- "Minus sign, to be placed in the space reserved for it when the value is negative; when the value is positive, the space will be left blank. If punched in a space by itself, this symbol will reserve a space in memory; otherwise, it may be 'overpunched' and will act as described in the rules for the symbol +."
F "Floating point number. This symbol does not reserve an actual space in storage; it informs the processor that the number being described is a floating point number. It is placed between the format characters representing the fraction and those representing the exponent. E.g., +99V9F+99."
(n) "A number placed in parentheses immediately following one of the other format characters instructs the processor to allow for that number of the character specified. E.g., 9(4)A(12) is equivalent to 9999AAAAAAAAAAAA."

Worked examples of pictorial ranges (F p. 81):

Notation Range of Characters Provided For
AAA All characters in the machine's character set except numerals.
88999 All numeric values from 000 to 99999.
****.99 All numeric values from ****.00 to 9999.99.
$888,888.99 All numeric values from $.00 to $999,999.99.

Field types on the 7090 (J chart)

The implemented compiler classifies every field into one of six types (chart, J 02.05.05; overpunched digits shown with combining overline per the conversions):

Type of Field Characterized By Legitimate Format Characters in Description Legitimate Information in Field
Alphameric A or X in format field A X (n) all characters
External Decimal (1)(3) E in Mode Column 9 (n) S V 9̅ or 9⁺ in rightmost character (the minus- then the plus-overpunched 9; rendering per §8.5.8) digits and leading blanks; an overpunch with the rightmost digit
Internal Decimal I in Mode Column 9 (n) V S binary
Edited Field (2) 8 * . , $ + - in format field or BLANK WHEN ZERO clause 9 8 * . , $ + - S V (n); 8̅ or 9̅ or 8⁺ or 9⁺ in rightmost character (the minus pair, then the plus pair; rendering per §8.5.8) digits and leading blanks; an overpunch with the rightmost digit
Floating Point I in Mode Column and F or FF in format field F is single precision; FF if double precision floating binary
Scientific Decimal (4) E in Mode Column and F in format field 9 (n) F . V + - digits . + -

Chart notes (J 02.05.05):

  1. "The only sign specification which may be used for an external decimal field is an overpunched + or - in the rightmost position of the field. A + and - may not appear in the character by itself."
  2. "An edited field may have a character position reserved for the sign or may have the sign over the rightmost digit."
  3. "Numeric external fields may contain leading blanks which are treated as leading zeros."
  4. "Scientific decimal is the edited form of the floating point. The maximum fractional portion of a scientific decimal field is 16 digits."

Rules and restrictions on pictorials (J)

Constants in data descriptions

QUANTITY IN data.name

BLANK WHEN ZERO (J only)

"When associated with an output field this clause indicates that the field is to be replaced with blanks when it becomes zero. Since leading blanks in numeric input fields are automatically treated as zeros, the use of this clause is redundant [for input]. In some cases it may even result in decreased efficiency in the object program as these fields are treated as edited types." (J 02.05.07) The clause by itself characterizes a field as an edited field (J 02.05.05 chart). Not present in F. Neither manual shows its exact written form or position on the card (see ambiguities).

3.5 Signed-number representation and overpunch

3.6 Mode, justification, and the machine storage model

The 709/7090 storage model, as stated by J:

3.7 Lists, tables, and subscripts (declaration side)

Concept and layout

The canonical F technique: constants + REDEF

Step 1. Enter the data as constants (F p. 74):

SERIAL   DATA NAME                      LEVEL   DESCRIPTION
         RATE.TABLE                      01
                                          02     'LOS ANGELES        15342 28516 21287'
                                          02     'MIAMI              07860 14163 11892'

Step 2. Superimpose structure by redefinition (F p. 75):

SERIAL   DATA NAME              LEVEL   TYPE    QUANTITY   MODE  JUSTIFY  DESCRIPTION
                                  01     REDEF                                    RATE.TABLE
         RATE                     02                30
         CITY                     03                                             AAAAAAAAAAAAAA
         ONE.WAY                  03                                             999V99
         ROUND.TRIP               03                                             999V99
         EXCURSION                03                                             999V99

The 30 in Quantity opposite RATE reserves the RATE group (with its four subfields) 30 times; ONE.WAY (17) then obtains the one-way rate on the 17th line, and MOVE ONE.WAY (DESTINATION) TO BILL.AMOUNT uses the value found in the DESTINATION field at object time (F p. 75–76). Code values used as subscripts "must be assigned in a sequence corresponding to the lines of the table" (F p. 76). A city name can be bound to a line number by declaring, e.g., MIAMI as the name of the constant value '17' (F p. 30).

Subscript rules

3.8 Record length: fixed vs. variable (storage view)

Primary treatment in the Input/Output section; the data-description-relevant facts:

3.9 Storage areas

F chapter 4 closes with the storage-areas doctrine (F p. 84–85):

3.10 Numeric limits and defaults — summary

Item Limit / default Citation
Data name length up to 30 characters F p. 67 (rules on F p. 15)
Name field on card 16 columns (7–22), continuable F p. 65, 67
Description field on card 34 columns (38–71), continuable F p. 65
Level numbers 1–99; leading zeros optional (J) F p. 68; J 02.05.01
Levels in a data hierarchy ≈ 23 max J 90.01.05
Quantity default 1 F p. 77; J 02.05.04
Quantity maximum 2¹⁵ − 1 J 02.05.04
Quantity nesting 3 levels per nested group (F) F p. 77
Subscripts per reference up to 3 (F) F p. 30
Array origin A(1), not A(0) J 02.04.07.01
Fixed point single precision formats up to 10 digits; > 10 digits = double precision J 02.05.06
Scientific decimal fraction max 16 digits J 02.05.05 note 4
LABEL area 14 words J 02.05.03
QUANTITY IN specifications ≈ 25 J 90.01.05
Array dimensions (explicit or implicit Quantity specs) ≈ 85 J 90.01.05
Positional indicators (unique array/subscript combinations) ≈ 90 J 90.01.05
Index expressions (a * VARIABLE ± b) ≈ 50 J 90.01.05
Internal dictionary (all program names) ≈ 3500 J 90.01.05
Different edited field formats ≈ 35 J 90.01.05
Base locators (field test: number of located records) ≈ 127 J 90.01.05
Generated constants in constant pool ≈ 500 J 90.01.05
Files describable (Environment) 63 max J 90.01.04
Internal fixed-point field length (L or blank justify) least multiple of 6 bits holding number + sign J 02.05.04
Internal right-justified field one full word (two if double precision), sign in sign bit J 02.05.04

(Values from J 90.01.05 are headed "Appox-Max Size": approximate maxima of compiler internal tables.)

3.11 F/J divergences in data description — summary

Topic F28-8043 (1960) J28-6169 (1962, authoritative)
PARAM / FUNCT type codes defined (F p. 73) "no longer in the language" (J 02.05.03)
COPY type code defined (F p. 76–77) implementation deferred (J 90.01.03)
LIBRARY descriptions / INCLUDE defined (F p. 81) no library facilities; INCLUDE deferred (J 90.01.02)
RCDMRK type code absent added (J 02.05.03)
BLANK WHEN ZERO clause absent added (J 02.05.07)
Serial number sequence check checked on read-in (F p. 67) not sequence checked (J 02.03.01)
Sign overpunch position units or high-order position (F p. 80) external decimal: rightmost position only; free-standing + or − illegal in such fields (J 02.05.05 note 1)
REDEF card contents may carry a new name for the redefined area (F p. 75) no coding on the REDEF line except serial number and target name (J 02.05.02)
Quantity at record level not addressed unacceptable; record.names not subscriptable (J 02.05.01, 90.01.03)
Constant continuation across cards each line a complete quoted constant (F p. 83) 7090 also accepts single literal split across cards; nonportable (J 02.03.01)
A vs X pictorial characters distinct (non-numeric vs any character) (F p. 80) synonymous on 7090 (J 02.05.04)
Mixed A/9 pictorials not addressed illegal; treated as alphameric (J 90.01.03)
Mode meanings machine-dependent, deferred to processor manuals (F p. 78) I = binary, E = BCD (J 02.05.04)

Open flags for the compiler writer (detailed in the §8.5 catalog): the maximum subscript/quantity-nesting depth under J; the exact written form and card position of BLANK WHEN ZERO; the meaning of "non-format field"; and whether a named REDEF line is accepted. (The exact reading of the External Decimal row of the J 02.05.05 chart, formerly flagged here, has been scan-resolved; see §8.5.8.)