COBOL-Its relationship with other American national standards

COBOL-Its relationship with other
American national standards
by L. ARNOLD JOHNSON, PATRICK M. HOYT and GEORGE N. BAIRD
Department of the Navy
Washington, DC
INTRODUCTION
The standards which interface with COBOL can effect the
degree of machine independence a COBOL program has.
COBOL 74 1 provides the capability to process the standard
coded character set defined by the American National
Standard Code for Information Interchange (ASCII). 2 In that'
regard, COBOL 74 relies on the ASCII Standard for defining
the character codes and the collating sequence that are to
be reflected by the program when processing that particular
character code. Additionally, COBOL can specify that
ASCII be recorded on external media such as punch cards 3
or magnetic tape 4 with magnetic tape labels. 5 If that data is
to be used for information interchange, then the recording
of the data should be in accordance with the respective
media standards. The American National Standards which·
interface with COBOL must be properly defined and implemented on a computer system for a COBOL program to be
independent of the computer system. In the process of validating COBOL compilers, we use these other American
National Standards related to COBOL and have found that
data cannot be eaSIly transported between computer systems.
ANSC X3 ROLE IN COBOL AND RELATED
STANDARDS
American National Standard Committee X3 through its
three standing committees is responsible for the standardization of COBOL and other subjects related to systems,
computer equipments, devices and media for information
processing. 6 Three committees assist X3 in discharging its
responsibilities concerning the administration, evaluation,
allocation and scheduling of standards projects. The Standards Planning and Requirements Committee (SPARC) and
the International Advisory Committee (lAC) of X3 have
staff responsibilities while the Standards Steering Committee (SSC) has line responsibilities. The lAC is responsible
for coordinating the work of ANSC X3 with respect to
international organizations. The purpose of SPARC is to
review the need for standards, make recommendations to
X3 on the desirability of standards and determine that work
of the technical committees is responsive to the original
objective of the standardization project. The administrative
arm of X3 is the Standards Steering Committee which monitors and coordinates the standards projects that are being
developed by the project groups. Individual projects are .
classified as being in one of three project groups, hardware,
software or systems. The technical committees (established
for each individual project) designated for the development
and maintenance of American National Standards for
COBOL, character codes, magnetic tape labels, and data
representation are part of the software group. Technical
committees for the standardization of physical media asso- .
ciated with magnetic tape and punched cards are included
in the hardware group.
The basic objectives of the American National Standards
Institute (ANSI) as well as its subordinate committees are
the (1) promulgating of standards, (2) coordination of standards development, (3) establishment of standards, and (4)
exchange of information. The underlying purpose of the
COBOL standard is to "promote a high degree of machine
independence in such programs in order to permit their use
on a variety of automatic data processing systems."* Further, one of the criteria used by ANSC X3J4 (technical
committee for COBOL standardization) for considering a
COBOL element as a candidate in the 1974 COBOL standard was its compatibility with other standards. A philosophy
similar to COBOL is reflected in the standards associated
with magnetic tape, punched cards, magnetic tapes labels
and standard coded character set in that these standards are
concerned with a common format for informatio,n interchange between computer systems. Based on experiences
noted later in this paper, there is a question as to whether
COBOL and related standards, as yet are fully effective in
providing information interchange.
STANDARDS INTERFACING WITH COBOL
There are five different American National Standards
which may either directly or indirectly interface with American National Standard Programming Language COBOL,
* See Paragraph 1.1, page 1-1 in Reference 1.
1113
From the collection of the Computer History Museum (www.computerhistory.org)
1114
National Computer Conference, 1978
X3.23-1974. The COBOL 74 Standard conveniently includes
the language syntax which make these interfaces possible
and thereby provides a common definition for the purpose
of data interchange. American National Standard Code for
Information Interchange (ASCII) is the common character
code used for the interchange of data. Ideally, a standard
data interchange on punched cards or magnetic tape is possible between computer systems when ASCII together with
the appropriate American National Standards for punched
cards or for recorded magnetic tape and magnetic tape labels
are used. For data interchange as well as program interchange to be possible, a fundamental assumption is that
each of the computer systems between which the data interchange is to occur must implement and support the applicable ADP standards.
Until COBOL 74, there was no definition within the
COBOL language which allowed for the designation of a
program collating sequence or how data would be represented on external media. Without such a definition each
implementor was permitted to use his own techniques regarding the character collating sequence used, recording of
signed data on external media, and the character code used
for external media. The facilities in COBOL 74 for defining
the collating sequence, the character code and representation of signed data are the COBOL features associated with
the PROGRAM COLLATING SEQUENCE clause, CODESET clause, alphabet-name clause and SIGN SEPARATE
clause. For the first time, it is possible for COBOL programs
to read, process and produce data that is interchangeable in
accordance with related ADP standards.
COBOL 74
The COBOL language feature by which ASCII is written
to or read from an external media is the CODE-SET clause
plus an associated alphabet-name clause. The CODE-SET
clause in an optional clause of the File Description Entry in
a COBOL program. When it is present, this clause specifies
the character code convention used on the external media.
Any conversion that may be required of the code, as represented internally in the computer system, and the code as
represented on the external media occurs during execution
of either an input or output operation (a READ or WRITE
statement). The construct of the CODE-SET clause is
"CODE-SET IS alphabet-name." Alphabet-name is defined
in the SPECIAL-NAMES paragraph and has the form:
I h b t
IS
a p a e -name
STANDARD-l
)
NATIVE
implementor-name
literal
1
When the STANDARD-l phrase is specified, the character
code or collating sequence identified is that defined by the
American National Standard Code for Information Interchange, X3.4-1976. Each character of the standard character
set is associated with a corresponding character of the native
character code. Note the COBOL Standard does not require that the computer system's architecture use ASCII,
only that the computer system and associated COBOL compiler process the character code as if it were ASCII.
The ASCII character code standard defines the bit configuration for representing characters in the standard data
format. The value of numeric fields may be represented in
either binary or decimal form depending on the equipment.
If more than one type of numeric representation is available
for a computer system, this selection may be specified
through COBOL by use of the USAGE clause. The .two
options of the USAGE clause are COMPUTATIONAL (binary) and DISPLAY (decimal). Therefore, in order to produce ASCII on an external media via COBOL, data descriptions for the file must be explicitly or implicitly defined as
DISPLAY.
Another factor which effects the ability to interchange
data between systems is the representation of signed data.
The positive or negative characteristic of a numeric value
may have, as many possible representations. Signs may be
represented as part of the bit configuration associated with
the high order or low order position of the numeric value.
Signs also may be represented as a separate character which
may be either leading or trailing. Since the ASCII character
code does not provide for signed data values, the sign characteristic of a numeric value must be carried as a separate
character. This is defined through COBOL using the SIGN
SEPARATE clause.
Data is only interchangeable if the sequence of data is
characteristic of the character code selected and the COBOL
program processes it accordingly. This sequence is controlled within the COBOL program by use of the PROGRAM COLLATING SEQUENCE IS alphabet-name
clause located in the OBJECT-COMPUTER paragraph. The
PROGRAM COLLATING SEQUENCE clause is optional,
but if specified, the program uses the collating sequence
defined by a corresponding alphabet-name clause. If the
alphabet-name clause specifies the ASCII character code
(alphabet-name option STANDARD-I) then all nonnumeric
comparisons for any relation conditions during program execution should reflect the ASCII code collating sequence.
AMERICAN NATIONAL STANDARD CODE FOR
INFORMATION INTERCHANGE (ASCII)
ASCII is the standard coded character set to .be used for
information interchange among information processing systems. The ASCII Standard describes the code insofar as the
bit arrangement or configuration relates to an associated
graphic character. A minimum of 7 bits is used to represent
an ASCII code character. The Standard does not define
the means by which the code set is to be recorded in any
physical medium but there is a bit relationship with the
ASCII code to other standards such as the American National Standard Recorded Magnetic Tape for Information
Interchange, X3.39-1973 (1600 CPI, PE) and also X3.22-1973
(800 CPI, NRZI). For COBOL to produce or recognize
ASCII data, the language feature CODE-SET in combina-
From the collection of the Computer History Museum (www.computerhistory.org)
COBOL
tion with the STANDARD-1 option of the alphabet-name
clause is required.
The binary bit pattern of the character code gives a collating sequence position for each character in the code. For
an implementation to support the ASCII standard, the computer system must be capable of not only accepting and
producing ASCII, but also must be able to process ASCII
coded data in the proper collating sequence.
AMERICAN NATIONAL STANDARD HOLLERITH
PUNCHED CARD CODE X3.26-1970
The Hollerith Punched Card Code Standard specified 256
Hole-pattern in twelve-row punched cards. These Hole-patterns are assigned to the 128 characters of 7-bit ASCII and
to 128 additional characters for use in 8-bit coded systems.
This standard relates these punched Hole-patterns to a particular bit pattern in an 8-bit data system. An example of
such a system noted in this standard is the American National Standard Recorded Magnetic Tape for Information
Interchange (800 CPI, NRZI) , X3.22-l973. In addition to
relating Hole-patterns to a particular bit construct, the code
table presented in this standard also associates a graphic
character to that particular position within the table.
Columns 0-7 of the table correspond to the bit pattern and
associated graphic character of that defined in the ASCII
standard. The standard does not specify a card sorting sequence; however, when we consider the bit patterns of any
two ASCII characters there is a well-defined sequence relationship.
Since the CODE-SET clause gives COBOL the capability
to specify the character code convention used to represent
data on the external media (such as punched cards) a relationship does exist through the ASCII character code standard for a COBOL program to accept, process, and create
data on punched cards in accordance with X3.26-1970.
AMERICAN NATIONAL STANDARD MAGNETIC
TAPE LABELS FOR INFORMATION
INTERCHANGE, X3.27-l976
The magnetic tape label standard gives specifications for
the recording of magnetically recorded labels on magnetic
tapes used for information interchange. Rather than specify
how the labels of the tape are to be processed or the data
bit structure on the tape, this Standard identifies the information and the structure of tape labels that are recorded on
tape. As such, the tape label standard is applicable to either
7 track or 9 track magnetic tape.
The standard makes note of the fact that the physical
recording size of labels may be larger than the required 80
characters subject to hardware constraints. These 80-character records are grouped together based on their respective
locations on tape related to beginning of tape volume, beginning of file, end of the file and end of tape volume. A
1115
tape mark, both before and after the file data, separates a
label record group from the file data. Each label record is
uniquely recognized by the first four characters in that record. A record group may have one or more records depending on the implementation and an agreement between the
data interchange parties. For a single volume tape all label
records are optional except for label records identified as
VOL1, HDRI and EOFI which respectively define the beginning of the volume or tape, header label for beginning of
each data file, and label record immediately following the
data file. An illustration follows:
VOL1----HDR1---*File Data*t
EOF1----**
The tape label standard identifies the information and the
data category (numeric or alphanumeric) that is to be stored
in each field of the label record. ASCII is mentioned by the
standard as a character code which can be used; however,
the standard is applicable to any code structure. Certain
fields of the label records are designated as optional by the
standard. These optional fields may be recognized and processed or may be ignored at the option of the implementor.
COBOL includes provisions for specifying labels for data
files through the LABEL RECORD STANDARD clause of
the File Description Entry. However, COBOL 74 does not
describe the format, structure, or content of file labels. It
states only that file labels will be present when the clause
is specified. If an implementation claims support of the tape
label standard for use with COBOL, then the implementor
should be expected to accept and process ANS tape labels
on input, process those tape labels and create ANS tape
labels on output, both in accordance with the ~agnetic tape
label standard, X3.27-l976.
AMERICAN NATIONAL STANDARD RECORDED
MAGNETIC TAPE FOR INFORMATION
INTERCHANGE (800 CPI, NRZI), X3.22-l973 AND
(1600 CPI, PE), X3.39-l973
The standards X3.22-l973 and X3.39-1973 for recorded
magnetic tape provide specifications for the format andrecording of half inch, 9-track magnetic tape to be used for
information interchange with systems and associated equipment utilizing the ASCII code, X3.4-l976. These standards
define the physical requirements for magnetic tape and the
bit pattern for the recording of information on 9-track tape.
Seven of the nine tracks are used for data; one track is used
for character parity; and one track is treated as a bit of
higher order than ASCII bits (shall be a zero bit). Each of
the tracks used for the recording of data are assigned a
particular bit identification which corresponds to the bit
assignment used by the ASCII character code standard.
COBOL 74 does not reference the recorded magnetic tape
standards; however, it includes COBOL syntax and general
rules governing the semantics for the COBOL statements
which apply specifically to .the treatment of files on magnetic
tEach "'" represents a tape mark.
From the collection of the Computer History Museum (www.computerhistory.org)
1116
National Computer Conference, 1978
tape. Within COBOL 74, Sequential 1-0 module statements
such as the CLOSE REEL, CLOSE WITH NO REWIND,
OPEN WITH NO REWIND and OPEN REVERSED are
used to specify the actions for files stored on tape or analogous sequential media. Also the general rules associated
with the READ and WRITE verbs define the actions to be
taken when an end of reel is recognized during a read or
write.
label standard, then tape labels conforming to ANS X3.271976 are placed on the magnetic tapes. If the system under
test does not support ANSI tape labels then the magnetic .
tapes for the validation were supplied without tape labels.
To recognize a system under test as being in full support
of COBOL and associated data related standards, the system
is expected to do the following:
(1) Compile and execute the audit routines (CCVS pro-
USING COBOL WITH RELATED STANDARDS
Programs written in compliance with the 1974 COBOL
Standard language specification do not necessarily accept or
produce data files that comply with the other data processing
standards on many systems. Part of our work, here at the
Federal COBOL Compiler Testing Service, involves the validation of COBOL compilers with respect to FederalStandard COBOL s (ANS, X3.23-1974 COBOL). Because we are
continuously implementing the COBOL Compiler Validation
System (CCVS)9 on different computer systems, the underlying purposes for which standards are developed are of
vital importance to our operations. More importantly, we
test COBOL compilers and as part of those tests we validate
the compiler's capability to read, process and write ASCII
in accordance with the 1974 COBOL Standard.
Briefly stated, the 1974 CCVS consists of some 250
COBOL programs which collectively test a COBOL compiler's conformance to COBOL 74 language syntax and semantics. That part of the CCVS used to validate the compiler's ASCII capability consist of three COBOL programs,
an ASCII-encoded punched card deck, and an ASCII-encoded magnetic tape. The ASCII validation requires three
steps. In the first step, the first of the three-program set
produces an ASCII-encoded magnetic tape and punched
card file. The two remaining COBOL programs read and
check the files produced by the first COBOL program. For
the second step, the two programs which read and check
the ASCII-encoded files are again executed. However, for
this run they use as inputs an ASCII-encoded tape file and
punched card file produced on another computer system.
The purpose of this run is to validate that the compiler/
computer system being tested is capable of processing
ASCII (represented both on magnetic tape and punched
cards) that was produced by another computer system in
accordance with the appropriate American National Standards. The final step is to take the magnetic tape and punched
card file produced during the validation to a different computer system for further checking. The purpose of this latter
step is to determine whether the compiler/computer system
being tested can also produce ASCII (represented both on
magnetic tape and punched cards) which is capable of being
processed on another computer system.
Since COBOL 74 is not definitive regarding labels that are
used for magnetic tape, the labels used for the ASCII portion
of the compiler validation are dependent on the system
under test. If the system under test supports the ANSI tape
(2)
(3)
(4)
(5)
grams) that conform to the 1974 COBOL Standard
(ANS X3.23-1974) without requiring any modifications
to the source code,
Pass all the semantic tests made by the audit routines
as reflected in the execution report of each audit routine,
Accept ASCII-encoded (ANS X3.4-1976) data files
from tape and punched cards that conform to the Magnetic Tape Standard (ANS X3.22-1973 and ANSI
X3.39-1973) and Hollerith Punched Card Code Standard (ANS X3.26-1970) respectively,
Produce ASCII -encod~d data files on tape and
punched cards that conform to the same standards
noted in 3 above, and
Accept and produce magnetic tapes containing magnetic tape labels that conform to Magnetic Tape Label
Standard (ANS X3.27-1976).
Very few of the compiler/computer systems validated to
date were successful in meeting all of the above criteria.
The type of problems that were found follow:
(0 Date recording formats unacceptable. One system
tested resulted in an end of file condition occurring
after processing the first record of a 50 record tape
file. Another system could not read either a labeled or
an unlabeled magnetic tape. However, this same system, for some unexplained reason, was able to create
a tape that, when read on another computer system,
proved to be correct according to applicable standards.
(2) Data code not read or recorded correctly. One system
tested produced records on tape which included an
additional character located in the first character position of each record thus causing the contents of the
record to be offset by one character. Another system
did not provide proper character translation of all
ASCII characters when reading punched cards.
(3) Incompatible Tape labels. Some systems tested simply did not support ANSI tape labels while others
required the presence of optional labels HDR2 and
EOF2.
(4) Non-standard COBOL syntax. One system tested required that the nonstandard clause "RECORDING
MODE IS STANDARD-ASCII" be added to the SELECT Entry for all tape files. (The CODE-SET clause
in the File Description Entry should have accomplished this function). One system, oddly enough,
From the collection of the Computer History Museum (www.computerhistory.org)
COBOL
could properly read and write ASCII on punched cards
only when the CODE-SET clause was removed from
the program.
1117
CONCLUSION
A number of special considerations were necessary in
order to process ASCII. Some implementations required
that specific hardware models of magnetic tape and card
readers/punches be used. Others required that specific options be invoked through the job control language, and still
others required particular system generation parameters be
used when the operating system is generated.
One thing became quite apparent while testing the interfaces
to ASCII and other standards related to COBOL. Even
when strict adherence to American National Standards is
maintained, COBOL programs and associated data files are
not easily interchangeable among computer systems. This,
in part, is due to improper implementation of ADP Standards
by the parties involved in the interchange. Another factor
is that the goals and objectives of X3 do not emphasize the
compatibility of related standards or encourage interaction
of related standards.
IMPACT OF COBOL 74 REVISION WITH REGARD TO
OTHER STANDARDS
REFERENCES
1. American National Standard Programming Language COBOL, X3.23-
In looking to the future to see how the revision to COBOL
74 might affect the interfaces of COBOL with related standards, it appears that there will be little or no impact. In a
sense this is unfortunate because the COBOL standard could
give more guidance as to the type of file labels that are to
be used. The only feature for defining file labels within
COBOL is via the LABEL RECORD STANDARD clause,
which in COBOL 74 merely requires that labels will be
present and conform to the implementor's label specifications.
The difficulty most often found in transporting magnetic
tape files between computer systems, next to improper implementation of standards related to COBOL, was the tape
label. Many COBOL compiler/computer systems tested did
not support ANSI magnetic tape labels. If the COBOL interface mechanisms for ANSI magnetic tape labels were
similar in detail to the interfaces now present for ASCII,
COBOL would have a direct link to another American National Standard.
2.
3.
4.
5.
6.
7.
8.
9.
1974, American National Standards Institute Incorporated, New York,
1974
American National Standard Code for Information Interchange, X3.41976, American National Standards Institute Incorporated, New York,
1976
American National Standard Hollerith Punched Card Code, X3.26-1970,
American National Standards Institute Incorporated, New York, 1970
American National Standard Recorded Magnetic Tape for Information
Interchange (800 CPl, NRZI), X3.22-1973, American National Standards
Institute Incorporated, New York, 1973
American National Standard Magnetic Tape Labels for Information Interchange, X3.27-1976, American National Standards Institute Incorporated, New York, 1976
Hill, MaIjorie F., The World ofEDP Standards, Control Data Corporation,
Tech Memo TM4, 1972
American National Standard Recorded Magnetic Tape for Information
Interchange (1600 CPl, Phase Encoded), X3.39-1973, American National
Standards Institute Incorporated, New York, 1973
Federal Information Processing Standards, Publication 21-1 COBOL, U.
S. Government Printing Office, Washington, D.C., 1975
CCVS Users Guide Version 3.0, available from the National Technical
Information Service, U.S. Department of Commerce, 5285 Port Royal
Road, Springfield, Virginia 22151
From the collection of the Computer History Museum (www.computerhistory.org)
From the collection of the Computer History Museum (www.computerhistory.org)