Part 7 of 10 of the COMTRAN Language Definition.
7. Special facilities and library conventions
This section covers everything in COMTRAN outside the Data and Procedure descriptions proper: the Environment Description (all seven card types, every field and default), the compiler control cards ($CMPLE, *FINISH) as source-visible language surface, the library system (COPY, LIBRARY, INCLUDE) as designed in 1960 and its deferral in 1962, program segmentation (OVERLAP/LOAD), renaming and linkage (CALL, ENTER, CONTRL), commentary (NOTE), and the CRYPT symbolic machine language facility. Throughout, J28-6169 (the 709/7090 processor manual) is authoritative for the implemented language; F28-8043 material is included where it defines features J defers or omits.
7.1 The Environment Description (J 02.06)
7.1.1 Purpose and position in the source program
The Environment Description "allows the programmer to specify the external physical factors which relate to the compilation and execution of the program … including physical characteristics of data, machine configurations, and programmer-elected features." These factors may usually be changed without affecting the logical description of the problem in the Procedure and Data Description parts (J 02.06.01.01).
A source program is divided into three divisions, each portion introduced by a division header, the division name preceded by an asterisk: *PROCEDURE, *DATA, *ENVIRONMENT. The divisions need not appear as separate entities; portions may be interleaved, but each portion must be labeled with its header, and all entries following a header belong to that division (F p. 27). (Division headers and overall program structure: see §2, Language structure.)
F/J divergence: F28-8043 reserves the environment division but does not define its content: it states only that each record must "also be named in the environment description, as specified in the publication covering the processor for each particular system" (F p. 71). The full card-level definition below exists only in J.
Appendix 90.08 of J describes the effect of Environment specifications on the Loader symbolic control cards generated by the Compiler (J 02.06.01.01); a summary is in §7.1.11 below.
7.1.2 Coding form, card layout, and continuation rules
The Environment Description coding form (Figure 1, J 02.06.01.02) has these fields:
| Columns | Field |
|---|---|
| 1–3 | CTL. |
| 4–6 | Serial |
| 7–22 | Name |
| 25–30 | Type |
| 31–71 | Description (options) |
| 72 | Continuation |
| 73–80 | Identification |
Rules (J 02.06.01.01, J 02.06.02, J 02.03.01–02.03.03):
- The first card of each specification group may contain an appropriate name in the Name field (columns 7–22) and must contain one of the seven type codes in the Type field (columns 25–30) (J 02.06.01.01). A FILE card lacking a name in columns 7–22 draws error 1,00; likewise a COND card, error 88,00 (J 90.04).
- Continuation: when multiple cards are required, continuation of the options (columns 31–71) or Name on subsequent cards is indicated by a non-blank character in column 72. A blank column 72 signals that the next card initiates a new specification; if that next card contains no type specification "the card is deleted and an error message given." If a card carrying the continuation signal is followed by one containing a type specification, "the type is ignored and the options specified are considered to be part of the previous specification" (J 02.06.01.01).
- Entries are considered complete when column 72 is blank. The processor replaces the contents of column 72 with a blank, so each word or literal must be complete upon a line (J 02.03.01–02.03.02).
- All imbedded and leading blanks in the name fields of cards associated with an entry are eliminated and the non-blank characters compressed to form a single name (J 02.03.01).
- A period (.) must not be used to signal the end of a specification: it is treated as part of the previous word, "thus creating an undefined symbol" (J 02.06.02; also J 02.03.02).
- Qualified names may not be used in the Environment Description. Data and Procedure names used here must be of one word only; the verb CALL (§7.5.1) reduces a qualified name to a one-word name (J 02.03.03; restated at J 90.01.04).
- Many key words (ACTIVITY, BCD, BINARY, BLOCKSIZE, CARD, CHECKC, …) may be used as Procedure/Data names only if the item need never be referenced in the Environment Division (J 02.03.03); see §2 (reserved words / key words) for the full three-tier lists.
7.1.3 The seven card types
Seven type codes may appear in columns 25–30 (J 02.06.01.01): FILE, SPECIF, POOL, GROUP, CONTRL, OPTION, COND. Their general functions (J 02.06.02):
| Card | General function |
|---|---|
| FILE | "must be included to describe the file characteristics which affect compilation, such as use for input or output and the type of blocking utilized." |
| SPECIF | "describes such file characteristics as symbolic input/output unit assignments, density, relative activity, labeling conventions and other programmer choices which are to be punched during compilation into load-time control cards. SPECIF cards may be omitted if the programmer prefers to provide his own cards containing the appropriate information at load-time." |
| POOL | "may be used by the programmer to direct the processor in the allocation of buffer storage for several files. In the absence of POOL cards, the processor will automatically make pool and buffer assignments." |
| GROUP | "may be used by the programmer to specify buffer allocation for files belonging to a particular buffer POOL." |
| CONTRL | "If several separately compiled programs are to be combined and executed as one program, any joint procedure or data description areas must be defined for the compiler by CONTRL environment cards." |
| OPTION | "used when the programmer wants the processor to depart from its standard use of 709/7090 collating sequence, or when he wishes special emphasis placed on minimizing either storage or running time requirements in his object program." |
| COND | "names and defines a computer console key setting which the programmer may want to test by procedure statements in his program." |
7.1.4 FILE card
A FILE specification "must be made for each file processed by the program" (J 02.06.02). A maximum of 63 files may be described (J 90.01.04). No file check table is produced in the object deck (J 90.01.04).
General form, input files (J 02.06.03):
Name Type Description
file.name FILE INPUT [ ,{BCD} ] [ ,{CARD} ]
[ {BINARY} ] [ {TAPE} ]
,BLOCKSIZE nn
[ ,ON ERROR statement.name.1 ]
[ ,FOR LABEL statement.name.2 ]
[ ,{HOLD} ] [ ,BEGIN ]
{SPANS}
,record.name.1
[ ,{BLOCK CONTROL} ]
[ {FIND LENGTH IN data.name.1} ]
[ ,PLACE LENGTH IN data.name.2 ]
[ record.name.2 . . . ]
(The mark "nj" following record.name.1 on the source page is real typed characters, scan-resolved: not bleed-through, with the apparent trailing period a dust speck; it corresponds to no defined syntax element and is ignored. See §8.5.8.)
General form, output files (J 02.06.03):
Name Type Description
file.name FILE OUTPUT [ ,{BCD} ] [ ,{CARD} ]
[ {BINARY} ] [ {TAPE} ]
,BLOCKSIZE nn
[ ,FOR LABEL statement.name.2 ]
[ ,BEGIN ] [ ,SPANS ]
,record.name.1
[ ,FIND LENGTH IN data.name.1 ]
[ ,PLACE LENGTH IN data.name.2 ]
[ ,PRIMARY ] [ ,NO CONTROL WORD ]
[ ,record.name.2 . . . ]
General form, checkpoint files (J 02.06.04):
Name Type Description
file.name FILE CHECKPOINT
Option ordering rule: "The order in which options are exercised on the FILE card is critical only in that the options exercised for a particular record must be listed following the record.name and prior to the introduction of another record.name" (J 02.06.04).
Option-by-option (J 02.06.04 – 02.06.07):
- INPUT / OUTPUT / CHECKPOINT: one of the three must be specified. "If a file is designated as CHECKPOINT it may have no other usage" (J 02.06.04).
- BCD / BINARY: mode in which an input file is read or an output file written. Default: BCD (J 02.06.04).
- CARD / TAPE: CARD if the on-line card reader or card punch is the processing unit. "When CARD is specified BEGIN is assumed, i.e., each record starts at the beginning of a physical block. With this option only columns 1 through 72 are read. For the most efficient handling of card input a GROUP card should be used when more than two cards constitute a record." Default: TAPE (J 02.06.04). Restriction: "Card files processed on-line may only be in BCD and fixed length for field test" (J 90.01.01).
- BLOCKSIZE nn: mandatory. nn is "the size of the largest block to be output or the maximum number of words to be input from an input block. … All input card files must have a block size of at lease 24 words. Maximum blocksize is 9999 words" (J 02.06.04; "at lease" sic). A numeric integer must follow BLOCKSIZE (error 91,00, J 90.04).
- ON ERROR statement.name.1 (input only): a procedure statement name "to which transfer will be made if the system is unable to recover from an input error" (J 02.06.04); the programmer's hook for unrecoverable redundancy, block-checksum and block-sequence errors (J 02.07.07). Record length errors are "totally unrecoverable by IOCS or the programmer" and terminate execution (J 02.07.06). Without ON ERROR, an IOCS-unrecoverable error prints an on-line message and returns control to the CT Supervisor (J 02.07.07). A statement or section name must follow ON ERROR (error 92,00, J 90.04).
- FOR LABEL statement.name.2: "provides transfer of control to statement.name.2 whenever a file is opened or closed or whenever a reel switch occurs" (J 02.06.05), for programmer processing of non-standard labels via the 14-word IOCS label area redefined with the Data Description type code LABEL (J 02.05.03; see §3). Portions of FOR LABEL coding must be done in CRYPT (J 02.05.03). The referenced worked example, Appendix 90.07, is listed in J's own table of contents as "Not Currently Available" (J 00 contents). A statement or section name must follow FOR LABEL (error 93,00, J 90.04).
- record.name: "All records associated with the file must be named on the FILE card" (J 02.06.05). A record used with GET must be associated with only one input file (J 02.07.04; errors 9,00–11,00, J 90.04).
- HOLD / SPANS: for an input file, forces the transmit mode of processing: required if records overrun block boundaries (SPANS) or if each named record must remain available until another of the same name is input (HOLD). For an output file, "specifies that output records are to be written in blocks of the specified length," permitting partial records in blocks for compactness (SPANS); such files must be processed in the transmit mode when input. "The compiler does not differentiate between the words HOLD and SPANS. They produce the same effect and are both included in the vocabulary for mnemonic convenience." Default ("If neither HOLDS or SPANS is selected", sic): input processed in the locate mode; output created with all records complete within blocks (J 02.06.05). Locate/transmit semantics: see the Input/output facilities section (J 02.07.02–02.07.05).
- BEGIN: "each record to be read or written by the program starts at the beginning of a physical block" (J 02.06.05).
- BLOCK CONTROL / FIND LENGTH IN data.name.1: BLOCK CONTROL: input record is variable length with no standard control word preceding it; logical record length equals block length. FIND LENGTH IN: the length of an input or output record is obtained from data.name.1 rather than from the data description. Default (neither): "it is assumed that the variable length record is preceded on tape by the standard control word" (J 02.06.05). "If both options are specified for a record, only BLOCK CONTROL will be effective" (J 02.06.06). A data name must follow FIND LENGTH IN (error 95,00, J 90.04).
- PLACE LENGTH IN data.name.2: on input, makes the length of the current record available in data.name.2; on output, the length is placed there "prior to filing the record" (J 02.06.06). The data.name need not be in the referenced record (J 02.07.08–02.07.09). A data name must follow PLACE LENGTH IN (error 94,00, J 90.04). Any of the variable-length options may be applied to fixed-length records; NO CONTROL WORD then has no effect (J 02.07.09).
- PRIMARY (output only): enables selective filing of a record associated with more than one output file:
FILE record.namefiles such a record only in files where PRIMARY was specified for that record.name; if PRIMARY is not used with the record.name in any file, the record is filed in all associated output files (J 02.06.07). - NO CONTROL WORD (output only): "notifies the system not to produce the standard control word for the variable length output record" (J 02.06.07).
The standard variable-length record control word (one word, IOCTN 0,,length.of.record.in.words. for binary, six BCD characters of length for BCD records) precedes each standard variable-length record on tape and in the buffer, is not describable or addressable by the programmer, but must be counted in BLOCKSIZE (J 02.07.03; see the Input/output section).
Further field-test restrictions folded in from J 90.01.01: all input records containing arrays are processed in the transmit mode; records from different files REDEF'd together are not automatically transmitted (SPANS or HOLD must be used).
Checkpoint files: designating a FILE CHECKPOINT (with SPECIF CHECKC/CHECKF on data files, §7.1.5) is the language surface of the checkpoint facility. IOCS module choice follows: "Normally the MINIMUM module of IOCS is used with the object program. If checkpoints are desired or specified BASIC IOCS is used. If labeling exists the LABELS version of IOCS is necessary" (J 90.01.05). Restart is an operator procedure (J 05.04), not a language feature.
The PATTERN puzzle: the GET verb discussion allows GET RECORD FROM file.name when "All records in the file which will be obtained by this form of the command are included in a PATTERN in the Environment Description" (J 02.07.04), and three compiler diagnostics govern it: "NO RECORDS SPECIFIED IN -PATTERN- ON -FILE- CARD FOR 'NAME.1'.", "SINGLE RECORD IN THE -PATTERN- ON -FILE- CARD … INEFFICIENT PROGRAM PRODUCED", and "NUMBER OF RECORDS IN -PATTERN- CANNOT EXCEED 16" (errors 48,00–50,00, J 90.04); yet no PATTERN option appears in the FILE card general forms (J 02.06.03). See ambiguities.
7.1.5 SPECIF card
"The SPECIF card is used to describe load time I/O options for the designated file. SPECIF cards are not necessary for correct compilation … the user may elect to punch the required load time cards himself. … The SPECIF card(s) may appear anywhere within the environment division" (J 02.06.07).
General form (J 02.06.07):
Name Type Description
SPECIF file.name [ ,UNIT1 'unit.1' ] [ ,UNIT2 'unit.2' ]
[ ,{LOW} ] [ ,DEFER ] [ ,OPENW ] [ ,OPENF ]
{HIGH}
[ ,{CLOSER} ] [ ,ACTIVITY nn ] [ ,{CHECKC} ] [ ,MULTI ]
{CLOSEW} {CHECKF}
[ ,SEQ ] [ ,CKSUMS ]
[ ,{LABELS} ] [ ,SERIAL 'ser.no' ] [ ,REEL 'reel.no' ]
{LABELN}
[ ,RETAIN days ] [ ,{HIGH} ]
{LOW}
- file.name: "must be the first item of the SPECIF card description field. It must be identical with the file.name in the FILE card" (J 02.06.08).
UNIT1 'unit.1' / UNIT2 'unit.2': "Note that the Quote Marks are mandatory." The alphameric literals specify symbolically the I/O units (card or tape) to which the file is attached: relative unit assignment, symbolic channels, and tape transport model type. UNIT2 assigns the secondary reel of a multi-reel file, automatically referenced upon a reel switch; "If UNIT2 is left blank, the secondary unit assignment will be the same as the primary unit" (J 02.06.08). Notation (J 02.06.08):
| Symbol | Meaning |
|---|---|
| X | one of the real channels A,B,…,H |
| P | a symbolic (unspecified physical) channel S,T,…,Z |
| k | one of the numbers 1,…,9,0 |
| m | a tape transport model number, II or IV |
Allowable unit specifications (J 02.06.08–02.06.09):
| Form | Meaning |
|---|---|
| (none) | any available unit is assigned |
'm' |
any available unit of this model type |
'X' |
any available unit on this physical channel |
'P' |
all files in the job with this symbolic channel designation are assigned to the same channel |
'X(k)' |
the kth available unit on the specified channel; "the parenthesis are required" |
'Pm' |
any available unit of this model type on the symbolic channel |
'Pkm' |
an available unit on the symbolic channel, having this model number; k without parenthesis is the order of preference for the channel (lower numbers assigned to the same channel first when units are scarce) |
'IN' |
the current system Input unit contains the file |
'OU' |
the current system Output unit, for a printed output file |
'PP' |
the current system Peripheral Punch unit, for a punch output file |
'UTk' |
System utility tape k (non-parenthesized k = 1–4) |
'RDX' |
card reader, channel X |
'PRX' |
printer, channel X |
'PUX' |
card punch, channel X |
* in UNIT2 |
secondary unit is any unit on the same channel and of the same model type available after all other assignments; at load time a different-model unit may be substituted, or no secondary unit assigned if none available (J 02.06.09) |
Examples: first available unit on channel A: , UNIT1 'A(1)'; system output tape: , UNIT1 'OU'. "Note, that in this case (also for 'IN') included options for density, opening and closing are non-effective" (J 02.06.10). Further unit-assignment information is in Loader section 03 (J 02.06.10).
Restrictions (J 90.01.04): "Absolute tape assignment cannot be made; symbolic and relative assignment techniques are used." "Unless system utility tapes (UTk) are explicitly designated the drives assigned to them are not used at execution time as object program units."
Remaining options (J 02.06.10 – 02.06.12):
| Option | Meaning | Default if absent |
|---|---|---|
| LOW / HIGH (first occurrence) | density of the tape | HIGH (J 02.06.10) |
| DEFER | file not required when processing begins | file must be mounted before program processing commences (J 02.06.10) |
| OPENW | do not rewind before opening | file rewound prior to being opened (J 02.06.10) |
| OPENF | this standard labeled file is found on a multi-file reel by searching forward on labels; without OPENW the tape is rewound before searching. With OPENW+OPENF the programmer must insure (1) the tape is positioned before a header label and (2) the labeled file sought is further down the tape (J 02.06.10) | no forward search |
| CLOSER / CLOSEW | CLOSER: file only rewound upon closing; CLOSEW: file not rewound upon closing (J 02.06.10) | rewind and unload on close (J 02.04.06; J 90.08.02 codes this default "U") |
| ACTIVITY nn | nn = 1–99, relative activity (usage) of this file, used by the loading-time program in allocating buffer areas (J 02.06.11) | — |
| CHECKC / CHECKF | CHECKC: checkpoint written on the checkpoint file upon reel switch of this file. CHECKF: checkpoint written on this file upon reel switch; "the file must be a labeled output file for this option to be operative" (J 02.06.11) | "No check point will be written if neither option is exercised" |
| MULTI | tape file contained in more than one reel | "A single reel file is assumed" (J 02.06.11) |
| SEQ | each block contains a block sequence number to be checked by the I/O system (J 02.06.11) | no sequence check (J 02.07.06) |
| CKSUMS | each block carries a checksum of data to be checked by the I/O system (J 02.06.11) | no checksum check (J 02.07.06) |
| LABELS / LABELN | LABELS: standard label, "checked or written automatically by IOCS." LABELN: non-standard label, "a label of 14 words or less which is to be checked by the programmer using a linkage supplied by the FOR LABEL option of the Environment FILE card." "Either LABELS or LABELN must be explicitly stated if labels are to be recognized by IOCS" (J 02.06.11) | "the file is considered to be unlabeled" |
| SERIAL 'ser.no' | alphameric literal of 5 or less characters. Standard input labels checked against it if non-blank; standard output labels contain it only if REEL specifies a 'reel.no' greater than 1: "output serial numbers are normally taken from the label already present on the tape on which the first reel of the file is written" (J 02.06.12; "lables" sic) | — |
| REEL 'reel.no' | alphameric literal of 4 or less numeric characters: reel sequence number of the first reel; "adjusted at object time to reflect reel switching, and is checked in standard input labels" (J 02.06.12) | assumed to be 1 |
| RETAIN days | numeric literal of 3 or less numeric characters: days the tape is retained from the date written. Writing a labeled file on the tape before expiry produces an on-line IOCS error. "Unless a labeled file is to be written on a tape, the system assumes that no label is present on the tape" (J 02.06.12) | — |
| HIGH / LOW (after LABELS/LABELN) | density of the label. "Label dinsity is assumed to be that of the file if no specification is made" (J 02.06.12; "dinsity" sic) | file density |
SERIAL, REEL and RETAIN may be given for standard or non-standard labels; the information is kept in the IOCS file block, printed on-line in certain error situations, used by IOCS for standard labels only, and available to the programmer for non-standard label handling (J 02.06.12).
7.1.6 POOL card
The POOL card lets certain files share a common buffer area; optional. "If POOL specifications are not provided at all, files will be grouped automatically by IOCS," and the information may alternatively be entered on an object-time loading card (J 02.06.13).
General form (J 02.06.13):
Name Type Description
pool.name POOL file.name.1 [file.name.2.....]
[, BUFFERCOUNT nn]
[, BLOCKSIZE nn]
- BUFFERCOUNT nn: nn buffers assigned to the files in the pool by the loading program. "nn must be equal to or greater than the number of files in the pool"; when GROUP cards are used, nn must be equal to or greater than the total number of buffers assigned to groups within the pool. Default: "it will be assigned automatically by the compiler" (J 02.06.13).
- BLOCKSIZE nn: words allocated to each buffer in the POOL; "should be equal to or greater than the largest BLOCKSIZE specified for any file in the pool." Default: "the POOL BLOCKSIZE used will be the same as the BLOCKSIZE of the largest file in the POOL" (J 02.06.13). A numeric integer must follow BLOCKSIZE (error 162,00, J 90.04).
7.1.7 GROUP card
Used in conjunction with a POOL card to specify how buffers within a POOL are shared; optional. "If GROUP specifications are not made at all, the compiler will attempt to assign at least 2 buffers to each file" (J 02.06.13–02.06.14).
General form (J 02.06.14):
Name Type Description
GROUP [pool.name]
[, OPENCOUNT nn]
[, BUFFERCOUNT nn]
, file.name.1 [, file.name.2.....]
- pool.name: "The POOL to which a particular GROUP of files belongs must be specified by listing the pool.name as the first item in the variable field" (J 02.06.14).
- OPENCOUNT nn: maximum number of files within the group that may be open concurrently during execution; determines the minimum buffer count for the GROUP. Default: "assumed equal to the number of files in the GROUP" (J 02.06.14).
- BUFFERCOUNT nn: buffers assigned by the loader to this GROUP; must be ≥ the GROUP's OPENCOUNT. Default: "the loader will attempt to assign at least twice the OPENCOUNT number of buffers to the GROUP." If POOL BUFFERCOUNT or storage limitations prevent this, buffers beyond the minimum are allocated "on the basis of the activity of the files in the GROUP" (J 02.06.14); cf. SPECIF ACTIVITY (§7.1.5).
7.1.8 CONTRL card — inter-program areas (deferred)
"The CONTRL cards define procedure and/or data areas common to two or more Commercial Translator programs. These programs may be compiled and checked out independently and then merged at object loading time into one running program" (J 02.06.15).
General form (J 02.06.15):
Name Type Description
loadnm CONTRL { section.name
sentence.name.1 TO sentence.name.2
record.name }
- loadnm: "a name of 6 characters or less which is used at object load time to equate areas in various programs. … This load time reference name must have been specified on a CONTRL card in each program referring to the area. The body of the CONTRL area may contain entirely different names in the various programs being combined" (J 02.06.15; also error 207,00: "-CONTRL- NAME MUST BE UNIQUE AND 6 CHARACTERS OR LESS", J 90.04).
- In the form
sentence.name.1 TO sentence.name.2, "the area defined will not include any of sentence.name.2" (J 02.06.15).
Restrictions (J 02.06.15–02.06.16):
- a) CONTRL areas defined by the Data Description must begin with left justification.
- b) References from outside a CONTRL area to names inside it are valid only if the referenced name has the same bit displacement from the beginning of the area in all programs merged, and the same format in all programs merged. Hence data-defined areas "should be identical in organization and format up to and including the last externally referenced item," and procedure-defined areas identical up to and including the last externally referenced statement name; if only the section/beginning sentence name is referenced externally, no internal correspondence is necessary.
- c) "Indices inside a CONTRL area must not be referenced or modified outside of that area in any of the programs to be merged."
Deferral (J 90.01.04): "Mechanization of multiple deck combination has been deferred. CONTRL specifications will have no effect on the object deck produced by the Compiler, i.e., no control break table is punched." Correspondingly, "The control break table is not processed by the loader. This implies that multiple program loading with cross references by means of control breaks is not available" (J 90.01.05). (The object-deck layout still reserves a Control Break Table position, J 02.02; see the object-deck section.) The compiler nonetheless diagnoses CONTRL card format errors (176,00, J 90.04).
7.1.9 OPTION card — collating sequence and space/time conservation
"OPTION cards may be used to set compilation mode switches within the compiler" (J 02.06.16). The compiler normally generates comparison instructions based on the 709/7090 collating sequence and an object program "conservative of time rather than space"; the OPTION card selects the Commercial (705) collating sequence and/or a time- or space-conservative object program (J 02.06.16).
General form (J 02.06.16):
Name Type Description
OPTION [COLLATE COM] [IN section.name]
[, CONSERVE {SPACE}] [IN section.name]
{TIME }
- COLLATE COM: "instructs the compiler to generate comparison type instructions on the basis of the Commercial collating sequence" (J 02.06.16).
- CONSERVE SPACE: object program uses as few storage locations as possible; subroutines are generated once for operations such as scaling and double-precision arithmetic, with in-line calling sequences (J 02.06.16).
- CONSERVE TIME: minimum execution time via in-line instructions. "This is the normal mode of operation" (J 02.06.17).
- IN section.name: usable with either CONSERVE or COLLATE; limits the modal specification to a particular section, reverting to the normal mode at the section's end. "There is no restriction on the number of times these modes may be altered" (J 02.06.17).
The two collating sequences, lowest to highest (J 02.06.16; scan-resolved reading — glyph legend and details in §1.1):
709/7090: 0 through 9 = ' + A through I ⟨+0⟩ . ) − J through R ⟨−0⟩ $ * blank / S through Z ⟨rm⟩ , (
Commercial (705): Blank . ⟨loz⟩ ⟨gm⟩ & $ * − / , % # @ ⟨+0⟩ A through I ⟨−0⟩ J through R ⟨rm⟩ S through Z 0 through 9
COLLATE COM also changes the figurative constants: HIGH.VALUE is ( and LOW.VALUE is 0 under the 709/7090 sequence; under COM, HIGH.VALUE is 9 and LOW.VALUE is blank (J 02.04.01; see §2/§4 on figurative constants).
7.1.10 COND card — console entry keys
"The COND card defines a computer console entry keys setting which may be interrogated by procedure statements" (J 02.06.17).
General form (J 02.06.17):
Name Type Description
condition.name COND KEYS 'nn'
"The alphameric literal 'nn' is composed of 12 octal digits representing 'on' settings of the 36 console entry keys. When the condition.name is tested in a procedure statement only the keys specified in 'nn' are tested for 'on' setting. The specified console keys must all be 'on' for the condition to be true. No 'off' or 'on' test is made for the non-specified keys. Note that Data Description condition.names are tested differently, i.e., for absolute equivalence to the specified value" (J 02.06.17).
Compiler behavior on malformed COND cards (J 90.04): key setting exceeding 12 digits: rightmost 12 digits used (error 6,00); non-octal key setting: key setting '1' used (error 7,00); format error: 4,00; missing name in columns 7–22: 88,00.
Do not confuse this Environment COND card with the Data Description type code COND (condition values of a conditional variable; see §3).
7.1.11 Environment cards → Loader symbolic control cards (J 90.08)
The Compiler turns Environment FILE/SPECIF information into Loader *FILE and *SPEC symbolic control cards (J 90.08.01–90.08.02). Key mappings a compiler writer needs (full field tables at J 90.08.01/90.08.02):
- *FILE card, by option (the card's column-by-column layout is deck-format detail left to J 90.08.01): deck.name from $CMPLE; tape-mounting indicator blank if DEFER specified,
*if not; unit1/unit2 from SPECIF UNIT1/UNIT2; file type I = input, T = total block output (OUTPUT,SPANS), P = partial block output (OUTPUT); reel control L = label searched on labeled open file (OPENF + LABELS/LABELN), M = multi-reel unlabeled (MULTI); density H/L; file mode D (BCD) / B (binary); label density H/L/S (same as file); SEQ; CKSUMS; checkpoint conventions C on the checkpoint file (source printed as "FILE CHECKPOINT AND SPECIF CHKS") or F on a specified file (FILE OUTPUT + SPECIF CHECKF + LABELS/LABELN); first reel sequence (REEL); file serial (SERIAL); retention days (RETAIN); file name (J 90.08.01). - *SPEC card, by option: blocksize from FILE BLOCKSIZE; activity from SPECIF ACTIVITY; opening conventions N without rewind (OPENW), R or blank with rewind otherwise; closing conventions N (CLOSEW), R or blank (CLOSER), U (with rewind and unload) when neither CLOSEW nor CLOSER specified (J 90.08.02).
CLOSE ALL FILES closes each open file according to these *SPEC close options; "In the absence of specification, closing includes a rewind and unload of the unit. Files closed by this form of the CLOSE command may not be subsequently reopened by the program" (J 02.04.06 — note that page cites the SPECIF card as "Section 02.07"; it is actually defined at J 02.06.07). STOP RUN closes all open files as if CLOSE ALL FILES had been supplied (J 02.04.06).
7.2 Compiler control cards ($CMPLE, *FINISH) (J 02.01)
These cards are part of every source deck and are the compiler's source-visible control surface. They exist only in J; F has no counterpart.
7.2.1 $CMPLE card
"A $CMPLE card must precede each source language program. It is recognized by the Commercial Translator Monitor (CTM) for purposes of operational control and interpreted by the … compiler to initiate processing of source language statements" (J 02.01.01).
General form (J 02.01.01):
1 - 6 8 - 13 16
$CMPLE deck.name [NODECK] [,LIST] [,DICT]
[,LOAD] [,LOGIC] [,FILES]
[,MAP] [,NOGO]
55 - 72
[secondary.identifier]
- deck.name: "the primary deck identifier composed of six or less characters chosen from the set appropriate for use in CT names. The name may begin in any of the positions but must not include imbedded blanks. Leading blanks are ignored by the compiler." The complete deck.name is punched in columns 1–6 of all Loader symbolic control cards in the generated object deck for cross-referencing when multiple decks are combined at load time (J 02.01.01). Pitfall: "The Compiler accepts without comment a deck.name containing imbedded blanks and punches it in Loader symbolic control cards. A deck.name of this form is not acceptable to the Loader and will prevent execution of the object program" (J 90.01.05).
- Option list syntax: "The options used must not be separated by blanks as the first blank terminates the list of options. The options must be separated only by commas" (J 02.01.01).
- NODECK: omit punching of an object deck. "Normally, an output deck is produced except when a severe error has been encountered during compilation. … If the severity code is 5, a deck will not be produced" (J 02.01.01; severity codes: see J Appendix 90.04 / the diagnostics section).
- LIST: produce a symbolic listing of the generated instructions. "Normal compiler action produces no symbolic list" (J 02.01.01).
- DICT: "list the dictionary giving the relative locations of all names used in the object program. Normally a dictionary is not listed" (J 02.01.01).
- LOAD: write the object program on a system utility tape and turn control over to the Loader after compilation. A map is produced if LOGIC was specified. "The program will be executed unless the NOGO option has been taken, or the Compiler has encountered a source program error with a severity code greater than 1 or an undefined symbol in the code which it has generated" (J 02.01.02).
- LOGIC: Loader lists "the origin and extent of all program sections, system subroutines required for execution (including IOCS) and buffer assignments." LOGIC automatically initiates LOAD; unless NOGO is specified the program is also executed (J 02.01.02).
- FILES: a list of the I/O unit assignments made by the Loader is output on SYSOU1 "whether or not the program is to be executed" (J 02.01.02).
- MAP: "an option yet to be specified for obtaining additional load-time information" (J 02.01.02).
- NOGO: Loader does not allow execution after loading; "does not inhibit the LOGIC and FILES options" (J 02.01.02).
- secondary.identifier (columns 55–72): identifying information printed in the heading of the output listing on SYSOU1 and punched in the *CTEND Loader control card. "Any character may be used in any of the positions" (J 02.01.02).
7.2.2 *FINISH card
"The *FINISH card delimits the extent of the source language statements to be compiled" (J 02.01.02):
7
*FINISH
"Note that this card must be followed by an end of file (see 04.02 and 05.03)" (J 02.01.02). In the stacked-job deck, "This card precedes end-of-file on COMPILE jobs" (J 05.03).
Related deck-level facts a compiler writer should know (J 02.02, J 02.03.01): normal output is a relocatable column-binary deck (symbolic control cards, *CTEXT, relative binary program deck with Control Break Table / File Check Table / Text, *CTEND; see the object-deck section, J 90.03); the listing assigns statement numbers of the form xxxxx,00 (clause number after the comma; 9999,99 references errors not confined to a single statement); and "Card serial numbers in columns 1-6 of source decks are not sequence checked by the compiler" (J 02.03.01). F/J divergence: F states serial numbers "will be sequence-checked by the processor" (F p. 37).
7.3 The library system — COPY, LIBRARY, INCLUDE (F design; deferred in J)
7.3.1 The library concept (F)
F envisions a program library holding both procedure and data descriptions. On the procedure side: "If such a routine has been stored in a 'library,' the programmer may be able to call for it by using the verb INCLUDE … This verb, therefore, may be used in building the object program, but it will not be used as a part of the object program itself" (F p. 12). On the data side: "the data description can actually be stored in the library, on tape or in cards, so that it can be called for when needed" (F p. 62). No physical library format or maintenance utility is defined in either manual.
J status: "Mechanization of the INCLUDE verb has been deferred, and consequently no library facilities are currently available" (J 90.01.02). "Implementation of COPY has been deferred" (J 90.01.03). The compiler diagnoses: "-COPY- AND -LIBRARY- ARE NOT YET HANDLED BY SYSTEM." (error 110,00, J 90.04 — the listing's CODE column prints 0 only as a placeholder; the actual severity 1–5 printed with the message is unspecified); so the 1962 compiler recognizes these constructs and diagnoses them, rather than treating them as undefined. INCLUDE and LIBRARY remain reserved (they may not be used as Data or Procedure names, J 02.03.02).
7.3.2 The INCLUDE command (F only)
"The INCLUDE command causes the processor to extract a unit of procedure from the library and to insert it in the present program" (F p. 58). Basic forms (F p. 58):
INCLUDE library.procedure
INCLUDE HERE library.procedure
- The "library.procedure" may be either a sentence or a section of procedure filed in the library under that name. The first form places the procedure "at the end of the present program", normally used for closed subroutines addressed by DO commands, which must be set off from the main flow. INCLUDE HERE inserts the procedure "wherever the command appears", for procedures used in line (F p. 58).
- Renaming the procedure: appending
. . . AS procedure.namereplaces all occurrences of the library procedure-name with the indicated name (F p. 58). - Name substitution within the procedure: appending
. . . WITH new.name.1 FOR old.name.1, new.name.2 FOR
old.name.2, ... new.name.n FOR old.name.n
replaces all occurrences of the old.names with the new.names, "done by the processor at the time the procedure is included" (F p. 58). Full consolidated general form (F p. 109):
INCLUDE [HERE] library.procedure [AS procedure.name] [WITH new.name.1 FOR
old.name.1, new.name.2 FOR old.name.2, ... new.name.n FOR old.name.n]
- Name substitution (processing-time, via INCLUDE) is distinct from data substitution (object-time, via DO … USING/GIVING) (F p. 52).
- Placement rule: INCLUDE, like other processor commands, should be written as an unnamed sentence; "It is perfectly logical … to use INCLUDE HERE following a program command as long as the preceding sentence logically leads to the first sentence of the procedure being included" (F p. 60).
7.3.3 The COPY type code (F pp. 76–77; deferred in J)
"This type code is used to copy a data description previously defined in the program so that it can be used again elsewhere," with a new name and, if desired, new level numbers (F p. 76). Usage: the new name goes in the Data Name columns, COPY in the Type columns, and the original name in the Description columns. "This description must already have been read into the system for the COPY code to be able to operate on it" (F p. 76).
The processor copies the original description in its entirety except: (1) the original name is replaced by the new name; (2) if a new level number is specified, all subordinate level numbers are adjusted to retain their original relationship: e.g. an original sequence 01, 03, 04 copied at level 05 becomes 05, 07, 08 (F p. 76). Worked example (F pp. 76–77): PAY.RCD.DETAIL 02 COPY … PAY.RCD.MASTER expands the whole PAY.RCD.MASTER hierarchy under the new name with levels 02/03/04.
7.3.4 Library names in the Description columns (F only)
The Description columns (38–71) of a data description entry may contain, among other things, "Data names associated with the type codes REDEF and COPY" and "The word LIBRARY, followed by the name of a data description stored in the library"; when several kinds of information appear on one line they must be written in the prescribed order, separated by one or more blanks (F p. 79). "The word LIBRARY, followed by the name of a data description stored in the library, designates a data description which is to be copied. … When a library data description is prescribed, the type code COPY must be used" (F p. 81).
In F's reserved-word list, COND, COPY, FUNCT, LABEL, LIBRARY, PARAM, QUANTITY and REDEF are daggered: "These words have a restricted usage only in data description; they may be used freely in procedure description" (F p. 110). In J, LIBRARY (but not COPY) appears in the key-word list of words that "may not be used as Data or Procedure names" (J 02.03.02); type codes are recognized positionally in the Type columns.
7.4 Program segmentation — OVERLAP and LOAD (F design; deferred in J)
J status: "Implementation of these verbs [LOAD and OVERLAP] has been deferred" (J 90.01.03); "Deferred implementation of the LOAD-OVERLAP verbs implies that programs may not be segmented into separate memory loads at this time" (J 90.01.05). Both remain reserved words in J (J 02.03.02). The following is the F design.
7.4.1 OVERLAP (processor command)
"An object program … is organized as one loading of storage unless the programmer specifies otherwise by means of the OVERLAP command. This command designates portions of the program that are to occupy (at different times) the same area in internal storage" (F p. 55). General form (F p. 55):
OVERLAP procedure.name.1, procedure.name.2, ...
procedure.name.n
Rules and object-program organization (F pp. 55–56):
- The processor sets aside an area large enough to accommodate the longest named procedure; when a shorter procedure is loaded over a longer one, not all of the earlier procedure is erased: "Accordingly, all overlapped procedures should have an unconditional GO TO as the last command."
- Loading an overlapped procedure does not execute it; a GO TO or DO must transfer control to it. "Also, care should be taken to insure that a LOAD command does not appear within the procedure it obliterates."
-
- The initial loading of storage includes all parts of the program not mentioned in any OVERLAP, plus the first procedure named in each OVERLAP command. 2. Procedures not in the initial loading may be called in by a LOAD command. 3. An obliterated procedure may be retrieved in its original form by another LOAD command.
- A procedure named in OVERLAP may be a named sentence; procedures of more than one sentence must be made sections with BEGIN SECTION/END in order to be named (F p. 56; see §2 and F p. 56's HOUSEKEEPING/MAIN.ROUTINE example, in which
SUPERVISOR.1. LOAD MAIN.ROUTINE, GO TO MAIN.ROUTINE.sits outside the overlapped sections andOVERLAP HOUSEKEEPING, MAIN.ROUTINE.is written elsewhere, "probably included with the other processor commands"). - DO, LOAD and OVERLAP are the commands that exploit the BEGIN SECTION/END facility (F p. 57).
7.4.2 LOAD (program command)
General form (F p. 54):
LOAD procedure.name
"procedure.name" is a portion of the program which, at object time, will be waiting in external storage; LOAD brings it into the area shared by the procedures of the associated OVERLAP command, replacing (retrievably) the previous occupant. "Any unit of procedure addressed by a LOAD command must be named in an OVERLAP command" (F p. 54).
Note the F/J structural distinction: LOAD is a program verb (miscellaneous category, with DISPLAY), OVERLAP a processor verb (F p. 35).
7.5 Renaming and linkage — CALL, ENTER, CONTRL
7.5.1 CALL (processor command)
"The CALL command is used to specify alternate names, or synonyms, for previously defined names" (F p. 59). General form (F p. 59):
CALL (old.name.1) new.name.1, (old.name.2) new.name.2, ...
(old.name.n) new.name.n
- "Synonyms are useful as abbreviations for often used names and as a means of communication between parts of a program, written by different programmers, that must refer to common areas of data. Data, work areas, and constants are capable of being named and thus may be renamed by means of this command" (F p. 59).
- "Synonyms must always be single names rather than compound names. A synonym may be applied to a compound name, however," e.g.
CALL (DEPARTMENT.TOTAL HOURS) DEPT.HRS.(F p. 59).
J amplifications and restrictions:
- "The (old.name) in a CALL statement must be unique and may not be subscripted. This requirement is met if the (old.name) appears only once in the Data Description or if sufficient qualifiers are used to identify it uniquely. The use of record.names should be avoided in CALL statements" (J 02.04.05).
- Subscripts in the (old.name) are erroneous: both
CALL (A(J))B.andCALL (A(3))B.are given as incorrect (J 90.01.01). - CALL's principal implemented role: reducing a qualified (compound) name to a one-word name so it can be referenced in the Environment Description or in CRYPT instructions, where qualified names are forbidden (J 02.03.03; J 90.01.01; J 02.08.02).
7.5.2 ENTER — entering another language
F design: "The ENTER command instructs the processor to accept statements in another language" (F p. 59):
ENTER coding.language
"To revert to the Commercial Translator language, another ENTER command is required, specifically: ENTER COMMERCIAL TRANSLATOR." Details of the particular symbolic languages were left to the processor publications (F p. 59).
F/J divergence (implemented forms): "There are only two forms which this command may take: ENTER CRYPT and ENTER COMMERCIAL TRANSLATOR. The first form signals the processor that the following instructions are to be processed by CRYPT, the SCAT-like machine symbolic assembler of Commercial Translator. The second form … terminates the processing of CRYPT instructions and signals that Commercial Translator statements follow" (J 02.04.02.01). No other coding language can be entered in the 709/7090 implementation; there is no other inter-language linkage facility at the language level. (System subroutines such as IOCS are linked automatically by the Loader; cf. the LOGIC option, J 02.01.02.)
The returning form is punched with ENTER as an operation code and COMMERCIAL TRANSLATOR as a variable-field entry beginning in column 16 of the SHARE coding form (J 02.08.03).
7.5.3 Inter-program linkage
Language-level linkage between separately compiled COMTRAN programs is the CONTRL card mechanism (§7.1.8) (common procedure/data areas equated at load time via a 6-character loadnm) and it is deferred in J (J 90.01.04). Parameter passing at the language level exists only within a program, via DO … USING/GIVING and BEGIN SECTION USING … GIVING (F pp. 57–58; see §4, Procedure description). The associated Data Description type codes PARAM and FUNCT "are no longer in the language" in J (J 02.05.03), a further F/J divergence.
7.6 Commentary conventions — NOTE and the period-blank rule
"The NOTE command enables the programmer to place explanatory information in the listing of the program" (F p. 59). General form (F p. 59):
NOTE any sentence.
- "This command affects only the program listing, not the program itself. The sentence introduced by NOTE will not produce instructions in the object program. Any combination of characters from the allowable character set may be placed after the verb NOTE. … The NOTE command is terminated by the first period that is followed by a blank" (F p. 59). Examples:
NOTE START OF MERGE 1.(F p. 59),NOTE INVENTORY RECORD MAINTENANCE.(F p. 8). - Like other processor commands (except BEGIN SECTION and END), NOTE should be written as an unnamed sentence, so no program command can transfer control to it (F p. 60). Processor and program commands may not be intermixed within one sentence:
IF A = B THEN … OTHERWISE OVERLAP …is meaningless (F p. 60). - NOTE is reserved: it may not be used as a Data or Procedure name (J 02.03.02; F p. 110).
Additional commentary channel in J: "Procedure statements are terminated by the first period (.) followed by a blank. Any information following this period blank is considered to be commentary" (J 02.03.01); a period-blank "terminates analysis of the statement except when they appear within an alphabetic literal; any information in the same card which follows the period is assumed to be commentary. No diagnostic comment is made" (J 90.01.03). The period-blank terminator is not used in the Data and Environment divisions (J 02.03.02; J 02.06.02).
7.7 The CRYPT facility — 709/7090 machine symbolic language (J 02.08)
CRYPT exists only in J; F merely promises access to "the symbolic 'one-for-one' language of the particular machine system" via ENTER (F p. 59).
7.7.1 What it is and where it may appear
"The 709/7090 Commercial Translator System provides the programmer with the ability to include symbolic machine language instructions and data description at any logical point in his program. The procedure command, 'ENTER CRYPT' signals the System that the ensuing source statements are in symbolic machine language form. The object instructions generated from these statements will be located immediately following the last word generated from the preceding Commercial Translator statement. The symbolic machine language acceptable to the system is similar to SCAT, with several restrictions and some additional flexibility. The standard SHARE 709/7090 coding form is used for CRYPT statements" (J 02.08.01). Compilation of CRYPT is part of the compiler's normal input alongside the three divisions (J 02.00.00). Processing of CRYPT instructions is terminated by ENTER COMMERCIAL TRANSLATOR (J 02.08.03; §7.5.2).
7.7.2 CRYPT rules (restrictions relative to SCAT) (J 02.08.01–02.08.02)
- The Commercial Translator special characters cannot be used as part of symbols; "The same rules which are applied to Commercial Translator names are applied to CRYPT names." Examples of illegal or specialized usage:
L(5)is interpreted as the fifth element of array L;.AB.: a period may not be the first or last character of a symbol;A'B)$: quotation mark, left parenthesis, right parenthesis and dollar sign may not be part of a symbol (J 02.08.01). - "No SCAT macros are acceptable" (J 02.08.01).
- Pseudo-ops usable:
OCT,PZE, etc. (both MZE and FOR sets),EQU,BSS,BES,BCI(J 02.08.01). - Pseudo-ops not usable:
HEAD,VFD,DEC,DUP,ORG,SYN,END(J 02.08.02). - "Literals are not presently permitted in machine language" (J 02.08.02).
- Qualified names may not be referenced by CRYPT instructions (
CLA MASTER NAMEis incorrect); CALL may be used to reduce a qualified name to a single unique name (J 90.01.01; J 02.03.03).
7.7.3 Flexibility above SCAT (J 02.08.02)
- Names defined in the Commercial Translator sections may be referenced in the variable field, so variable-field names may contain up to 30 characters (compound names excepted; rename via CALL outside the CRYPT section).
- Array elements are addressed through "Symbolic Registers":
CLA A(I,J)is replaced byCLA* SRAIJ, where the Symbolic Register always contains the address of the element for the present values of I and J. "The system will not check for changes in component variables while in the machine language mode"; the Symbolic Register is not updated if the programmer changes I or J in CRYPT. "Also, indirect addressing is not permitted on the original operation." - Arithmetic expressions in the variable field may contain parentheses, e.g.
AXT A*(B + C),4. - The Commercial Translator Data Description form serves for describing data and entering constants (no DEC/VFD needed).
7.7.4 Generated-code caveats (J 02.08.03)
References to fields of records processed in locate mode do not expand one-for-one. For CLA DATE where DATE is a field of a located record, the system generates:
LAC BASE.LOCATOR.OF.DATE,4
TXL SYS)294,4,0
CLA DATE.DISP,4
where BASE.LOCATOR.OF.DATE holds the current origin of the record, SYS)294 is an error routine reporting an unset base locator, and DATE.DISP is the field's displacement within the record. "Note that the contents of index register 4 are destroyed, and that instructions have been inserted in the program. Care must be taken to avoid incorrect referencing when relative addressing using * to signify the location counter is used" (J 02.08.03). (Generated-code details: see the generated-code section, J 90.02.)
7.8 F/J divergence summary for this section
| Feature | F28-8043 (June 1960) | J28-6169 (Jan 1962), authoritative |
|---|---|---|
| Environment Description content | Division reserved (*ENVIRONMENT, F p. 27) but undefined; deferred to processor manuals (F p. 71) |
Fully defined: FILE, SPECIF, POOL, GROUP, CONTRL, OPTION, COND cards (J 02.06) |
| Library facilities | INCLUDE, COPY, LIBRARY defined (F pp. 58, 76, 81) | All deferred; "no library facilities are currently available" (J 90.01.02–03; error 110,00, J 90.04) |
| LOAD / OVERLAP segmentation | Defined (F pp. 54–56) | Deferred; no segmented memory loads (J 90.01.03, 90.01.05) |
| Multi-program combination (CONTRL) | Not in F | Defined (J 02.06.15) but mechanization deferred; no control break table punched or processed (J 90.01.04–05) |
| ENTER | ENTER coding.language, open-ended (F p. 59) |
Exactly two forms: ENTER CRYPT, ENTER COMMERCIAL TRANSLATOR (J 02.04.02.01) |
| CRYPT | Not defined (implied by ENTER) | Fully defined SCAT-like assembler (J 02.08) |
| PARAM / FUNCT type codes | Defined (F pp. 73) | "no longer in the language" (J 02.05.03) |
| CALL | Synonyms for previously defined names (F p. 59) | Same, plus: old.name unique, no subscripts, avoid record.names (J 02.04.05, 90.01.01) |
| NOTE | Defined (F p. 59) | Unchanged in substance; period-blank commentary rule amplified (J 02.03.01, 90.01.03) |
| Serial-number sequence checking | "will be sequence-checked by the processor" (F p. 37) | "not sequence checked by the compiler" (J 02.03.01) |
| Compiler control cards | Not in F | $CMPLE, *FINISH (J 02.01) |
| Checkpoint facility | Not in F | FILE CHECKPOINT + SPECIF CHECKC/CHECKF (J 02.06.04, 02.06.11) |