iFERENCJ

JNITEO STATES PARTMENT OF IMMERCE

1BUCATION

*><tis e>

NBS TECHNICAL NOTE 700

175101

Qt\0O H ccr 14 7975

COMBO:

A General-Purpose Program

for Searching, Annotating,

Encoding-Decoding,

and Reformatting Data Files

U.S. PARTMENT

OF

OMMERCE

National

1 00 °s J5753
NATIONAL BUREAU OF STANDARDS

The National Bureau of Standards1 was established by an act of Congress March 3, 1901. The Bureau's overall goal is to strengthen and advance the Nation's science and

technology and facilitate their effective application for public benefit. To this end, the Bureau conducts research and provides: (1) a basis for the Nation's physical measure- ment system, (2) scientific and technological services for industry and government, (3) a technical basis for equity in trade, and (4) technical services to promote public safety. The Bureau consists of the Institute for Basic Standards, the Institute for Materials Research, the Institute for Applied Technology, the Center for Computer Sciences and

Technology, and the Office for Information Programs. THE INSTITUTE FOR BASIC STANDARDS provides the central basis within the United States of a complete and consistent system of physical measurement; coordinates

that system with measurement systems of other nations; and furnishes essential services leading to accurate and uniform physical measurements throughout the Nation's scientific community, industry, and commerce. The Institute consists of a Center for Radiation Research, an Office of Measurement Services and the following divisions: Applied Mathematics—Electricity—Heat—Mechanics—Optical Physics—Linac

Radiation2—Nuclear Radiation2—Applied Radiation2—Quantum Electronics3—

Electromagnetics3—Time and Frequency3—Laboratory Astrophysics3—Cryogenics3

. THE INSTITUTE FOR MATERIALS RESEARCH conducts materials research lead- ing to improved methods of measurement, standards, and data on the properties of

well-characterized materials needed by industry, commerce, educational institutions, and

Government; provides advisory and research services to other Government agencies; and develops, produces, and distributes standard reference materials. The Institute consists of the Office of Standard Reference Materials and the following divisions: Analytical Chemistry—Polymers—Metallurgy—Inorganic Materials—Reactor

Radiation—Physical Chemistry.

THE INSTITUTE FOR APPLIED TECHNOLOGY provides technical services to pro- mote the use of available technology and to facilitate technological innovation in industry and Government; cooperates with public and private organizations leading to the development of technological standards (including mandatory safety standards), codes and methods of test; and provides technical advice and services to Government agencies upon request. The Institute also monitors NBS engineering standards activities and

provides liaison between NBS and national and international engineering standards

bodies. The Institute consists of a Center for Building Technology and the following

divisions and offices: Engineering Standards Services—Weights and Measures—Invention and Innovation—Product Evaluation Technology—Electronic Technology—Technical

Analysis—Measurement Engineering—Fire Technology—Housing Technology4 —Federal Building Technology4—Building Standards and Codes Services4—

Building Environment4—Structures, Materials and Life Safety4—Technical Evaluation and Application4

. THE CENTER FOR COMPUTER SCIENCES AND TECHNOLOGY conducts re- search and provides technical services designed to aid Government agencies in improving cost effectiveness in the conduct of their programs through the selection, acquisition, and effective utilization of automatic data processing equipment; and serves as the principal focus within the executive branch for the development of Federal standards for automatic data processing equipment, techniques, and computer languages. The Center

consists of the following offices and divisions: Information Processing Standards—Computer Information—Computer Services —Systems Development-—Information Processing Technology.

THE OFFICE FOR INFORMATION PROGRAMS promotes optimum dissemination and accessibility of scientific information generated within NBS and other agencies of

the Federal Government; promotes the development of the National Standard Reference Data System and a system of information analysis centers dealing with the broader

aspects of the National Measurement System; provides appropriate services to ensure

that the NBS staff has optimum accessibility to the scientific information of the world, and directs the public information activities of the Bureau. The Office consists of the following organizational units: Office of Standard Reference Data—Office of Technical Information and

Publications—Library—Office of International Relations.

1 Headquarters and Laboratories at Gaithersburg, Maryland, unless otherwise noted ; mailing address Washington, D.C. 20234.
ONAL BUnSflU CF STAHDflROS

JAN 2 4 ig^

""H^-fL 0-><<<!^ -tfLtAqcioo i ~]

Lo .700 COMBO:

t

/c?7 ^

A General-Purpose Program

[ For Searching, Annotating,

I Encoding-Decoding, and Reformatting

Data Files

Robert McClenon and Joseph Hilsenrath

Data Systems Design Group

Office of Standard Reference Data

*W<4' National Bureau of Standards

' Washington, D.C. 20234 -< no. 700

*. ^

St4Tt% O* f $£

U.S. DEPARTMENT OF COMMERCE, Peter G. Peterson, Secretory

NATIONAL BUREAU OF STANDARDS, Lawrence M. Kushner, Acting Director,

Issued September 1972
National Bureau of Standards Technical Note 700

Nat. Bur. Stand. (U.S.), Tech. Note 700, 68 pages (Sept. 1972) CODEN: NBTNAE

For sale by the Superintendent of Documents, U.S. Government Printing Office Washington, D.C. 20402 - Price 75 cents

Stock Number 0303-0921
CONTENTS

1. Introduction 1

2. Overall Design of COMBO 2

3. Discussion of the Subroutines 6

4. Applications of COMBO 12

5. Control Cards 17

6. Special Characteristics of COMBO 20

7. Afterword 21

References 22

r.l Appendices

I. Control Card'. Printout 23

II. Annotated Control Cards 27

III. Program Listings 31

COMBO 32

BSENS 35

UNBLOK 37

INPUT 38

LINTYP 41

TAPOUT 42

MSERCH 45

MSUBS 48

SUNLK 54

SULOCK 55

MXREFM 55

COMBO: A General- Purpose Program for Searching,

Annotating, Encoding-Decoding and Reformatting Data Files

by

Robert McClenon and Joseph llilsenrath

COMBO, a FORTRAN program for searching magnetic tape files, generating

reports, and reformatting the file, is described and listed. The program

is capable of reading separate card images from a file blocked in physical

records and recognizing logical blocks marked by a fixed-field ID. Up to

99 different types of lines, each with its own format, can be recognized by

examining a special code or label. The program can be instructed to search

for the occurrence of each of certain character strings, using a different

list for each type of line and two levels of Boolean logic. Lines can be

broken into pieces, using either a fixed-field format or a single separator

or flags to define the pieces, and the pieces can be rearranged, with

labels or comments optionally inserted between them. Editing, in which

specified strings are replaced by other strings, can also be performed.

The program can accommodate a variable number of cards of each type per

block. It was assembled from general-purpose subroutines of modular design

and is substantially machine-independent.

Keywords: Alphanumeric data files; data retrieval; editing program; file

editor; FORTRAN program; general-purpose modular programming; reformatting

program; report generator; searching program.

1. Introduction

Conventional methods of computer software development involve

determining the specific needs which the program being written is to serve,

and designing it specially to meet those needs. Usually care is taken to optimize the efficiency of the program. Such custom-made programs are specialized to the particular problem and must be modified if any changes

in operation are desired. Such changes generally require familiarity with

the program and the same degree of skill as the writing of the original

program. This custom approach may be suitable for massive systems programs

such as compilers, which are designed for versatility, or for other

programs which will be used hundreds or thousands of times. But for more modest applications work it has drawbacks. One is the limited utility of

programs written in this manner. While a compiler is intended to process

an unlimited variety of source programs, an ordinary applications program

can usually solve only one specific problem. If another problem, similar

but not identical, must be solved later, extensive changes in the original

program are required. Since many applications programs are run only a few

times after they are debugged, or even only once, a large amount of

programming and debugging time is spent in proportion to the amount of

useful output.

Our own involvement in general-purpose programming dates back to 1961

with the design and implementations of OMNIFORM I [1] and OMNITAB [2,3,4].

The latter is one of the more extensive and successful general-purpose
programs developed for numerical and statistical analysis. OMNI TAB has

found interesting and important applications in fields almost as diverse as FORTRAN itself has. More modest general-purpose programming efforts here

have produced SUBSTITUTE [5], which replaces specified character strings

from a data file by other strings as indicated on control cards; and REFORM

[6] which rearranges fixed-field records and inserts strings according to a user defined plan.

Our preoccupation with general-purpose programs arises from our need

to cope with a large number of diverse data files and systems. Only

recently, since the advent of the software industry, have there appeared

for sale or lease a number of programs of a general-purpose nature.

Prominent among these are a variety of data management and management

informations systems [7,8,9].

It .is our view that many application programmers' and systems

analysts' views on program efficiency are unduly colored by early

experience with primitive compilers and computer systems. As computers

have become faster and as core have grown larger and cheaper, over-all man- machine efficiency considerations often outweigh consideration of optimum

machine use. While these classical concerns are still important for long

repetitive computer runs or for processing large files, they are really not

important for a large fraction of the day to day operations on a modern

computer. Moreover, we have found that, for nonnume.rical applications, on the whole, a special-purpose program written to solve a specific problem

will be no simpler than a general-purpose program capable of solving it and

many other related although not identical problems.

General-purpose programming is greatly facilitated by the use of

subroutines of modular design. This resembles the construction of a house

from prefabricated parts. Just as certain kinds of wall or flooring

components are common to buildings of very different design, certain types

of subroutines are widely used in a variety of differing applications.

Scientific programmers have largely recognized that the same matrix package

may be used for both linear programming and quantum mechanics, and that it

is not necessary to write two separate specialized program. Persons

writing programs for such applications as file management, selective

dissemination of information, information storage and retrieval, and text

editing, on the other hand, have made minimal use of modular subroutines.

Most of them have preferred to write their programs from scratch, much like

a builder refusing to use prefab parts on the assumption they will be the

wrong size or shape.

We have found that in non-numerical file manipulation and information

retrieval, modular subroutines can be as useful and as versatile as in

scientific programming. For example, the SUBSTITUTE program, adapted as a subroutine, can be used for such varied jobs as report generation,

correction of errors, and computer-assisted typesetting. [5,10]

2. Overall Design of COMBO

This report describes a program, COMBO, developed by the Data Systems

Design Group in line with our objectives which include preparing computer

programs for handling the varied data file formats used by the Data Centers

of the National Standard Reference Data System (NSRDS)

.
COMBO provides a searching capability and a report generation facility

for use on magnetic tape files having a certain structure. A listing of

part of such a file, in this case, a file of bibliographic information on molten salts, is shown in Figure 1. The file is blocked in physical

records each consisting of a fixed number of lines or card images. Each

card image contains an identification number in a fixed position (in Figure

1, columns 1 through 5). All those consecutive records having the same ID number make up one item , or entry , or logical block . One entry may include

up to 99 different types of lines, each of them having its own format and

referring to different attributes. Each line contains a code in a fixed

position (in Figure 1, columns 6 and 7) which tells which type it is. (A

in column 6 means the line lists properties covered in a bibliographic

reference. A 30 in columns 6 and 7 indicates a journal card; a 32, a card

listing authors; and an 11, a compound discussed in the paper cited.)

It should be noted that the number of compound cards for one entry is

variable. Many such files, in which several of the same type of line may

occur in one entry, are used in NSRDS and elsewhere. COMBO was designed to handle such files. It processes each card image independently and is thus

able to accept any number of the same type of lines in one entry. Some of

the reformatting programs developed by DSDG [3] interchange pieces between

lines: They permit only one line of each type in an entry, and hence are

not directly applicable to files structured in the above manner.

The program reads all those records referring to one item prior to searching. Then it searches to see whether certain words, phrases, or combinations of phrases are to be found. Two levels of Boolean logic are provided: One can accept all those items for which one or more lines

satisfied the search, or only those for which at least one line of each

type satisfied it; similarly, one can accept any record containing any

search string, or only a record containing all the search strings provided

for the line type. The user has the option of suppressing searching, in

which case every record will be accepted.

If an item satisfies the search it may be edited record by record.

This may be done in two stages. In the first stage, a record is divided

into fields, either by scanning for a specified field delimiter or by using

a fixed origin and width as the field definition. The fields can then be

rearranged, and insert strings may be placed between them. Separate

reformatting instructions may be provided for records referring to each of

the different types of lines.

In the second phase of editing, each line is scanned for the occurrence of specified strings. If any of these strings are found, they

will be replaced by substitution strings. This feature can be used, for

instance, to expand abbreviations or replace numerical codes by alphabetic

information prior to report generation. Once again, separate instructions

for each line type may be provided as to what string substitutions are to be performed. Both stages of editing are optional. (As a trivial case, searching, reformatting, and string substitution may all be suppressed. In that case COMBO will act as a tape print utility.)

After reformatting and string substitution, the selected items will be

printed as a report. Each type of line may also be written onto one or more magnetic tapes. The ability to direct different types of lines to different tape units permits division of a file, or simultaneous abridgment

into several differently abridged files. An item that does not satisfy the

search is skipped, and the program resumes reading the input tape.
010061102IN

010061103LICL-KCL

0100630J. ELECTROCHEM. 0100632LAITINEN H.A. 010070EMF

010071101RACL2

010071102KCL

SOC. 107 7051960

BHATIA B.B

010071180WCL2

010071181M0CL5

010071182RHCL3

010071183RHCL2

010071184PTCL

010071185PTCL2

010071186WCL4

010071187RUCL3

010071188WCL5

010071189RHCL

010071190WCL6

010071191PTCL3

010071192PTCL4

010071193AUCL3

010071194AUCL

010071195CCL4

0100730J. ELECTROCHEM. SOC. 0100732MALMBERG M.S. RUBIN B. 010080CMPF

010081101AGCL-AGN03

0100830CAN. J. CHEM. 0100832WETM0RE F.E. HILL S. 010090EMF

010091101AGN03-NACL-NAA03

0100930J. PHYS. CHEM. 0100932BLANDER M. BRAUNSTEIN J 010100EMF

010101101AGN03 ( NAN03-KN03

)

010101 102NACL ( NAN03-KN03

)

0101030J. PHYS. CHEM. 0101032BLANDER M. HILL D.G. 010110KA

010111101AGCL(KN03)

010111102AGCL2(KN03)

0101130J. PHYS. CHEM. 0101132MANNING D.L. BLANDER M. 010120DECPEMF ....

HAMER W.J.

HILL D.G.

1C3 ,8 1956

32 8641954

6410381960

6518661961

6620691962

BRAUNSTEIN J.

Figure 1. Part of a listing of a bibliographic file on molten salts, suitable for input to COMBO. The tape is

blocked in physical records of 45 80-character images each.

The first five characters of each line are a logical block

ID; the next two are a line type code. Note that the paper

by Laitinen and Bhatia ^contains data on 95 compounds.
( 1 006

( 1 OCA

(01013

(010 13 (01013

(0 10 13 (01013

(01013

(01013

(01013

(010 13 (01013

(01013

(01013

(01C 1 3 (01013

(01013

(01013

(01013

(01013

(01013

(01013

(0101 t (01C 1 4 (01014

(01014

(01015

(01015

(01C15

(0 1015

(01C15

(010 15 (01015

(01015

(01023

(01023

( 01 023

(C1C23

( 01023

(01023

(01023

( 01 023

(01023

(01023

(01023

jKNLjj.ELECi SOC . VOL.107 7 5 19 6 authors:laitinen h.a. ,bhatu b.b.

decp

SYSTEM 8 1 SYSTEM no 2 SYSTfM 803

S

y 5TFm 80 u SYSTEM 80S

SYSTEM UDf, SYSTEM U07

SYSTEM 838

SYSTEM 809

SYSTEM SIC

SYSTEM a 1 1 SYSTEM #12

SYSTEM 8 13 SYSTEM 8 1

4

SYSTEM 815

SYSTEM 8 I ( SYSTEM 8 1 7

NACL

NACL-KCL

NACL-L I Cl

NA8R-KBR

NAI-Kl

KCL-NACL

K I - R 3 1 K

I -CS I KCL

KCL-L ICL

KI-NA

I

KBR-N AB*

RBCL

R6BR

RB I CSCU

CSI

JRNL : z . ELEKTROCHEM.

AUTHORS : NEUMANN B

.

OECP

SYSTEM 801 AL203

JRNLJ2. ELEKTROCHEM.

AUTHORSZDROSSBACh P.

VOL. 31 2871^25

,R IChTER H, ,

VOL, 36 1791930

EKE SYSTEM 8 i SYSTEM «02

SYSTEM 803

SY5TFM « 04

SYSTEM 805

AGCL

PBCL2

Z N C L 2 CDCL2

M 6 C L 2 J R N L : 7 • ELEKTROCHEN.

AUTHOfiSIRAU E.A.

VOL. 40 3521934

, G R V S E G , , DHSL

SVSTE

SYSTE

SY5TE

SYSTF

SYSTE

SYSTE

SYSTE

SYSTE

JRNL : AUTHO

M 801 NAKE04-NAN03

M 8Q2 KRE04-KNC3

K 803 RBRE04-RBN03

M 804 CSHE04-CSN03

M 80S KCL04-KN03

M 806 NASC4-NANP3

M 807 NACR04-NAN03

M 806 N>AN004-NAN'03

J . PH YS . CHEM , RSIKLEPPA O.J.

VOL. 67275 1963

.MESCHEL 5.V. ,

Figure 2. Part of the report generated by COMBO in response

to the control cards shown in Figure 3. A portion of the

tape file used as input to the program is shown in Figure 1. 5
3. Discussion of the Subroutines

COMBO consists of a main program and eleven subroutines. The main

program primarily handles communication between subroutines and the

production of final output. Nine of the subroutines are called by the main

program and can be used separately as part of another system.

The first subroutine called by the main program is called UNBLOK. It

is used to read blocked physical records from a tape and decompose them

into 80-character card images. The tape, of which a partial listing is

shown in Figure 1, is actually formatted in 3600-character (600-word)

blocks. UNBLOK is machine-dependent on the 1108 and its FORTRAN compiler.

It can be replaced with a FORTRAN READ if the input tape is in records of

not more than 132 characters.

UNBLOK returns one card image at a time to the main program. The card

images are then transmitted to a subroutine called BSENS. It scans the ID field and collects card images end-to-end in a block buffer until it

detects a change of ID, indicating a new item. It then signals the main

program and returns the number of lines in the block buffer.

The main program then takes one card image at a time and determines

which type of line it is. It does this by calling a subroutine LINTYP,

which compares the card type code against each of the entries in a dictionary. A number corresponding to the code is returned. If the code

has not been defined, an error message is printed.

The card image is then transmitted with the "type" number to the

search subroutine MSERCH, which scans it for the presence of specified

strings. MSERCH, which was originally written to search a Chemical

Abstracts condensate tape, is adapted from the SEARCH program written by

Carla G. Messina [2]; the main difference is that it provides for up to 99

independent search tables (one for each type of line) rather than one table. Each table can be set up either for an and-search, which is

satisfied only if every strings in the table is found in the line at least

once, or for an or-search, which is satisfied when any one string in the

table is found.

There are two levels of Boolean logic for the search. The first level

is that of the individual table. The second is the overall search

strategy. If the overall search logic is "and," the search ends

unsatisfied when one record on an item fails to satisfy the search, or continues until at least one card image of each type is searched

successfully. An overall "or" search is satisfied when any record

satisfies the criteria, or continues until every record has been

unsuccessfully searched. The overall search logic is written into the main

program.

If the search is unsuccessful, the item is skipped and COMBO proceeds

with the reading of the input tape. If the search is successful, the main

program transmits each line to two editing routines, MXREFM and MSUBS.

MXREFM is an expanded and modified subroutine version of the authors'

REFORM program [3]. It accepts as input a line of text; breaks it into

fragments defined either by fixed columns, or by specified delimiters

separating the pieces, or by a flag preceding each piece; and rearranges

the fragments as directed, placing insert strings between them if desired.

A capability is provided to place each of the fragments, which may be of

variable width, in a fixed-width field, either flush left, flush right, or
ABCDEFGH I JKLMN0PQRSTUVWXYZO 1

7 3 10 4 ,_ b

1 5 80 ]„ d

0%

1 1 30

32

1 ~6R DENS

AND KLEPPAS

BERSHS FINISS 0*0

<>#0 TABLE 2 /(l)/ / /( 11 )/

/( 111 )/ /<UU)/ TABLE 4 TABLE 1 /EMF/

/DEN/

/CMPF/

/KA/

/DECP/

/DBF/

/DBSL/

/EFEN/

/BMX/

/TDY/

/SVEX/

/FEN/

/RAM/

/ELEC/

/CAL/

/HIT/

/ACTC/

/PCEL/

/DENT/

/DENS/

/V. P./ /TDYP/

/V6L/ TABLE 3 /J. AMER. FINIS

SYSTEM *S JRNL;8 AUTH6RS:S

( S

) $ V6LS

/EMF / /DEN / /CMPF / /KA / /DECP / /DHF / /DHSL / /EFEN / /BMX / /TDY / /SVEX / /FEN / /RAM / /ELEC / /CAL / /HIT / /ACTC / /PCEL

/DENT

/DENS

/V. P. /TDYP

/V6L / CHEM. SOC./ /J

The first two cards are read by the main

program. •The third card is read by BSENS. These cards are read by the subroutine

LINTYP and define the line type codes. The percent sign is a universal match

symbol.

This card is read by the main program. These cards are read by the subroutine MSERCH which allows for the searching of each type of line with a different

profile.

These cards are read by the subroutine MSUBS which allows for different sub- stitutions to be made on a line,

depending on the line type code.

S6

S6S6

S6 1 S7 S5 S3

These cards MXREFM.

are read by the subroutine

7 20

8 2 10 20

8 20 70 11 8 IS 32 15 S7 S5 2 37 SS SI 2 S5 S5 3 S7 S5 S2 2 S5 S8 3

These cards define the rearrangement

plan for MXREFM.

Figure 3. Control cards used to explanation of a control card i i Appendix I se

P bol5 facel^^rl^rs-t^f-leLflrom

ed
centereu. MXREFM, unlike REFORM, reformats onlyselecting the format for the particular type of line.

line at a time,

MSUBS

adapted fr

computeriz

Messina'

which it

earlier pr uses the

AMSilii for

Among the case or sh

to nandle

is called

om a program

ed typesett

SUBSTITUTE.

replaces w ogram in tha

one specif

typesetting

se is provi

ift to lower

the shifting

after MXREFM. It known as AMSUB, writ

ing, which used th

Like SUBSTITUTE, MSU

ith substitution st

t it can accommodate

ied for the particu

use have been retaine

sion for use of a spe

case. Two subroutin

IS a stri

ter by Ro

e struct

BS scans

rings

up to 99 lai line

d in MSUB

cial char

es , SUNLK

ng substitution routine

bert C. Thompson for

ure and logic of Mrs. for specified strings

MSUBS differs from the

different tables and

type. Some features of

S but not checked out. acter to shift to upper

and SULOCK, are used

0000204 -) -l -l -l 0000205N0 00YES-1YES-1N0 gono

0000206N0NE HOSP

00002070WN ACT10N08N0NE

-lYfSYESKEPORT 1 F F 1 C E 08REP0RT 2 im Q 00

-1-' -lOfeTRYiMG TO START AuTO

N v E N T ALONE -35^0THERED R A N ( P A N J C ) G 2 G 8 * E M o V E 0000209 -l 0000210GAS0LINE

M I N 2 -1 -! EXPI.0S I ON

3M I N 002 - 1 - 1 -3 -160CARBURET 0R/AUT0

000021 A 1

000021 2A 1- 00002 1 3 A 1 - 00002 1 4 A 1 = 000021 5A "1 - 000021 6A 1 -

2 1 7 A 1 0000218A 1 000021 9A 1 000030 ID/ 1 8

65H I RT

-1 -

- 1 -

-1 -

1 1 S T N U

- 1 -1

-3

- 1

• kOne

-4

-4

-4-4

-4

-4

-3 -1 -1 SPARK/BACKFIRE 01 -30nLY -3

-1 -1YES

-4

-4

01-3

-4

-4-4

-4

-4

-4

-4

-4-4

-4

-4 -4

08COLOOENVER -1 IN 01HQME

0000302028ASEMENT YES114SFRI09176509/20/6S09/20/65YESNO

000030329F WHITE SINGLE 06H0MEMAKER EXACT U92-1-3

02BA5EMENT

NO NO NO-3-3

0000304EXACT 1692RENTEXACT .R •»»• 280 WORDS IN BLOCK

65TESYESKEP0RT 08REPCrT

4 »»••• 08REPORT 00YES-1

1 A

1 A

1 A 1A

1A

1 A

1 A 1A

1A

000030SNO N ooyes-iyes-ino :ono oono N 0000306NONE T&R MO -3

00CO3070WN ACTI0N08N0ME N u E N T 00C0308 -3EXACT -3 -3 -3 -3 -1 -1 000 309 -1 -1 -1 -1EXACT oClFURNACE/CCAL

000031 OKEROSENE EXPLOSION -3 000031 1A1R37S0CKS - 4 - 1 1 S T N

00 -5 -5N0 NONE

-320LI&HTING COAL

ALONE -3SM0THERED

FURNACE

-3

000 312A10

00003 1 3A 1 - 000031 4A 1 - 00003 1 5 A 1 - 000031 6A 1- 000031 7A 1 00003 1 8A

0000319A1

000040 10/19

1 COTTON

1

-3

-1 • NONE

-1-1

-1-1

- 1 0RC0L00ENVER

-1

-3

-4

-4-4

-4

-4

-4

-3EMBER

-4

-4

-4-4

-4-4

1 -1 0101

-30nLY -3 -3

1 -1YES

-4

-4

-4-4

-4

-4-4 -H -4

1 I N 1 H M E 02BASEMENT

Figure 4. A listing of a magnetic tape file used as input to COMBO. The

information on this tape had been recorded in blocks of 20 84 character card

images. The lines starting with "***** 280 WORDS IN BLOCK" were inserted in the

printout by the tape listing utility program. The first five columns of each

card image contain a case number. The next two contain a line type code.

8
A general-purpose subroutine, INPUT, is used in COMBO to interpret the

control cards. INPUT accepts an 30-character card image in (80A1) format.

Any strings of digits are converted to integers. It returns a vector 30 words long containing either alphabetic characters or integers, and a second, parallel vector indicating whether a word is to be read as a character or as an integer. INPUT may be used by any program for reading

free-form control cards containing integers, punctuation (which is usually

ignored), and alphabetic characters.

After editing, the main program calls the subroutine TAPOUT to write

the editea output line on any tape units or other peripheral devices. If

the particular type of line is not to be written on tape, or if there is no tape output in this run, TAPOUT returns without action. It writes all the

output on a single unit if this was specified. If different types of lines

are being written on different units, the line is written on the

appropriate devices. (In this case, special instruction cards must have

been read providing the list of units to be used.)

0000109 -1 - 1 - 1 - 1 - 1 -1 40MATCHES OPEN FLAME on-3

0000110 -3 -3-3 -3 -30NLY - 3 -3 00001 1 1 A 1 RSlPAJAMA -4-1 1STN0 - 1 -1 INCREASED - 1 NO ••002010/12 OACOLODENVER -10UT01H0ME 17YARD

000020217YA90 YeS 1 700M0N09 1 36509/ 1

4

/65Q9/ l 4 / 65 YESN0 NO NO NO 000020316M MEX.AMSlNGLE 07STUDENT EXACT 96010-1 -1-1

0000204 -| -1 -1 -1 - 1 YESYFSREPORT 100FFICE ORREPORT 02N0 00 0000205N0 OnYES-1 YES- 1 NO 00N0 OONO 00YES-tN0 00 -5 -5N0 -1 0000206N0NE H0SP -1- 1 106TRYJNG To START AUTO

00002070WN ncT J ONOfiNONE N N E N T ALONE -3SM0THERED RAN(PaNic)

0000208REMOvED MIN 002 -3 -3MIN 002 -1 -1 -3 -3 -1 -1 0000209 -1 -1 -1 -1 -1 -160CARBURET0R/AUT0 SPARK/BACKFIRE 0101

0000210GAS0|_ INE EXPLOSION -3 -3 -30NLY - 3 -3 000021 1 A 1R1 ASHIRT -4-1 isTNO -1 -1 -1 -1YES

••003010/18 OflCOLODENVER -11 N 01H0ME 02BASEMENT

000030202BASEMENT YES 1 1 45FR I n9 1 7 6509 /2n / 4509/ 20/65 YE SN0 NO NO NO 000030329F vHITE SINGLE 06H0MEMAKER EXACT 1692-1-3 -3-3

0000304EX A CT 1692RENTEXACT.R 6SYESYESREP0RT 08REP0RT ORREPORT 00YES-1

0000305N0 OONO 00YES-1 YES-1N0 OONO OONO 00N0 00 -5 -5N0 NONE

0000306N0NE T£.R NO - 3 320LIGHTING COAL FURNACE

00003070WN acTIONOSNONE NONENOT ALONE -3SM0THERED -3 0000308 -3EXACT -3 -3 -3 -3 -1 -1 -3 -3 -1 -1 0000309 -i -1 -1 -1EXACT 001FURNACE/C0AL EMBER 0101

0000310KER0SENE EXPLOSION -3 -3 -30NLY -3 -3 000031 1 A 1R37S0CKS -4-1 IsTNO -1 -1 -1 -1YES

••00401D/19 08C0LODENVER - 1 I N 01H0ME 02BASEMENT

0000"40202BASEMENT YE S 1

1

45FR I n9 1 7 6509 / 20/ 650 9 / 20/ 65N0 YESNO NO NO 000040303F "»HITE CHILD 10CHILD -3 -30006H0MEMAKER -1 0000M0MEXACT 1692RENTEXACT.R 65YESYESREP0RT 08REP0RT 06REP0RT 02N0 00 0000405N0 OONO OONO OOYES-lNO OOYES-lNO OnNO 00 -5 -5N0 -1 0000406N0NE HOSP -I*1 120WATCH1NG MOM LIGHT FURN.

0000407BYST 4 NDER 08N0NE N N E N o T ALONE YESSCREAMEO -3 0000408 -3MIN q4 -3 -3 -3 -3 -1 -1 -3 -3 -1 -1

, 0000409 -i -1 -1 -1 -1 -101FURNACE/C0AL EMBER 0101

OOOCHOKEROsENE EXPLOSION -3 -3 -30NLY-• 3 -3 000041 1A1RUSHIRT

•- -4-10U NO -1 -1 -1 -1YES

Figure 5. The abridged file produced from operation of COMBO on the file shown

in Figure 4, as instructed by the cards shown in Figure 6.
— -J ABCDEFGHIJKLMNePQRSTUVWXYZ0123456789 /& $

' 7 3 1 1 19 1 1 OJ. \

1 5 s O\ \ \

6 7 \ \ \

01 ^\ \. \

02 \ \ I The alphabet card defines the character

03 \ N> | set and certain special punctuation.

04 N. N. 05 \ N« This card sets up the I/O, states the

06 \. [number of card types, and suppresses

07 n^ 1 searching and substitution.

08 ~-~«^^^ N. 09 -—^^ N This card is read by BSENS.

10

1 1 These cards are read by LINTYP. The

12 list of numbers from 1 to 19 identifies

13 them as line type codes.

14

1 5 ^^•This card is read by the main program.

16 ^^^^

1 7 ^^^^

18 ^^*^

19 ^^^"^

1 20 ~^y^^

S

1 1 1 2 3 78

2 1 1 80

3 1 1 80

4 1 1 80

5 1 1 80

6 1 1 80

7 1 1 80 ^__\) These cards are read by the subroutine

8 1 1 80 ____

" ~7\ MXREFM

9 1 1 80

1 1 1 80

1 1 1 1 80

1213

1 41516

1718

19

1 1 SI 2 2 1 These cards provide the input plan. A

3 1 1 zero indicates that a line is to be

4 1 skipped.

5 1 ] 6 1 7 1 1 8 1 1 9 1 1 10 1 1 111 1 12 ^^ These cards describe the output plan.

13

141516

17

1 8 19 —

Figure

retai

file.

Control cards used to abridge the file shown in Figure 4, by retaining only the type 1 through type 11 records. Figure S shows the abridged

10
ABCDEFGH I JKLMN6PQRSTUVWXYZ0 1 23456789 78110 19 110

1 5 84

6 7

0)

1<17

18

19

1 *#$

*$

/%

50

3

12

34

56

7

89

10

1 1 12

13

14

1516

1718

19

123

4

5

6

7

89

1

1 1 12

1314

1516

1718

19

15 6 7 8 10 18 2 20 4 24 13 37 7 44 3 47 2 49 15 64 2 66 13

S3 1 S4 2 S4 3 SI 4 S4 5 S4 6 S2 7 S4 8 S4 9 S2 11 S4 12

Figure 7. Control cards used to print the first line (card images) of each case from the file shown in Figure 4, inserting asterisks between items. Output is shown in Figure 8. The card marked with the arrow was changed to produce the alternate output shown in Figure 9.

11
4. Applications of COMBO

The COMBO program was originally written to search and edit the

magnetic tape file of bibliographic information on molten salts, part of

which is listed in Figure 1. This file was blocked in physical records

consisting of 45 80-character card images each. Control cards shown in

Figure 3 were used to specify the strings for which the records will be

searched, and the substitution and reformatting instructions. An

explanation of the control cards is given below in the section on "Discussion of the Control Cards." The examples cited in that section

refer to Figure 3. The report printed by COMBO is shown in Figure 2. Appendix I shows printout produced by COMBO as it interpreted the

control cards shown in Figure 3. This output, printed before it began to read from the input tape, provides much the same information as does Figure

3, but in some cases a less compact format has been used, and sometimes the

program has added comments or explanations to the listing.

The application of COMBO to that file utilized all of its

capabilities: searching, string substitution, and reformatting. But the

program can also be used for applications using only some of its

capabilities. Figure 4 shows a partial listing of a magnetic tape file of case reports on ignition of clothing. It was desired to abridge, reformat,

and print the file without searching or substituting. Figure 6 shows

control cards used to print the first 11 types of card images for each case

report. Figure 5 shows part of the abridged listing produced in this manner.Figure 7 shows another COMBO operation on the same file. Here it was desired to print only the first line of each case from that file, inserting

delimiters between different items of information. This was done twice,

using the asterisk as the usual separator in one run, and the space in the

other. Only one control card, marked with an arrow in Figure 7, had to be

changed. The results of these operations are shown in Figure 8 and 9. The change just described is one of a number of possible changes in

the operation of COMBO that can be made by changing only one control card.

In this case, calls for one string, consisting of an asterisk, were

replaced with calls for a different string, consisting of a space. Here we wished to change only some of the asterisks to spaces. If we had wished to replace all the asterisks with spaces, it would have been even simpler.

The card defining String 2 as an asterisk could have been replaced with one providing for a space.

Other changes involving only one control card include changing the

order in which fragments of an input line are printed, or the columns which

define a fixed input field. One could also change a pair of substitution

strings or a search phrase by changing only one card.

In the two data bases just discussed the block or case number and the

card type number are contiguous and at the beginning of each image. Figure

10 shows cards making up one logical block of a data base on cases heard by

an Italian court. .In this data base the case number is in columns 73-79

and the card type code in column 1. COMBO can be used on this file to abridge it for purposes of storing it on disc for on-line query. In addition, the substitution capability of COMBO could be used to replace a limited vocabulary of Italian words with their English equivalents.

12
»0000l°0 800002»0

»D0003»0

KODODM.O 800005*0

H00006.0

«O0O07»0 800008»0

b00009»0

tioooi o»o 80001 1 • »00012«0 8O00I3»0

tlOOOl '•0

000 I S« I" 80001 6*0

80001 7*0

80001 8»0 80001 9«0 800021 »0 800022*0

800023*0

80002H*0

SQ0025*0

800026*0

800027*0

800028*0

800029*0

ID/8 10/12

ID/18 10/19

ID/37

ID/26 ID/23

1D/M3

1D/S8

10/62

ID/96 ID/85

ID/81 ID/87 ID/10

10/11 ID/10

ID/12

ID/12

10/11 ID/12

ID/ 1 3 ID/15 1D/M

ID/16

ID/17

ID/29 10/19

«D/8 .0/12

• 0/18

*D/I*

• D/37

• D/26

• D/23

• D/13 .0/58

• 0/62

• D/96 »D/85

»D/81

• 0/87

2*D/ 102 3*0/1 13 9*D/ 1 09 0*0/120

7*0/127

6*0/1 16 3*0/123

1.0/131 O.D/150

5*0/115

9.0/169

2.D/172

3*D/2»3

6*0/196

• COLO

• COLO

• COLO •COLO

• COLO

•COLO

• COLO

• COLO •COLO

• COLO •COLO

• COLO

• COLO

• COLO

• COLO •COLO

• COLO •COLO

• COLO •COLO

• COLO •COLO

• COLO

COLO •COLO •COLO

• COLO

COLO

• OENV

• denv

• DENV

• DENV

• WALT

• DENV

• OENV

• DENV

• DENV

• DENV

• DENV

• DENV

• OENV

• T" I N

• DENV

• DENV

• DENV

• DENV

• DENV

• DENV

• AURO

• DENV

• OENV

• FRED

• DENV

• DENV

• DENV

• DENV

ER

ERER

ER

ONER

ER

ERER

ER

ER

ERERIDAD

ERER

ERER

ER

ER

RAER

ERERICk

ER

ER

ERER

1 • 1 N .OI'HOME OF GRaNDM* «03*BEDR0OM

1*0UT*01 *HOME •17»YARD

1 • I N •Ot»HOME •02«BASEmENT

1 • I N ,ol*HOHE •02»BASemENT

1 *0UT*08*SIDE OF ROAD .[9. SIDE OF ROAD

1 *0UT*01 »HOME .17. BACK YARD

1 • I N »01»H0ME .05* LIVING ROqM

1 •! N «02*M0TEl RESI DENCE*02*BOILER room

1 *0UT*20*HUNT ING COUNTRY •19-CANYON

1*OUT*01*HOME . 17" BACK YARD

1 • I N *0

»HOME .08. KITCHEN

I •OUT»01 «HOME •17.BACK YARD

1 •OUT«08»ALLEY NR. HOME • 1 9»ALLEY

1 *0UT«09«W00DED AREA • 19. PATH IN (VOODS

1 *0UT*01 »HOME »1 7» BACKYARD

1*IN »01 »APARTMENT .08.K

TCHEN

1 • I N «0l»H0HE «02« BASEMENT

1 • I N »01*HOME .02* BASEMENT

1 • 1 N «01«HOME »OS«LIVING ROOM

I *OUT*02*NE IGHBoR 'S YARD •17»NEIGHB0R YARD

1 •> I N .01 'HOME/MOTEL UNII •03«BEDR00M

1 • I N «01 .HOME/APARTMENT •05*LIVING ROOM

I • I N *Ol»HOME »OB*KTCHEN

1 • 1 N *01 *HOME *08*KITCHEN

1*IN *01*H0ME/APARTMENT •03«BEDRO0M

I • I N .Ql.HOME •08»KITCHEN

1

*> I N .01. HOME •03«BEDR0OM

I • I N • 01* HOME/APARTMENT •05»LIVING ROOM

Figure 8. A printout of the first card image of each case from the file in Figure 4. After seeing this output it was decided to use a blank space rather

than an asterisk to separate fields. This was done by changing one control

card, as shown in Figure 9.

800001 1 / a D/8 • •08 COLO DENVER < IN 01 HOME OF GR AnDm/ .03 BEDROOM

800002 1 0/ 1 2 0/ 1 2 • •08 COLO DENVER . . OUT 01 HOME • 1 7 YARD 800003 ul D/ i a 0/ 18 • •08 COLO DENVER i IN 01 HOME • 02 BASEMENT

SOOOOH 13/19 0/ 1 9 • •08 COLO DENVER . IN 01 HOME • 02 BASEMENT

8 J0005 1 / 3 7 0/37 • •08 COLO v. ALTON i l OUT 08 SIDE OF ROAD • 19 SIDE OF ROAD 80D006 01 D/26 D/26 • •03 COLO DENVER < i OUT 01 HOME • 17 BACK YARD 800007 01D/23 D/23 • •08 COLO DENVER ' i IN 01 HOME •05 LI V IuG ROOM 800008 ID / <t 3 D/M3 • •08 CO 1-0 DENVER . . IN 02 MOTEL RESIDENCE • 02 BOILER ROOM 800009 1 D / 5 8 0/53 • •08 COLO DENVER i OUT 20 HUNTING COUNTRY • 1 9 CANYON

SUOO 1 010/62 D/62 • •08 COLO DENVER < i OUT 01 HOME • 17 BACK YARD

sonol l 01 D/96 D/96 • •08 COLO DENVER ' IN 1 HOME • 08 KITCHEN

800012 010/95 D/85 • •OB COLO DENVER , OUT 01 HOME • 1 7 BACK YARD

80001 3 OlD/31 D/81 • •08 COLO DENVER i OUT 08 ALLEY NR. HOME • 19 ALLEY

80001 H 01D/87 D/87 • •08 COLO TRINIDAD . OUT 09 WOODED AREA • 19 PATH IN WOODS

8000 15 1 D / 1 2 0/ 102 • •08 COLO DENVER < i OUT 01 hOME • 1 7 BACKYARD

80001 6 10/113 0/113 • •08 COLO DENVER i i IN 1 APARTMENT • 08 KTCHEN

80001 7 DID/ 109 0/ 1 09 • •08 COLO DENVER > IN 01 HOME • 02 BASEMENT

80U0 1 B • 1 D / 1 2 D/120 • •08 COLO DENVER < i IN 1 HOME .02 BASEMENT

S0D019 010/127 D/127 • •08 COLO DENVER t . IN 01 HOME • 05 LIVING ROOM

80C021 I D / 1 1 6 0/116 • •08 COLO DENVER i > OUT 02 NEIGHBOR'S YARC •17 NEIGHBOR YARD 800022 010/123 D/l 23 • •08 COLO AURORA • . IN 01 HOME/MOTEL UNII • 03 BEDROOM

800023 01D/13 1 D/131 • •08 COLO DENVER . > IN 1 HOME/APARTMENT • 05 LIVING ROOM 80002S 10/150 D/150 • •8 COLO DENVER i > IN 01 HOME • 08 KITCHEN

800025 1 D / 1 1 r

, D / 1 M 5 • •08 COLO FREDERICK i IN 01 HOME • 08 KITCHEN

S0D026 1 U / 1 6 9 D/I69 • •08 COLO DENVER i IN 01 HOME/APARTMENT • 03 BEDROOM

800027 (1 1 D / 1 7 2 D/172 • •08 COLO DENVER > IN 01 HOME • 08 K I TCHEN 800028 1 D/293 D/293 »»08 COLO DENVER , IN 01 HOME • 3 BEDROOM

Figure 9. Printout of the first card image of each case, using a space as the separator. The control cards were the same as in Figure 1, except that the control card marked with the arrow was changed to 11 S3 1 S4 2 S4 3 SI 4 S4 S S4 6 S2 7 S4 8 S4 9 S2 11 S4 12

18
Figures 11-13 illustrate the use of multiple tape units for output The control cards shown in Figure 11 caused the tape file listed in Figure

1 to be divided into two abridged files, which were written onto units 8 and 9. Figure 12 lists part of the output written to tape 8. Figure 13 lists the corresponding output written to tape 9.

Hi

wr.se <r

4j"3fi

mr.ii401

TSK,

:>C0NF, 976-65).*

T1TOLO O MASSIMA

SCRITTO BALL-'ART. £9j QUARTO COMMA.- BELLA "LEGGE 13 GlUGNQ 11

'C LC O f 1 A5SIM A

:i7p

,.od -.:".;,;

21 7pi34

:>:

iV^C'SlZ'ONE >PER!MENT0j DA PARTE BEL G!UB!CE, DEL TENTATIVE B! CONG ! L ! AZ ! ONE PRE- TtTOLO O MASSIMA

,.'0CAT0 NE! CONFRONT! BEL CL!ENTE< HON E MOTIVO Dl NULLITA !L MANCATO TITOLO O MASSIMA

:177B13*

' ~ .' .

=HELL0 SPEC! ALE PRCCEB ! MEHTO PER LA LiQUIBAZIOHE BEGL! ONORARi Bl AVTl TO'.C O M ASSIf' °>

NSP0SIZI0NE 176134

:

ffPlS5i

££1

i 3il6194c!:

I I

LEGGE SPECIALE —

DATA ALL

1 NUM f—

G M IANN0 TAB LEGGE SPECIALE

: 175 134

J

3033jC0HC!L!AZ!ON£ - NULLITA - ESCLUS!OF£.*

%%

301

529597 PROCEB! MEHTO CIVILE - CONC ! L ! AZ ! ONE - TEHTATIVO.* £175134

TITO '.O O M ASSIM A

Injposi; 217)5134

TITO LO O MASSIMA

2fi£jALLA L. 13 GIUGNO 1942 M, 794 - MANCATO ESPERIMENTO BEL TEHTttTIVO B! £

TITOLO O M A S f I M A

32959? AVVOCATO E PROCURATORE - ONORAR! - PROCEB I MEHTO SOMMARIO D! CU! TITC'.O O M A^f IM /> S!ONFR!BB FAB! I /S1APOLITANO MART I NELL!

£1715134

COLAEGtQ GIU01CAN1

rfttSiOENT.E

I N

"1 ~ LJ

Figure 10. These cards are part of a data base on cases heard by an Italian superior court. This data base could be handled by COMBO, since

card columns 73 through 79 contain a case number and the number in column 1 identifies the card type.

14
The number 2 in the fourth position on the second control card (shown

in Figure 11) indicates that multiple tape units are being used for output.

The number 1 in the seventh position of the cards suppresses searching!

The tape unit table follows the input to LIN'TYP. It directs the system

cards and the property code card for each entry to tape 8 to form a substance-property index, and the author and journal cards to tape 9 as a bibliography.

ABCDEFGHTJKLMN6PQRSTUVWXY

7 12

1 5 8 6 7 0%

1 1 30

32

1 8

2 8

3 9 4 9

FINIS

1 99

<>#0

TABLE 2 /<1 )/ / - / /(ll )/ / -- / /(111 )/ / ---

/<UU)/ / -- / TABLE 4 TABLE 1 /EMF/ /EMF / /DEN/ /DEN / /CWPF/ /CMPF /

ead by the main

These cards are read by the subroutine

TAPOUT. They provide for the writing of

a particular type of line on either tape

3 or tape 9. This card is read by the main program.

cards are read by the subroutine

/TDYP/ /TDYP / /V6L/ /VOL / TABLE 3 /J. AMFR. CHEM.

FINIS

SYSTEM #$

JRNL:S

AUTHORS:

S0C./ /J. A.C.S„/

$

( $

) $

V6L. S

S

1 1 1 5 7 20 ~~

\

2 1 1 5 8 2 10 20 \

3 1 1 5 8 20 70 1 1 \

4 1 1 5 8 15 32 15 56 15\

1 1 S6 1 S7 S5 2 \

2 1 S6 1 S7 S5 SI 2 S5 S5 3 3 1 S6 1 S7 S5 S2 2 S5 S8 3 4 1 S6 1 S7 S5 S3 2 S4 3 S4 4

These cards are read by the subroutine

Figure 11. Control cards used to divide the file shown in Figure 1 into

two abridged files. The two files produced are shown as Figure 12 and

Figure 15. 15
( 01 006 ) SYSTEM #02 TN • ( 01 006 ) SYSTEM #03 LICL-KCL

( 01 007 ) EMF

( 01 007) SYSTEM #01 RACL2

-, •

( 01007 ) SYSTEM #02 KCL • ( 01 007) SYSTEM #91 PTCL3

( 01 007) SYSTEM #92 PTCL4

( 01 007 ) SYSTEM #93 AUCL3 • ( 01 007 ) SYSTEM #94 AUCL

( 01 007 ) SYSTEM #95 CCL4

{ 01 008 ) CMPF • ( 01 008 ) SYSTEM #01 AGCL-AGN03

( 01 009 ) EMF

( 01 009 ) SYSTEM #01 AGN03-NACL-NAN03 •

( 0101 ) EMF

( 01010) SYSTEM #0 1 AGN03< NAN03-KN03 )

( 01 01 ) SYSTEM #02 NACL( NANO3-KN03 ) •

( 01011) KA

( 01 01 1 ) SYSTEM #01 AGCL(KN03)

( 01011 ) SYSTEM #02 AGCL2( KN03 ) •

( 0101?) T)ECP EMF

( 01012) SYSTEM #01 KCL

( 01013) DECP • ( 01013) SYSTEM #01 NACL

( 01013) SYSTEM 002 NACT.-KCI.

Figure 12. The substance-property index produced from the molten salts data

base by selecting only the system cards and the property codes card. The

control cards which produced this file are shown in Figure 11.

01006) JRNT.:J. ELECTROCHEM.

01006) AUTHORS:LAITINFN H.A

01007) JRNL:J. ELECTROCHEM.

1007) AUTHORS :MALMBERG M.S

01008) JRNL:CAN. J. CHEM.

01008) AUTHORS:WETVIORE F.E. 01009) JRNL:J. PHYS. CHEM.

1009) AUTHORS: BLANDER M. 01010) JRNL;J. PHYS. CHEM.

01010) AUTHORS: BI. AM T)ER M. 01011) JRNL:J. PHYS. CHEM.

01011) AUTHORS:MANNING D.L.

010 12) JRNL:TRANS. ELECTROC

01012) AUTHORS:KIRK R.C.

01013) JRNL:Z. ELEKTRflCHEM.

01013) AUTHOKS:NEUMANN B. 01014) JRNL:Z. ELEKTROCHEM.

01014) AUTHORS:DPOSSRACH P. 01015) JRNL;7. ELEKTROCHEM.

01015) AUTHORS:RAU E.A. 01016) JRNL;?.. ANORG. CHEM.

01016) AUTHORS: ISBEKOW W. 01017) J»NL:Z. PHYSIK. CHEM

01017) AUTHORS:LORENZ R.

SOC. VOL.107 7051960

.BHATIA B.B. , SOC. VOL. 103 81956

.PUBTN B. .HAMER W.J. VOL. 32 8641954

.HILL S. , VOL. 6410381960

.BRAUNSTEIN J. .HILL D.G.

VOL. 6518661961

.HILL D.G. , V«L. 6620691962

, RLAMOER M. , BRAUNSTEIN J. HEM. VOL. 69 6611936

, BRADT W.E. , VOL. 31 2871925

.RICHTER H. , VOL. 36 1791930

• * VOL. 40 3521934

,GRUBE G. , VOL.185 3241930

• * VOL. 130 391927

Figure 13. The bibliography produced from the molten salts file (shown in

Figure 1) by selecting only the author and journal lines. The control cards

which produced this file are shown in Figure 11. 16
5. Control Cards

The main program and six of the subroutines -- BSENS, LINTYP, MSERCH,

MSUBS, MXREFM, and TAPOUT -- each require one or more control cards. Each

of those subroutines has a variable in its argument list which serves as a switch. When set to zero, it directs the subroutine to read control cards

and initialize itself. A nonzero value indicates a production call.

Sample control cards for the main program and subroutines are shown in

Figure 2. A detailed analysis of the same control cards is shown in

Appendix I

.

The first two control cards are read by the main program. The first

card, in (80A1) format, is used to make the program independent of the

internal representation of Hollerith characters. It has the letters of the

alphabet in columns 1 through 26 in order, and digits from to 9 in

columns 27 through 36. Column 4] contains a symbol used in the print

output by MSUBS to bracket the strings. Column 42 contains a special

character, the universal match symbol, the function of which will be

explained shortly, used in LINTYP and MSERCH. Column 50 contains a string

terminator used to delimit the strings on control cards read by MSERCH and

MXREFM. Column 5 2 contains a character which MXREFM recognizes as a continuation symbol; it means that the next control card will be treated as

a continuation. The 47th column of the alphabet card must be blank.

The next card contains not more than nine numbers, in free field.

These are the logical unit number for the input tape, the logical unit

number for an output tape or card punch if such output is desired, a switch

indicating whether a printed report is wanted (0 for no, 1 for yes),

another switch indicating whether tape or card output is wanted, the

overall search strategy (0 for "or", 1 for "and"), and the number of

possible line types for an item in the file. In the example shown, the

input tape is on unit 7 and, if tape output were desired, it would be on unit 8. However, although printed output is desired, tape output is not. An overall "or" search strategy will be used. There are to be four line

types and therefore four tables each for searching, reformatting, and

substitution. The last three numbers are subroutine switches. If nonzero, they will suppress the use of MSERCH, MSUBS, or MXREFM respectively.

Those subroutines will be used if the switches are set to zero, or if they

are omitted.

The third control card is read by BSENS and is in (13) format. It gives the starting and final columns of the ID field and the width of a record on tape, in characters. For instance, in Figure 2 the ID field is positions 1 through 5 in an 80-character record.

Special cards are required by TAPOUT at this point if the option to direct different types of lines to different output units is in effect.

Each of these cards has a line type number followed by one or more logical

units numbers. For instance, "2 3 8" means that each line type 2 should

be output on units 3 and 8. Neither the printer nor any read-only device

(e.g., card reader) should be specified; no check is made for this error. Line types must be listed in order -- 3 may not be followed by 2 -- but may

be omitted from the list. If a type is omitted, no tape output for lines

of that type will be generated. A card witn FINIS flush left terminates

the control cards for TAPOUT. These cards are not used if a single tape

unit for all output is specified, or if no tape output has been requested.

The next control card is read by the main program. It contains two numbers in free format. The first is the number of the first logical block

to be processed by COMBO. If this number is greater than 1, blocks

preceding the first one to process will be read and ignored. The second

17
number is the last logical block to be processed. After processing it

COMBO stops. The second number may be omitted, in which case COMBO will

continue to the end- of- file.

The next group of control cards is read by LINTYP. The first one gives the starting and ending columns for the field identifying the line

type. In this case it consists of columns 6 and 7. Then as many cards as there are record types follow. Each card has, beginning in column 1 (in

this case in columns 1 and 2) the characters which serve as a code for an

line type. For instance, the second type of record, for an item of the

file shown in Figure 1, enumerating the compounds described, is indicated

by "11" in columns 6 and 7. If a universal match character appears, any

character may be in its place in the file. For instance, the code for the

first record type is "01", where the percent sign is the universal match

character. A record of this type is indicated by a zero in column 6; anything may appear in column 7.

In Figure 2, codes of "30" and "32" indicate records giving the

journal in which an article appeared and its authors, respectively. LINTYP

expects one card for each type of record.

Cards are then read by MSERCH. One search table is read for each card

type. The search table begins with the word AND or OR, stating the search

logic for the table. Then come the search strings for the table, each

ended by a period. A card with a period in column 1 marks the end of a table. Table 4 has no search strings, so there is to be no search for

authors. The word FINIS left-adjusted signals the end of card input to MSERCH. If a string including a universal match character were in the

input, it would indicate that any character would satisfy the search.

The next subroutine to read cards is MSUBS. The first two cards, in

(3A1,I1) format, give certain information about the input and output,

respectively. The first character is a "shift up" symbol and the second a "shift down" symbol. If the text in the file does not have upper and lower

case with shift symbols, characters which will not be found in the file,

such as the lesser and greater signs, should be used. The third character

is a universal match symbol for substitution. The number is a binary

switch which, if 1, means the shift and lock convention is in use, or if 0,

the shift and unlock convention. This number is unimportant if no shift

convention is in force, but in that case should be zero for efficiency.

Each substitution table is introduced by a card with the word TABLE in

columns 1 through 5, and the table number in columns 7 and 8. Each table

entry consists of two strings, a search string to be located in the text

and its replacement or substitution string. Each of the strings is

delimited on each side by the character in column 1 of the card. Figure 2 shows that each card may have its own delimiter. The word FINIS flush left

on a card terminates the reading of substitution tables. Note that the

tables need not be in order.

Control cards for MXREFM are read last. The first cards read are the

insertion strings, each ended by a terminator (here, the dollar sign.)

MXREFM assigns each string a number in order of appearance starting with 1. A card with a string terminajtor in column 1 ends the reading of strings.

The remaining MXREK. control cards are in free format. These are two groups of them, one defining the input format and one the output format,

each consisting of one card (or one card and continuations) for each type

of line. The input format card has the number of the table to which it

refers as the first number on the card. As a check the cards must be

arranged with these numbers in ascending order. The second number tells

18
which of three types of formats the record will be in. A 1 indicates

fixed- field format, a 2 indicates a free-field structured format with a specified delimiter, while 3 indicates an unstructured format with a flag

preceding each record. If the input is fixed-field, as shown in Figure 2,

pairs of numbers follow, giving the starting column and width of each

field. If the input is free-field, a delimiter, consisting of one to three

characters, comes next, and then a number which is the maximum number of

fields in the record. If no delimiter appears, one or more blanks separate

the fields. If the input is unstructured but flagged, the list of flags

follows, with each flag bracketed in the same manner as strings in MSUBS.

The fields of the input line are numbered by MXREFM. If the input is free-field but structured, the fields are numbered sequentially; otherwise

they are numbered in the order in which they are defined. (A field is

defined by stating its fixed columns or the flags associated with it.)

These numbers are used to specify how to reassemble the pieces into an edited output line. Each card specifying the output plan has as its first

number the number of the table, as a check; these must be in ascending

order. The next number is either 1 or 2. If 1, it indicates that the

width of a field in the output is to be the same as it was in the input.

This should always be provided for fixed-field records. A 2 means that

each variable-width field of the input record is to be inserted into a fixed-width output field. Then comes the output specifications. A field

of the input is designated by its number. An insert string is indicated by

the letter S and its number, e.g., S2 names the second string. If option 2 (the inclusion of variable-wicTtn fragments into fixed fields) is in effect,

the number specifying an input piece is followed by two more numbers. The

first one is a switch, 0, 1, or 2, telling how the input piece is to be

adjusted or located in the fixed-width field. A means the piece is to be

centered, a 1 indicates flush left adjustment, and a 2 flush right

adjustment. If the input piece is wider than the output field part of it

will be lost. The second extra number is the width of the fixed field.

For instance, "3 1 12" would mean that the third piece was to be leftadjusted in a 12-character field.

19
6. Special Characteristics of COMBO

It is the policy of the Data Systems Design Group to program in

standard FORTRAN wherever possible, to reduce machine- or systemdependence. Since it is not always possible to make a program completely

machine-independent, we have segregated non-standard features in special

subroutines appropriate to the 1108, which can be replaced by ones required

for a different machine.

The principal non-standard aspect of COMBO is the subroutine UNBLOK.

This subroutine is used to read records longer than 132 characters, unpack

from A6 to Al format internally, and return 80-character card images. It makes use of NTRAN, a utility tape handler for the 1108, and the FLD statement, used to manipulate bits.

Two other features may require modification for other machines (or

other installations using the same hardware). The units for the card

reader and printer are equated to variables IN and IOUT in the main

program. These values are currently 5 and 6, respectively, but should be

set to the proper values for a user's system.

Calls are included to a subroutine CLOCK which is in the 1108 library

and prints the time in hours, minutes, seconds, and milliseconds. On other

machines it may be necessary to change the name of the routine in the calls

or delete the calls.

The common block STR is used by MSERCH, MXREFM, and MSUBS for storage

of character string data. Dynamic allocation of string storage is effected

by an interesting technique. A pointer, ICNOW, indicates the next unused

cell in the vector IC. A subroutine requiring string storage may use those

cells in IC immediately beyond ICNOW, recording their location. ICNOW must

be reset by the subroutine after using IC. The present version of COMBO operates in about 50K words of core on the 1108 at NBS. This will, of course, vary not only from machine to machine but from system to system, since it includes the input-output

package and depends on the machine language. If it is necessary to decrease the amount of storage required, the size of the common blocks IB and STR can be cut. The amount of storage used by certain arrays in the

control sections MSUBS and MXREFM can also be reduced.

Certain limitations, which we hope will not be considered severe, have

been imposed in COMBO. Three of these are worth mentioning. One is that

only 250 characters have been provided for the dictionary of record type

codes: The product of the number of record types and the width of the

record type field may not exceed 250. (If the record type field is columns

69 through 72, for instance, there may be no more than 62 different record

types.) Another is that COMBO cannot accept a logical block longer than

20000 characters. If standard 80-character card images make up the input,

up to 250 of them will be allowed as one entry. (This rather lavish use of core will need to be reduced on a smaller machine. It was intended to take

full advantage of the core capacity and charging algorithm of the NBS

computer.) Third, no more than 8000 characters may be stored in the block

STR. If any of these restrictions is violated, the program stops.

The COMBO program and subroutines, with the exception of the machinedependent input routine UNBLOK, handle characters exclusively in Al format.

The opinion held by some programmers that FORTRAN is not a suitable

language for character and string manipulation seems to result largely from

20
the habit of storing characters in A6 format. While the "discipline" of

conserving memory in this fashion was often necessary ten years ago, when

core was often limited to a few thousand words, it is seldom warranted any

longer, at least not on large computers. Use of Al format for reading,

storing (one character per word), and outputting frees one from reliance on assembly language and permits character manipulation in standard FORTRAN.

7. Afterword

As indicated earlier, COMBO was designed with the view of handling

data files having the general structure of the file on molten salts. The

degree to which we succeeded in separating the general from the particular

details of that file, can be judged by the ability of this program to cope

with other files of similar structure but vastly different content and

format. It seems pertinent therefore to point out that neither of the

files shown in Figure 6 or Figure 10 came to our attention until a year

after the completion of COMBO.

COMBO was designed for applications in which its searching, string

substitution, and reformatting capabilities are all used on (nearly) every

card type, such as the application shown in Figures 2 and 3. We recognize

that for applications such as those illustrated in Figures 5-9, in which

some or all of the pieces are to be accepted unchanged or ignored, the use

of COMBO may seem cumbersome, because of the elaborate setup of control

cards. The number of control cards required in such applications can be

profitably reduced without major reprogramming. In particular, the

requirement that instructions be given to MSERCH and MXREFM for every line

type, even if these routines are not being used on some of the types, can

be eliminated. Such modifications in COMBO are planned for the near

future. We have however chosen to document COMBO in its present

preliminary form rather than further delay publication, since it and its

subroutines are useful in their present form.

The authors wish to express their appreciation for the assistance of

several persons in the development of the program. Professor George H. Janz of Rensselaer Polytechnic Institute provided a data tape which

presented the challenge which we trust has been met by COMBO. Mrs. Carla

G. Messina contributed the UNBLOK subroutine, and MSERCH is based on her

SEARCH program. Special thanks are due Mr. Robert C. Thompson, both for

his assistance in modifying his multiple table substitution program, and

for assistance in the debugging of MXREFM, and for originally suggesting

that COMBO be written.

We also wish to thank Mrs. D. W. Jones and Mrs. S. T. Moore for typing

this report into a time-shared computer system from which camera-ready copy

was produced.

21
References

1. Hilsenrath, J., and Galler, G., OMNIFORM I: A General-Purpose Machine

Program for the Calculation of Tables of Functions Given Explicitly in

Terms of One Variable. Nat. Bur. Stand. (U.S.), Tech. Note 125, 35 pp.

(May 19 62)

2. Cameron, J. M. , and Hilsenrath, J. "Use of General-Purpose Coding

Systems for Satistical Calculations," Proceedings of the IBM Scientific

Computting Symposium on Statistics, (White Plains, New York), October 21-

23, 1963, 323 pp.

3. Hilsenrath, J., Ziegler, G.G., Messina, C.G., Walsh, P.J., and Herbold,

R.J., OMNITAB: A Computer Program for Statistical and Numerical Analysis.

Nat. Bur. Stand. (U.S.), Handbook 101, 256 pp. (March 4, 1966); 2d ed., 275

pp. (Jan. 1968)

4. Rosenblatt, J., Joiner, B. L., and Hogben, D., "OMNITAB-Rapid

Statistical Manipulation," in Final 1970 Census Plans , and Four Programming

Systems Fo r Computerized Data Retrieval" and Manipulation , Census Tract

Papers Series GE40, No. 6"., pp. 46-59, U.S. Bureau of the Census, 61 pp. (January 1970)

5. Messina, C.G., and Hilsenrath, J., EDPAC: Utility Programs for

Computer-Assisted Editing, Copy-Production, and Data Retrieval. Nat. Bur. Stand. (U.S.), Tech. Note 470, 76 pp., (Jan. 1969)

6. McClenon, R. , and Hilsenrath, J., REFORM: A Computer Program for

Manipulating Formatted Data Files. Nat. Bur. Stand. (U.S.), Tech. Note

444, 25 pp. (August 1968)

7. Maguire, J., and Jakes, M. , "Quick Qwery," in Final 1970 C ensus Plans , pp. 29-33

8. Shapiro, K. , "Tablemaker 2," in Final 1970 Census Plans , pp. 34-39

9. Wall, H. , "GIS - Generalized Information System," in Final 1970 Census

Plans

10. Messina, C.G., and Hilsenrath, J., Edit- Insertion Programs for

Automatic Typesetting of Computer Printout. Nat. Bur. Stand. (U.S.),

Tech. Note 500, 47 pp., (April 1970)
Appendix I Control Card Printout

The following pages show printout produced by COMBO on reading the control cards shown in Figure 3. This printout

was produced during initialization, before COMBO began

reading from tape and generating the report shown in Figure

2. It generally parallels the listing of control cards

(Figure 3), but is often in a less compact format, and

sometimes includes comments or interpretive information.

23
REAL TIME CLOCK INTERROGATED AT 1 a : 08 : 53 • 759 ABCD£FGHlJKLMN0PQRSTUVWXYZ0l2'< '*S6789 /% i ' INPUT INTERPRETER INITIALIZED

ABCDEFGHI JKLMN0PQRSTUVWXYZ0123M56789 /% $

7 3 1 H

1 5 80

6 7

1 OS

2 I 1 3 30

H 32

I HD

• •• SEARCH CONTROL CARDS FOLLOW ... SEARCH TABLE 1 ORTHE PROGRAM IS SEARCHING FOR LINES CONTAINING ANY OF THE wO*DS GIVEN BELOW,

SEARCH TABLE 2 ORTHE PROGRAM IS SEARCHING FOR LINES CONTAINING ANY OF THE WORDS GIVEN BELOW,

LICL-NACL

LICL-KCL

SEARCH TABLE 3 ORTHE PROGRAM IS SEARCHING FOR LINES CONTAINING ANY OF THE WORDS GIVEN BELOW,

SEARCH TABLE H AND

THE PROGRAM IS SEARCHING FOR LINES CONTAINING ALL OF THE WORDS GIVEN BELOW,

KLEPPA

HERSH

THERE ARE 1 TABLES

»•• SUBSTITUTE CONTROL CARDS FOLLOW ••• <>»0 <>»0

TABLE 2 /( I )/ / /til)/ / /(111)/ / /DHF/

/DHSL/

/EFEN/

/HMX/

/TOY/

/SVEX/

/FEN/

/RAM/

/ELEC/

/CAL/

/HIT/

/ACTC/

/PCEL/

/DENT/

/DENS/

/V,P./

/TDYP/

/VOL/

/J. AMER. CHEM, SOC./ FINIS

/

- / /DHF / /DHSL / /EFEN / /HMX / /TOY / /SVEX / /PEN / /RAM / /ELEC / /CAL / /HIT / /ACTC /PCEL

/DENT

/DENS

/V.P,

/TDYP

/VOL / /J. A.C

Q

S./

S4
8 FIRST CHAR IS

TABLE 1 BEGINS AT 9 ENDS AT 54 FIRST CHAR IS 19/J. AMER, CHEM. SOC./ /J. A.C.S./

4/CMPF/ /CMPF / 1/DECP/ /DECP / ~3 /H iT/^/HI fT"

3/VOL/ /VOL / 2/KA/ /KA / TABLE 2 BEGINS AT I ENDS AT 5/(111)/ / --. / M/( 1 1 )/ / -- / M/ (UU ) / / +-- / 3/11)/ / - / TABLE H BEGINS AT 9 ENDS AT 8 FIRST CHAR IS 19/J. AMER. CHEM, SOC,/ /J. A.C.S./

REAL TIME CLOCK INTERROGATED AT 18:08154.2089

••• REFORM CONTROL CARDS FOLLOW •••

THERE ARE 8 STRINGS. THEY A»E --

S 1 8 CHARACTERS SYSTEM « S 2 5 CHARACTERS JRnL! S3 8 CHARACTERS AUTHOR*:

S 4 2 CHARACTERS , S 5 2 CHARACTERS

S 6 2 CHARACTERS ( S 7 2 CHARACTERS ) S 8 H CHARACTERS VOL. RECORD IS FIXED-FIELD. STARTING COLUMNS AND WIDTHS ARE mm 15 7 20 RECORD IS FIXED-FIELD. STARTING COLUMNS AND WIDTHS ARE -- IS 8 2 10 20 RECORD IS FIXED-FIELD. STARTING COLUMNS AND WIDTHS ARE -- 15 8 20 70 11 RECORD IS FIXED-FIELD. STARTING COLUMNS AND WIDTHS ARE -- 15 8 IS 32 15 S6 IS OUTPUT INSTRUCTIONS FOR RECOR" 1 STRING b PIECE 1 OF RECORD 1 STRING 7 STRING 5 PIECE 2 OF RECORD 1 OUTPUT INSTRUCTIONS FOR R£CORr> 2 STRING b PIECE 1 OF RECORD 2 STRING 7 STRING 5 STRING 1 PIECE 2 OF RECORD 2 STRING 5 STRING 5 PIECE 3 OF RECORD 2 OUTPUT INSTRUCTIONS FOR RECORO 3 STRING 6 PIECE 1 OF RECORD 3 STRING 7 STRING 5 STRING 2 PIECE 2 OF RECORD 3 STRING 5 STRING 8 PIECE 3 OF RECORD 3 OUTPUT INSTRUCTIONS FOB RECORD t STRING 6 PIECE 1 OF RECORD 1 STRING 7 STRING 6 STRING 3 PIECE 2 OF RECORD H STRING 1 PIECE 3 OF RECORD 4 STRING H PIECE H OF RECORD M REAL TIME CLOCK INTERROGATED AT I 8 ! 08 I SM . <*579

••• BEGIN RETRIEVAL S5

Appendix II Annotated Control Cards

27
Columns 1-26 contain the letters of the alphabet

Columns 27-56 contain the ten digits

Column 41 contains the output string

delimiter

Column 42 contains a universal

match character

Column 47 must be blank

olumn 50 contains the

input string terminator

the

1 r-Column 52 contains

/ continuation symbo]

\ IOG0000O0OD 000 00 00 000 0000 00000 0000 000 0000000

8 10 11 12 13 H IS IE 17 18 19 20 21 22 2] 24 2S 26 27 2S 29 30 31 32 33 31 35 36 37 38 39 40 41 42 43 44 45 4G 47 48 49 50 51 52 53 54 55 5B 57 58 59 SO 81 82 63 64 S3 65 67 61 69 70 71 72 73 74 75 76 77 78 78 80

I 11111111111111111 111111111111 111111111111111111111111111111111111111

Unit number for the input tape

Unit number for the output tape

-liinary switch controlling printing of the report

Three-way switch for output tape generation

-Binary switch indicating overall search strategy

I Number of record types

000 000 00 000 000 0000 00000 00000 000

1 12 13 14 15 16 17 18 IS 2C 21 22 23 34 25 26 27 28 29 38 31 32 33 34 35 36 37 38 39 40 41 13 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 SS 80 61 62 63 64 65 66 67 68 69 (0 /I 72 73 74 75 76 H 78 79 80 4J 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

' ' ' ' 1 '

J

1 1 1 1 11 11 1 1 1 1 1 1 L

Starting column for block ID Last column for block ID ^Length of one record

-Beginning of record type code field

-hnd of record type code field

28
lilock number for the first block to be processed

-Last block to be processed

JULO 00, 0O0OQ0Q""i"'pfl nn " n '

-? Shift-up symbol (column 1)

-j» Shift-down symbol (Column 2) —^ Column 3 - Universal match symbol

-> Column 4 - Binary switch for shif t-and-lock mode

(0 is off, 1 is on)

-3> Record type number. One card for each record type

> Format type (1= fixed-field, 2 = structured free-field, 3 = flagged)

-» Beginning column of a field

Number of characters in a fixed-field

-^ Record type number. One card for each record type

_^ Format type (1= same width as on input, 2= inserted in a fixedwidth field)

-> A number preceded by 'S' calls for an insert string

v A number calls for a piece of the input

-!?^!!°--!,,!!^=!=^

n 11111111 1111

29

Appendix III

Program Listings

31
MAIN PROGRAM FOR READING THE RPI DATA TAPE AND PRINTING REPORTS COM FROM IT COM

COM THIS PROGRAM USES FOR INPUT A TAPE CONTAINING BLOCKED CARD IMAGES COM

CONTAINING A BLOCK ID IN A FIXED POSITION AND A CODE IDENTIFYING COM

THE TYPE OF INFORMATION OF EACH CARD IMAGE IN ANOTHER FIXED COM

POSITION. COM THIS PROGRAM UNBLOCKS THE TAPE INTO CARD IMAGES AND COLLECTS THEM COM

IN A BUFFER UNTIL THE END OF A UNIT OF INFORMATION IS SENSED. COM

NOTE -- THE INFORMATION IS UNBLOCKED FROM THE FIXED-LENGTH COM PHYSICAL BLOCKS IN WHICH IT IS WRITTEN ON THE TAPE, BUT IS THEN COM

REBLOCKED INTO LOGICAL BLOCKS, IDENTIFIED BY THE ID NUMBER IN A COM FIXED POSITION ON THE CARD. COM THEN IT SEARCHES THE BLOCK LINE-FOR-LINE FOR THE OCCURRENCE OF COM SPECIFIED STRINGS (A SEPARATE SEARCH TABLE BEING USED FOR EACH COM

TYPE OF LINE). IF THE SEARCH CRITERIA ARE MET, IT REFORMATS EACH COM LINE AND PERFORMS INDICATED SUBSTITUTIONS ON IT. THE EDITED LINE COM

COM

COM

COM COM

COM

COM

IS PRINTED, THIS PROCEDURE IS FOLLOWED FOR THE NEXT LINE IN THE

BLOCK, AND THE PROGRAM PROCEEDS TO UNBLOCKING AND REBLOCKING

ANOTHER UNIT OF INFORMATION. CONTROL CARDS READ BY THE MAIN PROGRAM ARE AS FOLLOWS —

THE FIRST CARD CONTAINS THE ALPHABET IN COLUMNS 1 THRU 26. A CHARACTER TO BE READ AS THE UNIVERSAL MATCH SYMBOL BY LINTYP IS INCOM COLUMN 42

.

COM

THE SECOND CONTROL CARD READ BY THE MAIN PROGRAM IS IN 13 FORMAT. COM

IT CONTAINS THE NUMBER FOP THE INPUT TAPE, THE NUMBER FOR THE COM

OUTPUT TAPE OR CARD FUNCH, IF OUTPUT IN ADDITION TO THE PRINTOUT COM

IS DESIRED, AND TWO SWITCHES INDICATING WHETHER THE EDITED OUTPUT COM FROM THE PROGRAM IS TO BE PRINTED AND WHETHER IT IS TO BE WRITTEN COM

ON AN OUTPUT UNIT. THESE NUMBERS ARE FOR NO AND 1 FOR YES. THECOM FIFTH NUMBER I S TO INDICATE AN 'OR' SEARCH IN WHICH THE PROGRAM COM WILL SEARCH FOR BLOCKS IN WHICH AT LEAST ONE RECORD SATISFIES THE COM

SEARCH CRITERIA. IT IS 1 FOR AN 'AND' SEARCH IN WHICH THE PROGRAMCOM

SEARCHES FOR BLOCKS IN WHICH AT LEAST ONE RECORD OF EACH TYPE COM

MEETS THE CRITERIA. COM

THE NEXT CONTROL CARD IS READ BY BSENS. IT GIVES THE FIRST AND COM LAST CARD COLUMNS IN WHICH TO LOOK FOR THE BLOCK ID NUMBER. COM

THE CONTROL CARDS FOR LINTYP COME NEXT. COM THEN FOLLOW CONTROL CARDS FOR THE SEARCH, SUBSTITUTION, AND COM REFORMATTING ROUTINES, IN THAT ORDER. WHEN ALL CONTROL CARDS HAVECOM

BEEN READ, THE PROGRAM BEGINS READING FROM THE INPUT TAPE AND PROCESSING THE INPUT RECORDS. THIS PROGRAM WRITTEN BY R. MCCLENON, NSRDS-NBS, FEB. 1970. DIMENSION LINE( 40 ),IBLOK( 80 ),KARD< 250 ) , IABC( 120 ),KBUF( 2 50)

DIMENSION KSRCH(99 ),JDATA( 60 ),KEY( 60

)

IN AND IOUT ARE THE LOGICAL UNIT NUMBERS FOR THE CARD READER AND

PRINTER, RESPECTIVELY. THEY MUST BE SET IN THE MAIN PROGRAM TO THE APPROPRIATE VALUES FOR THE INSTALLATION. COMMON /IO/ IN, IOUT COMMON /I A/ I ABC COMMON /IB/ MAX.IBLOK

STR IS A COMMON BLOCK CONTAINING STRING BUFFER IC IC MAY BE USED FOR THE STORAGE OF STRING DATA BY MORE THAN ONE

COM

COM

COM

COM

COM

COM

COM COM

COM COM

COM COM

COM

COM COM SUBROUTINE SIMULTANEOUSLY. ICLEN IS THE LENGTH OF IC

.

ICNOW IS ACOM

POINTER INDICATING HOW MUCH OF IC HAS BEEN USED. NEXT AVAILABLE CELL IN IC. ANY SUBROUTINE USING IC MUST RESET ICNOW TO INDICATE ITS USE OF IC, AND MUST SAVE A POINTER TELLING

WHERE IN IC IT BEGAN STORAGE OF STRINGS. COMMON /STR/ ICLEN, ICNOW, ICC 8000 ) COMMON /!/ IW.NTABL COMMON /COUNT/ NPHYS, NCARD, NBLOK

** THE NEXT TWO STATEMENTS ARE INSTALLATION-DEPENDENT ** IN-5

I0UT-6

32

IT PdNTS TO THECOM

COM

COM

COM

COM COM

COM

COM

COM

COM

510152025

3035

40

45

50

55

606570

75

80

8590

95

1 00 105

1 10

1 15 120 125

130 135

140

1 45

150 155

160 165

170

175

1 80 185

190

195 200

2 05 210

215

220

225

230

235

240

245

250

255

260

265

270

275

280

285

290

295

300

305

310

315

320

325

330

335
1020

30

40

5060

C70

80

C

90

C

c

100

ICLEN-8000

ICN0W=1 CALL CL6CK

READ (IN, 380) ( IABC( J ) , J- 1

, 80 ) WRITE (I0UT.37O) ( I ABC( J ), J-= 1 , 80 ) KRDLEN IS THE LENGTH OF KARD 0R KBUF, WHICHEVER IS SHORTER

KRDLEN-200

CALL INPUT ( 0,1 ABC, JDATA, KEY, MX

)

IF (MX.LT.-l) GO TO 360 READ (IN, 380) ( KARD( J ), J= 1

, 80 ) WRITE (I0UT.370) ( KARD( J ), J= 1

, 80 ) CALL INPUT (4, KARD, JDATA, KEY, 80 ) ITAPE-JDATA( 1 ) JTAPE- JDATA( 2

)

ITST1 »JDATA(3

ITST2-JDATA(4

ISRCH-JDATA(5

)

NTABL-JDATA(6 ) ISER"=JDATA( 7 ) ISUB*JDATA(8 ) IREF-JDATA( 9 ) IF (NTABL.LT.l) GO TO 360

NPHYS-0

NCARD-0

NBLOK-0

INITIALIZATION OF SUBROUTINES

CALL BSENS (IABC.0) CALL LINTYP ( I BLOK, II , 0, M

)

CALL TAPOUT ( 0, JDATA, LL)

READ (IN, 380) ( KARD( J ) , J= 1 , 80 ) WRITE (IOUT.370) ( KAPD( J ), J* 1

, 80

)

CALL INPUT ( 4, KARD, JDATA, KEY, 80 ) ISTART=JDATA( 1 ) IFIN-JDATA( 2 ) IF (IFIN.EQ.O) IFIN-99999

IF ( IFIN.LT.ISTART) GO TO 360

IF (ISER.GT.O) G0 TO 10 WRITE ( I OUT, 400

)

CALL MSERCH (IBLOK.80,0)

G0 T0 20 WRITE (I0UT.470)

IF (ISUB.GT.O) G0 T0 30 WRITE ( I0UT.41O ) CALL MSUBS (LINE, 300,0)

Gfl T6 40 WRITE ( I0UT,48O ) IF (IREF.GT.O) G6 T0 50 WRITE ( I0UT,42O ) CALL MXREFM ( , KBUF, KARD, KRDLEN ) G0 T6 60 WRITE ( IflUT.490 ) CALL CLOCK

WRITE ( IflUT,390 ) L-0 READ A CARD IMAGE FR0M THE TAPE CALL UNBL6K ( ITAPE, LINE, IW, 1H , L, IE)

NCARD-NCAPD*1

D0 80 J'l.NTABL

KSRCH( J)-0

CHECK TAPE STATUS - IF ABNORMAL, GO TO END-ACTION

IF ( IE ) 300,90,90

K-l SEND LINE TO BSENS TO SEE IF BLOCK IS FINISHED

CALL BSENS (LINE.K)

IF (K) 70,70,100

NEW BLOCK - K IS NUMBER OF CHARACTERS - NL IS NUMBER OF LINI NL-K/IW

COM 340 COM 345 COM 350 COM 355 COM 360 COM 365 COM 370 COM 3 75 COM 380

COM 385

COM 390 COM 395 COM 4 00 COM 4 05 COM 410 COM 415 COM 420 COM 425

COM 430 COM 435 COM 440 COM 445 COM 450

COM 455 COM 460 COM 465 COM 470 COM 4 75 COM 480 COM 485 COM 490 COM 495 COM 500 COM 505 COM 510 COM 515 COM 520 COM 525 COM 530 COM 535 COM 540 COM 545 COM 550 COM 555 COM 560 COM 565 COM 570 COM 575 COM 580

COM 585 COM 590 COM 595 COM 600 COM 605 COM 610 COM 615 COM 620

COM 625 COM 630 COM 635 COM 64 COM 645 COM 650 COM 655 COM 660 COM 665 COM 67 COM 675

33
NBI.eK-NBI.eK-M

IF ( NBLOK.LT. ISTART ) G6 TO 70 IF (NBL6K.GT. IFIN) GO TO 320

IF (ISER.GT.O) GO TO 180

C EXAMINE 6NE LINE AT A TIME

D6 150 J-l.NL

I2-IW»J

II -I2*1-IW

C SEE WHICH TYPE LINE IS CALL LINTYP ( IBLOK, 1 1

, IW, M

)

MM-M

IF ( M) 150,150, 110 C VALID TYPE

110 D6 120 1-11,12

JJ-I-I 1 *1 C TRANSFER LINE T6 SEARCH AND SUBSTITUTION BUFFER

120 KBUF( JJ)-IBLeK( I

)

CALL MSERCH (KBUF,IW,M)

IF (M) 150,150,130

C SEARCH SUCCESSFUL

130 IF (ISRCH) 180,180,140

C IN AND-MODE - CONTINUE SEARCHING AFTER MARKING SUCCESS

140 KSRCH(MM)-1

150 CONTINUE

IF (ISRCH) 70,70,160

C SEE IF AND-SEARCH SATISFIED FOR EACH TABLE

160 D6 170 J-1,NTABL

IF (KSRCH(J)) 70,70,170

170 CONTINUE

C SEARCH SATISFIED

180 DO 290 J-1,NL

I2-IW*J

il -I2»1-IW

CALL LINTYP ( IBLOK, 1 1 , IW, M

)

IF (M) 190,190,200

190 WRITE (I0UT,43O) ( I BLOK( I ), I- 1 1, 1 2

)

GO TO 290 200 DO 210 1-11,12 JJ-I-I 1*1 210 KBUFC JJ)-IBLOK( I ) C SEND EACH LINE TO SUBSTITUTION AND REFORMATTING

LL-IW

IF (IREF.GT.O) GO TO 220 CALL MXREFM ( M, KBUF, KARD, LL ) IF (LL.LE.O) «0 TO 290 GO TO 240 220 DO 230 I-l.IW

230 KARD( I )-KBUF( I ) 240 IF (ISUB.GT.O) GO TO 250 CALL MSUBS (KARD.LL.M)

250 CONTINUE

IF ( ITST1 ) 260,270,260

260 WRITE (I0UT,370) ( KARD( I ), I- 1 , LL

)

270 IF ( ITST2 ) 280,290,280

280 CALL TAPOUT (M.KARD.LL)

290 CONTINUE

WRITE ( IOUT.440

)

C GET NEXT BLOCK GO TO 70 C THAT WRAPS IT UP 300 IF (IE*3) 340,340,310

310 WRITE (I0UT.45O)

320 IF (ITST2) 330,350,330

330 CALL TAPOUT ( - 1 ,KARD, LL ) GO TO 350 340 WRITE (I0UT.460) IE 350 STOP

360 WRITE (It»UT,500)

COM 680

COM 685 COM 690 COM 695 COM 700 COM 705

COM 710

COM 715 COM 720 COM 725 COM 73 COM 735 COM 74 COM 745 COM 750 COM 755 COM 760

COM 765 COM 770

COM 775 COM 780 COM 785 COM 790 COM 795 COM 800

COM 805 COM 810 COM 815 COM 820 COM 82 5 COM 83 COM 835 COM 840 COM 845 COM 850 COM 855 COM 860 COM 865 COM 870 COM 875 COM 880 COM 885 COM 890

COM 895 COM 900 COM 905 COM 910 COM 915 COM 920 COM 92 5 COM 930 COM 935 COM 940 COM 945 COM 950 COM 955 COM 960

COM 965 COM 970 COM 975 COM 980 COM 985 COM 990 COM 995

C0M1000

C0M1 005 C0M1010

C0M1015

84
Ge TO 350 C0M1020

C0M1O25

FORMAT (IX, 120A1) COM1030

FORMAT (120A1) COM1 035 FORMAT (21H0*#* BEGIN RETRIEVAL /1H1) C0M1 040 FORMAT (37H0»«* SEARCH CONTROL CARDS FOLLOW **» ) CflMl 045 FORMAT (41H0*#* SUBSTITUTE CONTROL CARDS FOLLOW *** ) C0M1050

FORMAT (37H0*** REFORM CONTROL CARDS FOLLOW ** ) CflMl 055 FORMAT (26H0BAD LINE TYPE CODE BELOW /1X.80A1) C0M1O6O

FORMAT (IX) CflMl 065 F0RMAT (20H0END-0F-FILE. STflP. ) CAM1070

FORMAT (22H0NTRAN ERROR , STATUS , I2.8H. STOP. ) CflMl 075

FflFMAT (45H0 *»* SEARCHING OMITTED - NO SEARCH CARDS **• ) CflMl 080 FORMAT (52H0 *#» SUBSTITUTION OMITTED - NO SUBSTITUTE CARDS ** ) CflMl 085 FORMAT (48H0 *»* REFORMATTING OMITTED - NO REFORM CARDS *» ) C0M1090

FORMAT (51H0 »*» BAD PARAMETER OR MISFORMATTED CARD. STflP. * ) CflMl 095 END CflMllOOSUBR0UIINE BSENS (LINE.L) BSN 5 BSENS BSN 10 BSN 15 BSENS DETECTS THE END OF A BLOCK OF INFORMATION IN A FILE WHERE BSN 20 SEVERAL CARD IMAGES HAVING THE SAME BLOCK IDENTIFICATION IN A BSN 25 FIXED POSITION MAKE UP ONE BLOCK. BSN 30 BSENS IS CALLED WITH ONE CARD IMAGE AT A TIME IN LINE. IT BSN 35 COLLECTS THEM IN IBLOK UNTIL THE BEGINNING OF A NEW BLOCK IS BSN 40 DETECTED, WHEN IT SIGNALS THIS TO THE MAIN PROGRAM AND RETURNS BSN 45 BLOCK. BSN 50 BSN 55 BSENS MUST BE INITIALIZED BY CALLING IT WITH L-0. THIS WILL CAUSEBSN 60

IT TO READ A CONTROL CARD FROM UNIT IN AND TO SET CERTAIN SWITCHESBSN 65 THE CONTROL CARD CONTAINS IN 13 FORMAT THE STARTING AND ENDING BSN 70

CflLUMNS FAR THE BLOCK ID IN A RECORD AND THE WIDTH OF A RECORD. BSN 75 IF THE RECORDS ARE CARD IMAGES THE LAST NUMBER WILL BE 80. BSN 80 BSN 85 LINE - THE VECTOR IN WHICH 0NE CARD IMAGE OR RECORD AT A TIME IS BSN 90 TRANSMITTED TO BSENS BSN 95

L - IN THE CALL SET TO TO INITIALIZE BSENS, flTHERWISE TO A BSN 100 POSITIVE NUMBER. ON RETURN SET TO ZERO FAR END flF BLOCK NOT FflUNDBSN 105 OR TO THE LENGTH OF THE BLOCK ( IN CHARACTERS) IF THE END IS BSN 110 SENSED BSN 115 IBLOK - THE ARRAY IN WHICH A BLOCK IS BUILT UP FROM THE LINES BSN 120 ALL THE RECORDS IN IBLOK WITH THE SAME ID WILL BE RETURNED TO THE BSN 125 CALLING PROGRAM WHEN THE END IS SENSED BSN 130 IABC - CONTAINS THE STANDARD ALPHABETIC DICTIONARY CARD BSN 135

IN AND IOUT - THE LOGICAL UNIT NUMBERS FOR CARD READER AND PRINTERBSN 140 BSN 145 THIS ROUTINE WRITTEN BY R. MCCLENON , NSRDS-NBS, FEB. 1970 BSN 150 BSN 155 DIMENSION LINE( 250 ),IBLOK( 8000 ),IBUF( 250), N( 250) BSN 160 DIMENSION IABCC 120 ),JDATA(60 ),KEY( 60) BSN 165 COMMON /I0/ IN, IOUT BSN 170 COMMON /IB/ MAX, IBLOK BSN 175 COMMON /I A/ IABC BSN 180 COMMON /W/ KL.NTABL BSN 185 COMMON /COUNT/ NPHY S, NCARD, NBLOK BSN 190

10 FORMAT ( 80A1 ) BSN 195

20 FORMAT (1X.80A1) BSN 200

IF (L) 30,30,70 BSN 205

C INITIALIZATION BSN 210

30 READ (IN, 10) ( I BUF( J ), J- 1

, 80 ) BSN 215 WRITE (IOUT, 20) ( IBUF( J ) , J- 1 , 80 ) BSN 220

KLMAX-250 BSN 225

IDLEN-10 BSN 230

CALL INPUT (4.IBUF, JDATA.KEY, 80 ) BSN 235

Kl-JDATA(l) BSN 240 35
K2«JDATA< 2

)

KL«JDATA(3 ) KW-K2-K1 *1 IF (KW-IDLEN) 40,40,240

40 D0 50 J*l ,KW 50 N( J)-=IABC( 47 ) IF (KL-KLMAX) 60,60,250

60 IX = -1 1=0 MAX-8000 RETURN

C CHECK NEXT RECORD

70 11-1*1 I2=I*KL

IF (I2-MAX) 80,80,200

80 IF (IX) 170,110,90

90 DO 100 J=1,KL

C RECOVER A RECORD FR6M TEMPORARY STORAGE IN IBUF

100 IBLflK( J)-IBUF( J

)

IX-0

110 DO 120 J-Il ,12

II-J-I1*1

C TRANSFER THE RECflRD T0 IBL0K

120 IBL0K< J)«LINE( II ) I-I*KL I3-I1»K1-1

14=11 *K2-1

Dfl 130 J-13,14

JJ=J-I3*1

C COMPARE THE ID FIELD AGAINST THAT OF THE LAST RECORD

IF < IBL0K( J )-N(JJ ) ) 140,130,140

130 CONTINUE

G6 Tfl 190 C FOUND START OF NEW RECflRD 140 Dfl 150 J=1,KW

JJ"=J*I3-1 C SAVE ID AND SET SIGNAL TO MAIN PR0GRAM

150 N( J )-IBL0K( JJ ) L-Il-1

Dfl 160 J=I1,I2

JJ-J-I1M

C STORE THE BEGINNING 0F THE NEXT RECORD IN IBUF

160 IBUF( JJ)»IBL0K< J ) I-KL

IX'l RETURN

170 13 - Il+Kl-1

DO 180 J-l.KW

JJ"=J*I3-1 180 N< J ) - LINE(JJ)

DO 185 J«1,KL

185 IBLOK(J) - LINE(J)

I » KL IX-0

190 L-0 RETURN

200 WRITE (IOUT.210) MAX

210 FORMAT (37HOL0GICAL BLOCK IS TOO L0NG. LIMIT IS.I6.9H,

1H THE FIRST AND LAST CARD IMAGES IN THE BUFFER ARE —

)

220 FORMAT (1X.126A1)

WRITE (IOUT.220) ( I BL0K( J ), J* 1, KL

)

WRITE (I0UT.22O) ( L INE( J ), J- 1, KL

)

STflP 230 FORMAT (31H0ID FIELD WIDTH MAY NOT EXCEED ,13)

240 WRITE (IOUT.230) IDLEN KW-IDLEN

GO TO 40

BSN 245 BSN 250

BSN 255 BSN 260 BSN 265 BSN 270 BSN 275

BSN 280

BSN 2 85 BSN 290

BSN 295

BSN 300

BSN 3 05 BSN 310

BSN 315 BSN 320

BSN 325

BSN 330 BSN 335

BSN 340

BSN 345

BSN 350

BSN 355

BSN 360

BSN 365

BSN 370

BSN 375

BSN 380

BSN 385

BSN 390

BSN 395 BSN 400 BSN 4 05 BSN 410

BSN 415

BSN 420

BSN 425 BSN 430

BSN 435

BSN 440 BSN 445 BSN 450 BSN 455

BSN 460 BSN 465 BSN 470

BSN 475 BSN 477

BSN 480

BSN 482 BSN 484 BSN 486 BSN 488

BSN 490

BSN 495

BSN 500

BSN 5 05 /52BSN 510 BSN 515 BSN 520 BSN 525 BSN 530 BSN 535 BSN 540 BSN 545 BSN 550 BSN 555 36
250 WRITE (IOUT.260) KLMAX

260 FORMAT ( 4 1 HOBSENS RESTRICTS THE CARD IMAGE WIDTH TO ,14) KL-KLMAX

GO T0 60 END

SUBROUTINE UNBLOK < IRTAPE, ID, LENGTH, I BLANK, K, IEND

)

UNBLOK

UNBLOK UNBLOCKS BCD RECORDS AND RETURNS THE ORIGINAL RECORD IN PIECES (LINES) OF SPECIFIED LENGTH IN Al FORMAT. IT SERVES THE SAME PURPOSE THAT AN Al READ STATEMENT DOES FOP UNBLOCKED RECORDS

IRTAPE IS THE UNIT ON WHICH TO EXPECT THE BLOCKED INFORMATION.

ID( ) IS THE VARIABLE IN WHICH UNBLKS PLACES THE CURRENT LINE. LENGTH IS THE NUMBER OF CHARACTERS TO BE RETURNED PER LINE. IF THE LAST PIECE OF THE ORIGINAL RECORD IS SMALLER THAN 'LENGTH'

THE REST OF ID( ) IS FILLED OUT WITH 'IBLANK'. USUALLY A BLANK. IF COMPARISONS ARE TO BE MADE WITH CHARACTERS READ IN UNDER Al FORMAT, IBLANK MUST ALSO HAVE BEEN READ IN UNDER Al FORMAT.

IEND IS SET TO A NON-ZERO INTEGER WHEN THE TAPE CANNOT BE READ FO ANY REASON. IT IS SET TO -3 OR -4 ON A TAPE READ ERROR AND

TO -2 ON REACHING AN END OF FILE.

K IS A COUNTER WHICH MUST BE A VARIABLE IN THE CALL STATEMENT.

IT IS THE CURRENT LINE BEING REQUESTED MINUS ONE. IN THE FIRST CALL TO UNBLKS, 'K' MUST BE SET TO ZERO. THE SUBROUTINE WILL ITSELF UP-DATE 'K' AND RESET IT TO ZERO

AT THE END OF EACH BLOCKED RECORD. DIMENSION ID( 136),ISTRIN( 4500 ),IB( 750 ) IEND-0

IF K IS ZERO, A NEW RECORD MUST BE READ

IF ( K) 10,10,80

D K-0 CALL NTRAN ( I RTAPE, 2 , 750 , I B, L ) IF ( L*l ) 30,20,50

ABNORMAL TERMINATION

IEND-L RETURN

ICHAR»6*L UNPACK CHARACTERS

DO 60 1-1 ,ICHAR

60 ISTRINd )-IBLANK

DO 70 1-1 .ICHAR

.I-I-( ( 1-1 )/6)*6

IZ*( 1-1 )/6*l

FLD( 0,6,ISTRIN( I ) )-FLD( 6*( J- 1 ), 6, IB( IZ ) ) 70 CONTINUE

C SET POINTERS

80 LI -K*LENGTH*1

L2 -K*LENGTH*LENGTH

I«0

IF (Ll-ICHAR) 90,90,10

90 IF (L2-ICHAR) 130,120,100

100 IZ-ICHAR*1 DO 110 J»IZ,L2

110 ISTRIN( J )-IBLANK

120 K=-l

C TRANSFER CHARACTERS

130 DO 140 J-L1.L2

1-1*1

140 ID< I )-ISTRIN( J

)

K-K*l GO TO 40 END

BSN 560 BSN 565 BSN 570 BSN 575 BSN 580

UNB 5 UNB 1 UNB 15 UNB 20 UNB 25

.UNB 30 UNB 35

UNB 40

UNB 45

UNB 50 UNB 55 UNB 60 UNB 65

UNB 70 UNB 75 RUNB 80

UNB 85 UNB 90 UNB 95 UNB 1 00 UNB 1 05 UNB 1 10 UNB 115

UNB 12C UNB 125

UNB 130 UNB 135

UNB 140 UNB 145

UNB 150 UNB 155

UNB 160 UNB 165

UNB 170

UNB 175 UNB 180 UNB 1 85 UNB 190 UNB 195

UNB 200

UNB 205

UNB 21 UNB 215

UNB 220

UNB 225

UNB 230

UNB 235

UNB 240

UNB 245

UNB 250

UNB 255

UNB 260

UNB 265

UNB 270 UNB 275

UNB 280

UNB 285

UNB 290

UNB 295-

37
12030

40

50

6070

C80

C

90

FREE-FIELD INPUT ROUTINE SUBROUTINE INPUT ( M.LINE, N, IT , MM

)

IN

IN

ININ THIS IS A FREE-FIELD INPUT ROUTINE FOR USE WITH REFORM AND RELATEDIN

PROGRAMS. IT IS CALLED WITH A LINE OF 80 CHARACTERS IN Al FORMAT. IN IT ANALYZES THE LINE, DETERMINES WHETHER EACH NON-BLANK ITEM IS A IN CHARACTER STRING OR AN INTEGER, AND RETURNS THE INFORMATION IN IN ARRAY N. THE TYPE OF EACH ITEM IS INDICATED BY THE SETTING OF IT, IN WHICH IS 1 FOR AN INTEGER AND 2 FOR A STRING CHARACTER. A ZERO IN VALUE IN IT INDICATES THAT THE LINE HAS BEEN EXHAUSTED, A -1 THAT IN

A CONTINUATION SYMBOL HAS BEEN READ. IN THE SWITCH M INDICATES WHICH OF SEVERAL MODES ARE TO BE USED TO IN CONVERT THE LINE. THERE ARE AT PRESENT FOUR POSSIBLE MODES.

k

M

ALL CHARACTERS ARE TO BE RETURNED TO THE CALLING PROGRAM

REGARDLESS OF WHETHER THEY ARE LETTERS OR PUNCTUATION.

CONTIGUOUS DIGITS ARE TO BE TREATED AS DISTINCT ONE-DIGIT

INTEGERS. PUNCTUATION MARKS ARE TO BE RETURNED ON THE SAME BASIS AS

IN

IN

IN

IN

IN

It! ALPHABETIC CHARACTERS. CONTIGUOUS DIGITS ARE TO BE TREATED IN

AS PART OF A SINGLE INTEGER. NON-NUMERIC CHARACTERS OTHER THAN LETTERS OF THE ALPHABET

(I.E., PUNCTUATION) ARE TO BE IGNORED. ADJOINING DIGITS

WILL BE TREATED AS PART OF A SINGLE INTEGER.

ALL NON-NUMERIC CHARACTERS WILL BE TREATED AS NOISE AND

IGNORED, INCLUDING ALPHABETIC LETTERS. CONTIGUOUS DIGITS

WILL BE TREATED AS PART OF A SINGLE INTEGER. OTHER MODES CAN BE PROVIDED BY MINOR REPROGRAMMING

.

M

U

ININ

INININ

ININ

IN

IN

IF INPUTS IS CALLED WITH M--MX, MM WILL BE SET TO THE POSITION OR IN CARD COLUMN IN WHICH N( M ) STARTED ON THE PREVIOUS CARD READ. IN

IN THIS SUBROUTINE MUST BE INITIALIZED BY CALLING IT WITH M-0 AND THEIN

EDPAC DICTIONARY CARD IN THE ARRAY LINE. THIS CARD CONTAINS THE IN NUMBERS IN COLUMNS 27-36. COLUMN 47 MUST BE BLANK. THE CHARACTERIN

IN COLUMN 50 WILL BE TREATED AS A SCAN TERMINATOR — ANY

INFORMATION FOLLOWING IT WILL BE IGNORED ON A CARD. THE CONTINUATION SYMBOL WILL BE FOUND IN COLUMN 52.

FREE-FIELD INPUT ROUTINE «•»»»«#*»*»

ININ

IN THIS CARD IS STORED DURING THE INITIALIZATION AND DEFINES THE BCD IN REPRESENTATIONS OF EACH OF THE CHARACTERS. IN THIS SUBROUTINE WRITTEN BY R. MCCLEN0N, NSRDS-NBS, SEPTEMBER 1968, IN AND REWRITTEN AUGUST 1969. IN

ININ

ININ

IN

IN

IN

IN

ININ

IN

ININININ

ININ

IN

IN

ININ

IN

IN

IN

IN

DIMENSION NUM( 10 ),KA< 26 ),LOC( 61 ) DIMENSION LINE( 80 ),N(60 ), IT(60 ) FORMAT (31H0INPUT INTERPRETER INITIALIZED ) FORMAT ( 1X.80A1 ) FORMAT (25H0SCAN TERMINATOR OMITTED ) FORMAT ( 29H0CONTINUATION SYMBOL OMITTED ) FORMAT ( 6H0MODE ,I4,32H REQUESTED IN INPUTS IS UNKNOWN ) FORMAT (35H0 INPUTS CONFUSED, CANNOT CONTINUE ) FORMAT (33H0INPUTS NOT PROPERLY INITIALIZED ) IOUT-6 CHECK THE MODE

IF (M) 160,80,230

INITIALIZATION

WRITE ( I0UT.10

)

WRITE (IOUT.20) ( LINE( JX ), JX- 1

, 80 ) KBL-LINE( 47

)

MM-0

ST6RE THE NUMBERS AND LETTERS APPROPRIATELY

DO 90 J-1,26

KA( J)-LINE( J) DO 100 J-1,10

101520

25

3035

40

45

50

5560

6570

75

80

85

90

95 100 105

1 10

1 1 5 120 125

130 135

140 145

150

155

160 165

170

175 180

185

190 195 200

205

21215

220

225

230

235

240

245

250

255

260

265

270

275

280

285

290 295

300

305

31315

320

325

330

335

38
NUM( J

) -LI NE( 26 J

)

KST«LINE( 50)

IF (KST-KBL) 120,110,120

KST-0

ERROR, NO TERMINATOR PROVIDED

MM "MM

WRITE (I0UT.30)

KCN-LINEC 52

)

IF ( KCN-KBL ) 140,130,140

KCN-0

ERROR, NO CONTINUATION SYMBOL PROVIDED

MM-MM-1 WRITE ( IOUT.40

)

KZ-LINE( 45 ) DO 150 J-1,31

LOC( J)-0

SET STATUS INDICATOR TO READY MSTAT

INITIALIZATION FINISHED

RETURN

LOCATE POSITION OF FIELD

IF (M*61) 190,190,170

IF (MSTAT) 210,200,180 MX--M MM-LOC(MX)

RETURN

ERROR TERMINATION SECTION

WRITE ( I0UT,5O ) M GO TO 210 WRITE (TOUT, 70

)

WRITE <IOUT,60)

THE PROGRAM IS DISABLED TO PREVENT FURTHER OPERATION UNTIL RECOVERY IS MADE

MSTAT--1 DO 220 JM.30

IT( J)"-2

N( J)-0 RETURN

THIS IS THE OPERATIONAL PORTION OF INPUTS NMODES-6

IF (M-NMODES) 240,240,190

IF (MSTAT) 210,200,250

THE SWITCHES II AND 12 ARE SET DEPENDING ON THE VALUE OF M GO TO (260,270,280,290,300,190), M

II -0 12-0 GO TO 310

I 1 -1 12-0 GO TO 310

II -1 12-1 GO TO 310

II -1 12-2 GO TO 310 GO TO 190 PREPARE TO CONVERT LINE

K IS TBE CURRENT POSITION OF THE SCAN NC IS THE CURRENT POSITION IN N

K-l NC-1 DO 320 J-1,60

ERASE THE ARRAYS

N( J )-0 IT(J)-0

39

IN 340

IN 345

IN 350

IN 355

IN 360

IN 365

IN 370

IN 375

IN 380

IN 385

IN 390

IN 395

IN 400

IN 405

IN 41 IN 415

IN 420

IN 425

IN 43

IN 435

IN 440

IN 445

IN 450

IN 455

IN 460

IN 465

IN 470

IN 475

IN 480

IN 485

IN 490

IN 495

IN 500

IN 505

IN 510

IN 515

IN 52 IN 525

IN 53 IN 535

IN 540

IN 545

IN 550

IN 555

IN 560

IN 565

IN 570

IN 575

IN 580

IN 585

IN 590

IN 595

IN 600

IN 605

IN 61 IN 615

IN 62 IN 62 5 IN 63

IN 635

IN 640

IN 645

IN 650

IN 655

IN 660

IN 665

IN 670
320 L0C(J)-0

L-0

KNT«0

MK»80

C MM, IF NON-ZERO, IS THE LINE WIDTH

C MK, THE LINE WIDTH, IS SET TO 80 IN DEFAULT

IF (MM) 210,340,330

330 MK-MM

C TEST FOR LINE TERMINATOR

340 IF ( LINE( K)-KST) 350,530,350

C TEST FAR CONTINUATION SYMBOL

350 IF ( LINE( K)-KCN) 360,520,360

360 IF ( LINE( K)-KBL ) 390,370,390

C IF THIS IS A BLANK, ADVANCE THE P0INTES AND CONTINUE THE SCAN

370 K-K*l

IF (L) 210,380,450

380 IF (K-MK) 340,340,530

390 CONTINUE

DO 400 J-l, 10 C CHECK FOR A NUMBER

IF ( LINEC K)-NUM( J ) ) 400,410,400

400 CONTINUE

GO TO 440

C NUMBER FOUND

410 NN-J-1

C ADD NUMERICAL VALUE TO COUNT REGISTER

KNT-10*KNT*NN

L-l

IF ( II ) 210,450,420

420 IF (K-MK) 430,450,450

430 K-K*l GO TO 340 440 IF (L) 210,460,450

C STORE THE NUMBER IN N 450 N( NO-KNT

IT( NO-1

L0C( NO-K-1

KNT-0

L-0 GO TO 510 C MUST DETERMINE WHETHER TO STORE OR REJECT CHARACTER

460 IF (12-1) 500,470,490

470 DO 480 J-l, 26

C SEE IF CHARACTER IS A LETTER

IF ( KA( J )-LINE( K) ) 480,500,480

480 CONTINUE

IF (KZ-LINE(K)) 490,500,490

490 K«K*1

C CHARACTER IGNORED, POINTER ADVANCED, SCAN CONTINUES

GO TO 340

C STORE A NON-NUMERIC CHARACTER IN N

500 N( NC)-LINE( K)

IT( NO -2 L0C( NC)-K

K-K*l

C INCREASE COUNT OF CHARACTERS OR NUMBERS STORED

510 NC-NC»1

IF (NC-60) 340,340,530

C CONTINUATION SYMBOL READ, STORE - 1 IN N AND RETURN

520 L0C(NC)»K

IT( NC)---

N( NO-0

NC-NCM

C INPUT RETURNS WHEN THE LINE IS EXHAUSTED OR WHEN A STOP OR

C CONTINUE SYMBOL IS READ

530 RETURN

END 40

IN 675

IN 680

IN 685

IN 690 IN 695

IN 700

IN 705

IN 71 IN 715

IN 720

IN 725

IN 730

IN 735

IN 740

IN 745

IN 750

IN 755

IN 760

IN 765

IN 770

IN 775

IN 780

IN 785

IN 790 IN 795

IN 800

IN 805

IN 810

IN 815

IN 82 IN 825

IN 830 IN 835

IN 840

IN 845 IN 850 IN 855

IN 860

IN 865

IN 870

IN 875

IN 880

IN 885

IN 890

IN 895

IN 900

IN 905

IN 910

IN 915

IN 92 IN 925

IN 93 IN 935

IN 940

IN 945

IN 950

IN 955

IN 960

IN 965

IN 97

IN 975

IN 980

IN 985

IN 990 IN 995

IN 1000

IN 1005-
1020

30

C

40

SUBROUTINE LINTYP ( IBUF,K,L,N) LNT LINTYP LNT

LNT LINTYP DETERMINES THE FORMAT OR KIND 8F INFORMATION OF A RECORD INLNT

A FILE CONTAINING SEVERAL DIFFERENT KINDS OF RECORDS, WHICH ARE LNT DISTINGUISHED FROM EACH OTHER BY A LABEL OR IDENTIFIER IN A FIXED LNT

FIELD. LNT

A NUMBER INDICATING THE TYPE OF RECORD IS RETURNED IN N. LNT LNT WHEN L IS SET TO ZERO TO SIGNAL INITIALIZATION LINTYP READS LNT CONTROL CARDS FROM THE CARD READER LNT

THE FIRST CONTROL CARD IS IN 13 FORMAT AND TELLS THE STARTING AND LNT ENDING POSITIONS OF THE IDENTIPER FIELD WITHIN A RECORD LNT EACH SUBSEQUENT CONTROL CARD IS IN 10A1 FORMAT AND CONTAINS THE LNT CHARACTERS WHICH WILL BE USED AS AN IDENTIFIER SEQUENCE FOR A LNT RECORD TYPE. ANY RECORD HAVING THE IDENTIFIER SEQUENCE CONTAINED LNT

ON THE FIRST OF THESE CARDS WILL BE CONSIDERED A TYPE 1 RECORD, LNT ANY CARD HAVING THE SAME IDENTIFIER AS THE SECOND SUCH CARD IS A LNT TYPE 2 RECORD, ETC. THE MATCH CHARACTER, IABC(42), INDICATES THATLNT

ANY CHARACTER IS TO BE ACCEPTED IN THE LOCATION WHERE IT APPEARS LNT

A BLANK CARD SIGNALS THE END OF THE CARD INPUT TO LINTYP LNT

LNT

IBUF - A BLOCK WHICH INCLUDES THE LINE IN QUESTION. IBUF MAY BE LNT

THE LINE ITSELF OR IT MAY BE AN ARRAY CONTAINING BLOCKED DATA. LNT

K - THE POINTER TELLING LINTYP THE POSITION IN IBUF WHERE THE LINELNT

BEGINS. IF THE DATA HAS BEEN UNBLOCKED BY THE MAIN PROGRAM BEFORELNT

CALLING LINTYP K SHOULD BE SET TO 1. LNT

L - IS SET TO ZERO TO INITIALIZE LINTYP OR TO A POSITIVE NUMBER TOLNT

IDENTIFY A RECORD LNT

N - ON RETURN CONTAINS THE NUMERIC TYPE OF THE RECORD IF IT HAD A LNT

A RECOGNIZABLE IDENTIFIER OR ZERO IF IT DID NOT LNT IABC - THE STANDARD ALPHABETIC DICTIONARY CARD. IABC( 42 ) SHOULD CONTAIN A MATCH CHARACTER WHICH IN A CONTROL CARD INDICATES THAT ANY CHARACTER MAY APPEAR IN THIS POSITION FOR THIS IDENTIFIER

SEQUENCE

IN AND IOUT - LOGICAL UNIT NUMBERS FOR CARD READER AND PRINTER

50

C

THIS ROUTINE WRITTEN BY R. MCCLENON , NSRDS-NBS, FEB. 1970 COMMON /IO/ IN, IOUT DIMENSION IBUF( 4000 ), IABC(80 ),KODE( 250

COMMON /I A/ IABC COMMON /W/ KL,NTABL

DIMENSION JDATA(60 ),KEY( 60 ),KARD( 80 ) FORMAT ( 1X.80A1 ) FORMAT ( 80A1 ) FORMAT < IX, 12, IX, 10A1

IF ( L) 40,40,90

INITIALIZATION - READ CONTROL CARDS

READ (IN, 20) ( KARD( J), J»l,80

WRITE (IOUT, 10) ( KARD( J ), J-1,80 ) CALL INPUT (4.KARD, JDATA.KEY, 80 ) K1»JDATA( 1 ) K2*JDATA( 2 ) IW»K2-K1*1

LIM-250

IF (IW-10) 50,50,70

I 1 -1 I2-IW READ AN IDENTIFIER INTO KODE

DO 60 M«l ,NTABL READ (IN, 20) ( K0DE( J), J-Il, 12 ) WRITE (IOUT, 30) M, ( K0DE( J ), J- II , 12 )

LNT

LNT

LNT

LNT

LNT LNT

LNT

LNT

LNT

LNT

LNT

LNT

LNT

LNT

LNT

LNT

LNT

LNT

LNT LNT

LNT

LNT

LNT

LNT

LNT

LNT LNT

LNT

LNT

LNT

LNT

LNT

5101520

2530

35

40

45

50

5560

6570

75

80

8590

95 100 105

110

1 1 5 120

125

130 135

140 145

150

155 160

165 170

175

1 80 185

190

195 200

205

210

215

220

225

230

235

240

245

250

255

260

265

270

275

280

285

290

295

300

305

310

315

41
11-11 *IW

I2*=I2*IW

IF (I2-LIM) 60,60,70

60 CONTINUE RETURN

70 WRITE (I0UT.80)

80 FORMAT (42H0STORAGE LIMIT OF LINTYP EXCEEDED. STOP

C COMPARE RECORD AGAINST EACH STORED IDENTIFIER

90 DO 120 J=1,NTABL

KK-K1 *K-1 DO 110 I-l.IW

II-I*( J-l )*IW

IF ( IABC( 42 )-KODE( II)

)

100 IF ( IBUF( KK)-KODE( II) ) 110 KK=KK*1

C IDENTIFIER RECOGNIZED

N*J RETURN

120 CONTINUE

C RECORD DID NOT CONTAIN

N-0 RETURN

END

STOP . )

100, 110, 100

120, 110, 120

A RECOGNIZABLE IDENTIFIER

LNT 320

LNT 325

LNT 330

LNT 335 LNT 340

LNT 345

LNT 350

LNT 355

LNT 360

LNT 365

LNT 370 LNT 375

LNT 380 LNT 385

LNT 390

LNT 395 LNT 400

LNT 405

LNT 410 LNT 415

LNT 42 LNT 425

LNT 430

LNT 435-

SUBROUTINE TAPOUT (M,LINE,LEN)

TAPOUT

TAP

TAP TAP THIS SUBROUTINE WRITES THE OUTPUT FROM COMBO ONTO ONE OR MORE TAP TAPES. (CARD OUTPUT MAY ALSO BE OBTAINED FROM THIS SUBROUTINE. TAP NO CHECK IS MADE TO ASSURE THAT LOGICAL UNITS SPECIFIED ARE LEGAL TAP FOR THE INSTALLATION.

)

TAP

THE FOURTH NUMBER 0N THE SECOND CONTROL CARD TO COMBO (THE ONE TAP AFTER THE ALPHABET CARD) INDICATES THE TYPE OF OUTPUT DESIRED FROMTAP

THE ROUTINE TAP0UT TAP

A INDICATES NO OUTPUT OTHER THAN A PRINTED REPORT. TAP

A 1 INDICATES A SINGLE OUTPUT UNIT, ON WHICH EVERY LINE WILL BE TAP WRITTEN. THIS IS ESSENTIALLY A TAPE COPY OF THE PRINTED REPORT. TAP

A 2 INDICATES MULTIPLE OUTPUT UNITS, OR SELECTIVE OUTPUT TO TAPE. TAP ONLY IN THE EVENT THAT 2 IS SPECIFIED WILL SPECIAL CONTROL CARDS TAP

BE READ BY TAPOUT. TAP

THE CONTROL CARDS TO TAPOUT ARE FREE-FORM, VIA THE ROUTINE INPUT. TAP THERE IS ONE FOR EACH TYPE OF LINE WHICH IT IS DESIRED TO WRITE TOTAP TAPE ( SR OTHER DEVICE BESIDES THE PRINTER). THE CARD FOR A GIVEN TAP

LINE TYPE HAS THE TYPE NUMBER, FOLLOWED BY ONE OR MORE LOGICAL TAP

UNITS. FOR INSTANCE, IF A CARD CONTAINS TAP

3 7 9 TAP EVERY TYPE 3 LINE THAT SATISFIED THE SEARCH WILL, AFTER EDITING, TAP

BE WRITTEN ON UNITS 7 AND 9. TAP

ONE RESTRICTION IS THAT THE CONTROL CARDS MUST BE IN ORDER BY LINETAP

TYPE, THAT IS, LINE 4 MUST FOLLOW LINE 2 OR LINE 3. TAP LINES MAY BE OMITTED FROM THE LIST. A LINE WHICH IS 0MITTED WILL TAP NOT BE WRITTEN 10 TAPE. TAP THE READING OF A FINIS CARD TERMINATES THE LIST TAP

TAP

510152025

3035

40

45

50

5560

6570

75

80

85

90

95 100 105

110

1 15 120 125

130

135

140 145

150

42
IT IS NOT ENDFILED

C ARGUMENTS --

C M - IF ZERO, THIS IS INITIALIZATION. CONTROL CARDS WILL BE

C FAR INITIALIZATION, LINE MUST CONTAIN THE NUMBERS FROM THE

C PARAMETER CARD (JDATA). SEE THE LISTING 0F COMBO.

C IF M IS POSITIVE, IT IS THE LINE TYPE.

C IF M IS NEGATIVE, THIS IS PROGRAM TERMINATION. A FILE MARK

C WRITTEN ON EACH TAPE.

C LINE - THE BUFFER TO BE WRITTEN ONTO THE OUTPUT TAPE(S)

C LEN - IHE NUMBER OF CHARACTERS IN LINE

C JUPflIN CONTAINS POINTERS TO THE UNIT DESIGNATIONS

C JUNITS CONTAINS THE UNIT DESIGNATIONS

C DIMENSION LINE( 200 ),JUNITS( 20 ), JUPeiN( 100 ),EARD( 80 ) DIMENSION JDATA<60 ),KEY(60 ) COMMON /W/ IW.NTABL COMMON /IA/ IABC(120)

COMMON /IO/ IN, IOUT

C THIS IS THE CARD PUNCH DATA KFUNCH / 3 / C WHICH MODE

IF (M) 400,20,320

C INITIALIZATION

20 M0DE-LINE(4)

IF (LINE(4)-1) 240,40,60

C SINGLE OUTPUT UNIT

40 JTAPE-LINE( 2 ) GO TO 240

C STORE MULTIPLE OUTPUT UNIT LIST

60 WRITE (IOUT, 480)

K-l II-O

80 READ (IN, 500) ( KARD( J ), J* 1 , 80 ) WRITE (IOUT, 520) ( KARD( J ), J" 1 , 80

C CHECK FOR FINIS CARD

IF ( KARD( 1 ).NE. IABC(6 ) ) GO TO 100 IF (KARD( 2 ).NE. IABC( 9 ) ) GO TO 100 IF ( KARD( 3).NE. IABC( 14 ) ) G0 TO 100 IF ( KARD( 4 ).NE. IABC( 9 ) ) GO TO 100 IF ( KARD( 5 ).NE. IABC( 19 ) ) GO TO 100 GO TO 200

100 CALL INPUT ( 4 , KARD, JDATA, KEY, 80

I -JDATA( 1 ) IF (I.EQ.O) GO TO 200

IF (I.LE.II) GO TO 260 Il-I-l II1-II+1

IF (II1.GT.I1) GO TO 140 DO 120 J-II1,I1

IF (J.GT.NTABL) GO TO 260

120 JUPOIN(J)-K

140 L-2 JUP0IN( I )»K 160 CONTINUE

IF ( KEY( L ).LT. 1 ) GO TO 180 JUNITS(K)-JDATA(L ) K-K*l

L-L*l

IF (K-200) 160,280,280

180 II-I GO TO 80 200 JUPOIN(NTABL*l )-K IF ( II.GE.NTABL ) GO TO 240 111-11*1

TAP 155

READ. TAP 160 COMBOTAP 165 TAP 170 TAP 175

IS TAP 180 TAP 185 TAP 190 TAP 195 TAP 200 TAP 205

TAP 210 TAP 215

TAP 220 TAP 225

TAP 230 TAP 235 TAP 236 TAP 238

TAP 240 TAP 245

TAP 250 TAP 255 TAP 260 TAP 265

TAP 270

TAP 275

TAP 280 TAP 285

TAP 290 TAP 295

TAP 300 TAP 305

TAP 310 TAP 315

TAP 320 TAP 325

TAP 330 TAP 335 TAP 340 TAP 345 TAP 350 TAP 355

TAP 360 TAP 365 TAP 370

TAP 375 TAP 380 TAP 385

TAP 390 TAP 395 TAP 400 TAP 405 TAP 410 TAP 415 TAP 420 TAP 425

TAP 430 TAP 435

TAP 440

TAP 445 TAP 450 TAP 455

43
220

240

260

C280

300

C

c320

C340

C360

C

c400

420

460

C480

500

520

540 560

DO 220 J-II1.NTABL

JUP0IN( J)«K

RETURN

WRITE ( I OUT, 540 ) GO TO 30 ERROR

WRITE ( IOu.1,560 ) STOP OPERATION - WRITE BUFFER LINE ONTO TAPE CHECK FOR SINGLE OUTPUT UNIT OR MULTIPLE OUTPUT UNITS

IF (MODE-1) 240,340,360

WRITE ON SINGLE OUTPUT UNIT

WRITE (JTAPE.500) ( LINE< J ), J= 1 , LEN ) GO TO 240 WRITE ON MULTIPLE OUTPUT UNITS

Kl -JUPeiN(M)

SET POINTERS

K2-JUP0IN(M»1 )-l IF (K2.LT.K1) GO TO 240 DO 380 J-Kl ,K2 JTAPE' JUNITS( J

)

WRITE (JTAPE.500) ( LI NE( I ), 1= 1 , LEN

)

GO TO 240 TERMINATION - WRITE FILE MARKS

IF (MODE-1) 240,420,440

IF ( JTAPE.EQ.KPUNCH) GO TO 240 END FILE JTAPE

GO TO 240

KK=*K-1 DO 460 J-l.KK

JTAPE- JUNITS( J

)

IF (JTAPE.EQ.KPUNCH) G0 TO 460 END FILE JTAPE

CONTINUE

GO TO 240 MULTIPLE OUTPUT UNITS — UNIT LIST FOLLOWS FORMAT ( 49H0 1 FORMAT ( 80A1 ) FORMAT ( 1X,80A1 ) FORMAT (49H0TAPE UNIT CARDS OUT OF ORDER, OR NO FINIS CARD FORMAT (37H0T00 MANY TAPE SPECIFICATIONS. STOP ) END

TAP 475

TAP 480 TAP 485

TAP 490

TAP 495

TAP 500 TAP 505 TAP 510 TAP 515 TAP 520 TAP 525

TAP 53 TAP 535 TAP 540 TAP 545 TAP 550 TAP 555 TAP 560 TAP 565 TAP 570

TAP 575

TAP 580 TAP 585 TAP 588 TAP 590

TAP 595 TAP 600

TAP 6 05 TAP 6 08 TAP 610 TAP 612 TAP 615

TAP 620

TAP 62 5 TAP 630

TAP 635 TAP 64 TAP 645 TAP 650-

44
c

ccc

c

c

cc

c

cc

c

c

cc

c

c

c

cc

c

c

c

c

c

cc

cc

cc

c

c

c

cc

c

cc

c

cc

c

cc

c

cc

cc

cc

c

c

c

c

c

c

c

MULTIPLE TABLE SEARCH SUBROUTINE

MSERCH PERFORMS ANY OF UP T6 99 STRING SEARCHES, AND-M8DE 6R ORMODE, ON A LINE 6F Al CHARACTERS AND SIGNALS SUCCESS OR FAILURE.

SUBROUTINE MSERCH (ICOL.LEN.M)

THE ARGUMENTS F0R THIS ROUTINE ARE —

ICOL - A VECT6R OF Al CHARACTERS TO BE SEARCHED

LEN - THE NUMBER OF CHARACTERS IN ICOL

M - ON ENTRY, THE NUMBER OF THE SEARCH TABLE TO BE USED

IF ZERO, INSTRUCTS MSERCH TO READ CONTROL CARDS

ON RETURN, INDICATES AN UNSUCCESSFUL SEARCH,

MSR MSR

MSR

MSR

MSR

MSR

MSR MSR

MSR MSR

MSR

MSR SIGNALS SUCCESSMSR

MSR

MSR

IT HAS THE 26MSR

MSR MSR

CONTROL CARDS ARE -- THE EDPAC DICTIONARY IS ALREADY IN COMMON BLOCK IA LETTERS IN ORDER IN COLUMNS 1-26, AND THE DIGITS FROM TO 9 IN COLUMNS 27-36. COLUMN 47 SHOULD BE BLANK. COLUMN 42 CONTAINS A CHARACTER, THE UNIVERSAL MATCH SYMBOL, WHOSE MSR APPEARANCE IN A SEARCH STRING INDICATES THAT ANY CHARACTER FOUND MSR

IN THAT POSITION IN THE STRING WILL SATISFY THE SEARCH. MSR COLUMN 50 CONTAINS THE SEARCH STRING TERMINATOR WHICH DELIMITS THEMSR

SEARCH STRINGS. THE SEARCH TABLES ARE READ IN. EACH BEGINS WITH A CARD ON WHICH EITHER THE WORD AND OR THE WORD OR IS PUNCHED STARTING IN COLUMN

1 . THE 'AND' DEMANDS THAT ALL SEARCH WORDS OR PHRASES MUST

BE FOUND IN A CARD IMAGE IN ORDER TO BE CHOSEN.

THE 'OR' REQUIRES ONLY THAT ONE OF THE SEARCH WORDS OR PHRASES BE FOUND TO SATISFY THE SEARCH.

MSR MSR

MSR MSR

MSR

MSR

MSR MSR

MSR

IN COLUMN 1. THE PROGRAM THEN READS ANOTHER TABLE. TABLES ARE NUMBERED IN ORDER OF APPEARANCE.

THE SEARCH STRINGS ARE EACH ON A SEPARATE CARD, STARTING IN C0LUMNMSR

1 AND ENDING WITH THE TERMINATOR. MSE

MSR

MSR EACH SEARCH TABLE HAS ITS END MARKED BY A CARD WITH THE TERMINATORMSR

MSR

MSR

MSR THE END OF SEARCH TABLES, AND OF CARD INPUT, IS MARKED BY A CARD MSR WITH THE W6RD FINIS IN COLUMNS 1-5 AND A TERMINATOR IN COLUMN 6. MSR

MSR MSR

MSR

MSR

IT MUST BE MSR

MSR MSR

MSR MSR

MSR MSR

MSR

MSR

MSR MSR

MSR MSR

1970 MSR

MSR

MSR MSR

MSR MSR

MSR MSR

VARIABLES -- IC - A VECTOR SHARED WITH OTHER ROUTINES USED FOR STRING STORAGE

ICLEN - THE SIZE OF IC ICNOW - THE FIRST AVAILABLE (UNUSED) POSITION IN IC

RESET AFTER STORING IN IC. ITAPE - UNIT NUMBER FOR THE CARD READER

IOTAPE - UNIT NUMBER FOR THE PRINTER

IA - THE EDPAC DICTIONARY

IB - TEMPORARY STORAGE FOR INPUT FROM CARDS

N - THE LENGTH OF EACH SEARCH STRING

KS - PCINTERS TO THE BEGINNING OF EACH TABLE IN N KC - POINTERS TO THE BEGINNING OF EACH TABLE IN IC IAND - THE SEARCH MODE (AND/OR) FOR EACH TABLE

CODE WRITTEN BY MRS CARLA G. MESSINA NSRDS NBS 1966

ADAPTED AS SUBROUTINE BY R. MCCLENON NSRDS-NBS FEB. COMMON /STR/ ICLEN, ICNOW, IC COMMON /IO/ ITAPE, IOTAPE COMMON /IA/ IA( 120 ) DIMENSION IB( 81 ), ICOOOO ),N(200 ), ICOL( 4000 ) DIMENSION KC( 100 ),I AND( 99 ),KS( 100 ) INITIALIZATION OR SEARCH

5

1152025

3035

4045

50

55

606570

75

80

8590

95

100

1 05

1 10 115

120 125

130 135

140 145

150 155

160

165

170 175

180 185

190 195 200

205

210 215

220 225

230

235

240

245

250

255

260

265

270

275

280

2 85 290

295

300

3 05 310

315

320

325

330

45
IF (M) 240,10,240

C READ DICTIGNARY

10 C6NTINUE

Nl -0 N3-ICNGW

NSTRIN-200

L-l KS(1 )-l KC( 1 )-l 20 READ (ITAPE.390) < I B(

J ) , J- 1 , 80 )

WRITE (IGTAPE.420)

L WRITE (IGTAPE.400) ( IB(

J ), J- 1 , 80 ) C WHICH AND/GR MGDE

IF ( IB(1 )-IA( 1 )) 60,30,60

30 IF < IB<2 )-IA( 14)) 60.40.60

40 IF ( IB(3 )-IA(4) ) 60,50,60

50 IAND(L)-1 WRITE (ISTAPE.430) IA( 1 ), IA( 1 2 ), I A( 12 )

GO TO 70 60 IAND(L)-0

WRITE (I6TAPE.430) IA( 1 ), IA( 1 4 ). I A( 25 ) C READ A STRING

70 READ ( ITAPE.390 ) ( I B(

J ), J- 1 , 80 ) N2-0

J-l

IF (IB(1 )-IA(6 ) ) 130,80,130

80 IF <IB(2)_IA<9)) 130,90,130

90 IF (IB(3)-IA( 14)) 130,100,130

100 IF ( IB(4 )-IA(9 ) ) 130,110.130

110 IF ( IB(5 )_IA( 19 )) 130,120,130

120 IF ( IB(6 )-IA<50 )) 130,230,130

130 DG 140 1-1,80

IF ( IB(I )_IA( 50 )) 140,150,140

140 N2-I

150 IF ( N2 ) 220,220,160

160 Nl =N1 *1 N( Nl )»N2

N4-N3*N2-1

IF (N4-ICLEN) 190,190,170

C OVERFLOW

170 WRITE (I0TAPE.440) N4.N1

180 STOP

190 IF (Nl-200) 200,200,170

200 J-l DG 210 I-N3,N4

ICC I )-IB( J) 210 J-J*l

N3-N3*N2

WRITE (I0TAPE.4OO) ( IB(

J ), J- 1 , N2 )

G8 T6 7 C END OF TABLE - START NEW TABLE

220 KS( L*l )-Nl*l

KC( L*l )-N3 L-L*l GO T0 20

C END GF STRINGS

230 KS( L*l )-Nl*l

ICN0W-N3 WRITE (I0TAPE.41O)

L RETURN

CC SEARCH

240 IF (L-M) 260,250,250

250 IF (M) 260,260,270

260 WRITE (ISTAPE.450)

M GG TG 180

MSR 335

MSR 340 MSR 345 MSR 350 MSR 355 MSR 360 MSR 365 MSR 370

MSR 375

MSR 380

MSR 385 MSR 390 MSR 395

MSR 400 MSR 4 05 MSR 410 MSS 415

MSR 420 MSR 425 MSR 430 MSR 435

MSR 440 MSR 445 MSR 450 MSR 455 MSR 460 MSR 465 MSR 470 MSR 475

MSR 480 MSR 485 MSR 490 MSS 495 MSR 500

MSR 505 MSR 510 MSR 515 MSR 520 MSR 525 MSR 530 MSR 535 MSR 540 MSR 545 MSR 550 MSR 555 MSR 560 MSR 565 MSR 570

MSR 575 MSR 580 MSR 585 MSR 590 MSR 595 MSR 600

MSR 605 MSR 610 MSR 615 MSR 620

MSR 625

MSR 630

MSR 635 MSR 640

MSR 645 MSR 650 MSR 655

46
Zru IF (IAND(M)) 340,280,340 MSR 665

C 6R-SEARCH MSR 670

280 N3-KC(M) MSR 675

NN"KS(M) MSR 680

Nl-KS(M'l) MSR 685

D0 320 K1»NN,N1 MSR 690

N2-N( Kl ) MSR 695

N4-N3*N2-1 MSR 700

I2-LEN*1-N2 MSR 705

DO 310 1-2,12 MSR 710

Jl-1 MSR 715

C DOES IT MATCH MSR 720 De 300 J-N3.N4 MSR 725

K-I*J1-1 MSR 730

IF { IC0L( K)-IA< 42 )) 290,300,290 MSR 735

290 IF (ICflL(K)-IC(J)) 310,300,310 MSR 740

300 J1-J1*1 MSR 745

C SUCCESS MSR 750 GO TO 330 MSR 755

C NO MATCH, KEEP TRYING MSR 760

310 CONTINUE MSR 765

320 N3-N3*N2 MSR 770

M-0 MSR 775 RETURN MSR 780

330 M-l MSR 785 RETURN MSR 790

C AND-SEARCH MSR 795

340 N3-KCCM) MSR 800

NN-KS<M) MSR 805

Nl -KS( M*l ) MSR 810

DO 380 K1-NN.N1 MSR 815

N2-N( Kl ) MSR 820

N4-N3*N2-1 MSR 825 I2-LENM-N2 MSR 830 DO 370 1-2,12 MSR 835

Jl-1 MSR 840

C DOES II MATCH MSR 845 DO 360 J-N3.N4 MSR 850

K-I*J1-1 MSR 855

IF ( IC6L( K)-IA( 42 )) 350,360,350 MSR 860

350 IF ( IC6L( K )-IC( J) ) 370,360,370 MSR 865 360 Jl-Jl+1 MSR 870

C FAILURE MSR 875 GO T0 380 MSR 880

C MATCH, KEEP TRYING MSR 885 370 CONTINUE MSR 890

M-0 MSR 895 RETURN MSR 900

380 N3-N3*N2 MSR 905

M-l MSR 910 RETURN MSR 915

C MSR 920

390 FORMAT ( 80A1 ) MSR 925

400 FORMAT (1X.80A1) MSR 930

410 FORMAT (11H0THERE ARE ,I2,8H TABLES ) MSR 935

420 FORMAT (13H0SEARCH TABLE, 13 ) MSR 940

430 FORMAT ( 47H0THE PROGRAM IS SEARCHING FOR LINES CONTAINING ,3A1,26HMSR 945

1 OF THE WORDS GIVEN BELOW.//) MSR 950

440 FORMAT (47H0LIST OF SEARCH WORDS TOO LONG. PLEASE SHORTEN ., /68H0MAMSR 955

1XIMUM CHARACTER LENGTH IS 8000. MAXIMUM NUMBER OF PHRASES IS 200 /MSR 960

221 H CURRENT VALUES ARE ,216) MSR 965

450 FORMAT (28H0MSERCH HAS NO SEARCH TABLE ,15) MSR 970 END MSR 975-

47
SUBROUTINE MSUBS ( IB, IW.MflDE)

MSUBS

MULTIPLE TABLE SUBSTITUTION SUBROUTINE

MSB MSB

MSB MSB THIS PROGRAM IS A MODIFICATION 0F AMSUB WRITTEN BY R.C. TH6MPS0N MSB AMSUB USES TBE LOGIC OF SUBSTITUTE WRITTEN BY MRS. C. MESSINA MSB MODIFICATIONS MADE BY R. MCCLEN0N, NSRDS-NBS, MARCH 1970. MSB MSB THIS IS A MULTIPLE TABLE SUBSTITUTION SUBROUTINE. IT ACCEPTS AS MSB INPUT A LINE OF TEXT AND SEARCHES AND SUBSTITUTES ACCORDING TO ANYMSB

ON RETURN FROM MSUBS IB

OF 99 DIFFERENT TABLES THE ARGUMENTS ARE --

IB - THE LINE TO BE PROCESSED ON INPUT. CONTAINS THE EDITED LINE.

IW - THE LENGTH OF THE INPUT LINE IN IB (IN CHARACTERS). ON RETURN IW IS THE NEW LENGTH OF IB. MODE - ZERO INDICATES THAT CONTROL CARDS ARE TO BE READ TO INITIALIZE MSUBS. A POSITIVE NUMBER INDICATES THE NUMBER OF THE SUBSTITUTION TABLE WHICH IS TO BE USED TO EDIT IB. COMMON BLOCK 10 CONTAINS ITAPE AND I0TAPE, THE LOGICAL UNITS FOR

THE CARD READER AND PRINTER, RESPECTIVELY. COMMON BLOCK STR CONTAINS IC IN WHICH THE SUBSTITUTION TABLE IS STORED. ICLEN IS THE LENGTH 0F IC. ICNOW IS A POINTER TO THE NEXT AVAILABLE CELL IN IC. IT IS RESET BY EACH PROGRAM WHICH

STORES STRINGS IN IC.

MSB MSB

MSB MSB

MSB MSB

MSB MSB

MSB MSB

MSB

MSB

MSB

MSB

MSB MSB

MSB MSB THE CONTROL CARDS FOR MSUBS ARE AS FOLLOWS — MSB

THE EDPAC DICTIONARY IS ALREADY IN COMMON I A. THE ALPHABET STARTSMSB

WITH THE LETTER A IN COLUMN 1 THRU Z IN 26. THE NUMBERS TO 9 GOMSB

IN COLUMNS 27 TO 36. COLUMN 4 1 CONTAINS THE PRINTOUT STRING MSB DELIMITER. COLUMN 47 MUST BE BLANK. MSB THE NEXT TWO CARDS ARE IN (3A1.I1) FORMAT. THEY GIVE INFORMATION MSB FOR INPUT AND OUTPUT, RESPECTIVELY. THE FIRST TWO CHARACTERS ON MSB EACH CARD ARE THE SHIFT UP AND SHIFT DOWN SYMBOLS, RESPECTIVELY. MSB

THE THIRD CHARACTER IS THE UNIVERSAL MATCH CHARACTER IN THE MSB SUBSTITUTION TABLES. THE NUMBER IS 1 FOR SHIFT AND LOCK MODE OR MSB ZERO FOR SHIFT AND UNLOCK MODE. MSB THE SUBSTITUTION TABLES FOLLOW. EACH TABLE IS PRECEDED BY A CARD MSB WITH THE WORD 'TABLE' IN COLUMNS 1 TO 5 AND THE TABLE NUMBER IN MSB COLUMNS 6 AND 7. IF THE FIRST SUBSTITUTION CARDS ARE NOT PRECEDEDMSB

BY A TABLE NUMBER TABLE 99 WILL BE ASSUMED. MSB

A SUBSTITUTION CARD CONTAINS THE STRING TO BE SEARCHED FOR MSB FOLLOWED BY THE REPLACEMENT STRING, WITH BOTH STRINGS BRACKETED BYMSB ANY CHARACTER NOT APPEARING IN EITHER STRING. FOR INSTANCE, MSB

/YES/ /N0/ WILL CAUSE ALL OCCURRENCES OF 'YES' TO BE CHANGED TO MSB

'NO' WEEN THAT TABLE IS USED. MSB THE READING OF SUBSTITUTION TABLES IS ENDED BY READING A CARD WITHMSB

THE WORD 'FINIS' IN COLUMNS 1 THRU 5 AND COLUMN 6 BLANK MSB

MSB THIS PROGRAM SHOULD BE USED WITH SUBROUTINES SULOCK AND SUNLK MSB MSB COMMON /IO/ ITAPE, IOTAPE MSB COMMON /STR/ ICLEN, ICNOW, IC MSB DIMENSION IC( 80 00 ), NS( 150 ),NFG1( 100 ),NFG2( 10 ),NT< 75 ) ,NSFG( 100 ) MSB DIMENSION NB( 750 ),IX( 20 ) MSB

510

152025 ; 30

35

40

45

50

55

60

6570

7580

8590

95 100

105

1 10 115

120 125

130 135

140

145

150 155

160

165

170 175

180

185

190 195 200

2 05 210 215

220

225

230

235

240

245

250

255

260

265

270

275

280

285

48
DIMENSION IB( 3000 ) MSB 290

C0MM6N /IA/ IA( 120 ) MSB 295

IF (M6DE) 660,10,660 MSB 300

10 IBLEN-2995 MSB 305

IWRT-5 MSB 310

ICHK=-1 MSB 315

IEND-0 MSB 320

ISHFT-0 MSB 325

NSMAX-1496 MSB 330

D0 20 J-1,99 MSB 335

NFGKJ )-0 MSB 340

20 NFG2<J)-0 MSB 345

Jl-0 MSB 350 READ (ITAPE,1000) I A( 83 ), I A( 85 ), I A( 89 ), LflCKl MSB 355 WRITE ( I0TAPE, 1010 ) I A( 83 ), IA( 85 ), I A( 89 ), L0CK1 MSB 360 READ (ITAPE.10O0) I A( 84 ), I A( 86 ), I A( 90 ) , L0CK2 MSB 365 WRITE ( I0TAPE, 1010 ) I A( 84 ), IA( 86 ), I A( 90 ), L0CK2 MSB 370

Nl -0 MSB 375

LG=9 MSB 380

LF-9 MSB 385

N3-ICN6W MSB 390

C START READING SUBSTITUTION TABLES MSB 395

30 READ (ITAPE.1020) ( IB( J ), J- 1

, 77 ), KB.KT MSB 400

N2-0 MSB 405

N22-0 MSB 410

C CHECK F6R FINISH CARD MSB 415

IF ( IB( 1 )-IA( 6 ) ) 80,40,80 MSB 420

40 IF ( IB(2 )_IA(9 ) ) 220,50,220 MSB 425

50 IF < IB(3 )-IA( 14 )) 220,60,220 MSB 430

60 IF ( IB(4 )-I A( 9 ) ) 220,70,220 MSB 435

70 IF ( IB(5 )-IA( 19 )) 220,450,220 MSB 440

C CHECK FAR TABLE CARD MSB 445

80 IF ( IB( 1 )-IA( 20 ) ) 220,90,220 MSB 450

90 IF ( IB(2 )-IA( 1 ) ) 220,100,220 MSB 455

100 IF ( IB(3 )_IA( 2 ) ) 220,110,220 MSB 460

110 IF ( IB(4 )_IA( 12 )) 220,120,220 MSB 465

120 IF ( IB(5 )-IA(5 ) ) 220,130,220 MSB 470

C DETERMINE TABLE NUMBER MSB 475

130 NFG2(LT)-N1 MSB 480

LT-0 MSB 485

LTT-0 MSB 490

36 140 J-27,36 MSB 495

IF ( IB(6 )-IA( J ) ) 140,150,140 MSB 500

140 LT-LT*1 MSB 505

LT»0 MSB 510

150 D0 160 J-27,36 MSB 515

IF ( IB(7 )-IA( J) ) 160,170,160 MSB 520

160 LTT-LTT*1 MSB 525

LTT-0 MSB 530

170 IF (LTT) 190,190,180 MSB 535

180 LT-10«LT*LTT MSB 540

190 IF ( LT ) 200,200,210 MSB 545

200 WRITE ( I0TAPE, 1040 ) IA(6),IA(7) MSB 550

IEND-1 MSB 555

G0 Tfl 30 MSB 560

210 NFGK LT) = N1 *1 MSB 565

NSFG(LT)-N3 MSB 570

Gfl T0 440 MSB 575

40
C FIND LENGTH OF SEARCH STRING N2 MSB 580

220 D0 240 1-2,75 MSB 585

IF ( IB( I ).IB( 1 ) ) 240,230,240 MSB 590 230 IF ( N2 ) 30,30,250 MSB 595

240 N2=I-1 MSB 600

250 J=-N2*3 MSB 605

IF (J-76) 270,260,260 MSB 610

260 WRITE ( I6TAPE, 1050 ) IB( 1 ), ( IB( I ), I- 1 , 77 ) MSB 615

IEND-1 MSB 620 GO TO 30 MSB 625

270 K-J*l MSB 630

C FIND BEGINNING eF REPLACEMENT STRING MSB 635 DO 280 I-J,76 MSB 640

IF ( IB< I )-IB( 1 ) ) 280,290,280 MSB 645

280 K=-I*2 MSB 650

GO TO 260 MSB 655

C FIND LENGTH OF REPLACEMENT STRING N22 MSB 660

290 Da 300 I-K,77 MSB 665

IF (IB(I)-IB(l )) 300,310,300 MSB 670

300 N22-I-KM MSB 675 GO TO 260 MSB 680

C PLACE STRINGS IN BUFFER IC MSB 685

310 N1=N1*2 MSB 690

N4=N3*N2-1 MSB 695

IF ( N4-ICLEN*80 ) 330,330,320 MSB 700 320 WRITE < IOTAPE, 1 060 ) ICLEN, NSMAX.N4, Nl MSB 705 IEND-1 MSB 710 STeP MSB 715

330 IF (Nl-NSMAX) 340,340,320 MSB 720

340 J*°2 MSB 725

NS(N1-1)-N2 MSB 730

NS(N1 )-N22 MSB 735

IN2-N1/2 MSB 740

NT( IN2 )»KT MSB 745

NB( IN2 )-KB MSB 750

DO 350 I-N3.N4 MSB 755 IC(I)-IB(J) MSB 760

3 50 J = J*1 MSB 765

N3=N3*N2 MSB 77

IF <N22) 380,380,360 MSB 775

360 N4=N3*N22-1 MSB 780

J*K MSB 785 DO 370 I»N3,N4 MSB 790

IC(I)»IB(J) MSB 795

370 J=J*1 MSB 800

C MOVE REPLACEMENT STRING TO CENTER OF PAGE FOR OUTPUT MSB 805

380 IF ( N2-36 ) 390,390,400 MSB 810 390 K-40 MSB 815 400 K1=K*N22-1 MSB 820 J-N2*3 MSB 825 DO 410 L=J,78 MSB 830

410 IB(L)-IA(47) MSB 835 IB(1)*IA(41) MSB 840

IB( N2*2 )-IA(41 ) MSB 845

IB( K-l )-IA( 41 ) MSB 850

IB( Kl »1 )-IA(41 ) MSB 855

IF (N22) 440,440,420 MSB 860

420 DO 430 I-N3,N4 MSB 86S

50
IB(K)-IC< I ) MSB 870

3 K«K*1 MSB 875

N3-N3*N22 MSB 880

3 WRITE (IOTAPE, 1030 > ( IB( J ), J- 1 , 77 ) , KB, KT MSB 885

GO TO 30 MSB 89

) IF (IEND) 460,470,460 MSB 895

3 STOP MSB 900 SORT SUBSTITUTE TABLES TO PUT LONGEST STRING AT BEGINNING OF TABLE MSB 905

) N44-N4 MSB 910

ICN0W-N4*1 MSB 915

NFG2<LT)-N1 MSB 920

D0 590 LT-1,99 MSB 925

IF <NFG2(LT )-NFGl(LT)-4 ) 590,480,480 MSB 930

) N1-NFG2(LT) MSB 935

NO-NFGKLT) MSB 940

N0*N0*3 MSB 945

IF (Nl-4) 600,490,490 MSB 950

) N7-N1*2 MSB 955

) N3-NSFG(LT) MSB 960

Kl-0 MSB 965

N7-N7-2 MSB 970

IF (N7-4) 510,520,520 MSB 975

) N7»N7*2 MSB 980

3 DO 580 I-N0,N7,2 MSB 985

N2-NS( 1-3 )*NS( 1-2 ) MSB 990

N22-NS( 1-1 )*NS( IMSB 995

IF ( NS( 1-3 )-NS( 1-1 ) ) 540,530,530 MSB1000

) N3-N3»N2 MSB 10 05 GO TO 580 MSB1010

) N4-NS( 1-3 ) MSB1015

NS< 1-3 )-NS( 1-1 ) MSB1020

NS(I-1)-N4 MSB1025

N4-NS(I) MSB1030

NS< I )-NS< 1-2 ) MSB1035

NS(I-2)-N4 MSB1040

IN2-I/2 MSB1045

N4»NT(IN2) MSB 10 50

NT( IN2 )-NT( IN2-1 ) MSB1055

NT(IN2-1)-N4 MSB1060

N4«NB(IN2) MSB 1065

K1-K1*1 MSB1080

N4«N3*N2-1 MSB1085

K-0 MSB1090

DO 550 J"N3,N4 MSB1095

K-K*l MSB1100

3 IB(K)-IC(J) MSB1105

D0 560 J-1.N22 MSB1110

K-N3*J-1 MSB1115

N6-N4*J MSB1120

J IC(K)-IC(N6) MSB1125

N3=N3*N22 MSB1130

D0 570 J = 1,N2 MSB1135

K-N3*J-1 MSB1140

3 IC(K)-IB(J) MSB1145

3 CONTINUE MSB1150

IF ( Kl ) 590,590,500 MSB1155

3 CONTINUE MSB1160

3 WRITE (IOTAPE,990) , I A( 6 ), I A( 9 ) , I A( 1 4 ), IA( 9 ), I A( 1 9

MSB1165

51
DO 640 J-1,99 MSB1170

IF (NFGHJ)) 610,640,610 MSB1175

610 WRITE ( IOTAPE, 1070 ) J, NFG1 ( J ), NFG2( J ),NSFG( J

)

MSB1180

C IF ICHK « -1 WRITE OUT SORTED SUBSTITUTE LIST MSB1185

IF (ICHK) 620,640,640 MSB1190

620 NGF1-NFGHJ )*1 MSB1195

NGF2"NFG2(J

)

MSB1200

N3«NSFG(J) MSB1205

DO 630 I«NGF1 ,NGF2,2 MSB1210

N2-NS< 1-1 ) MSB1215

N22-NS(I) MSB1220

N4*=N3*N2-1 MSB1225

N5-N4*l MSB1230

N6-N4*N22 MSB1235

NI1-N2*N22*7 MSB1240

I2-I/2 MSB1245

WRITE < IOTAPE, 1 080 ) N2, IA( 4 1 ),( IC( N),N»N3,N4), IA( 41 ), IA{47 ),IA( 47) MSB 12 50 1,IA(41 ),( IC(M),M-N5,N6 ),IA( 41 ), ( I A( 47 ), L*=NI 1 , 80 ),NB( 12 ),NT( 12) MSB 1255

630 N3»N3*N2*N22 MSB1260

640 CONTINUE MSB1265

CALL CLOCK MSB 1270 DO 650 1-1,500 MSB1275

650 IB(I)-IA(47) MSB1280

C END OF INITIALIZATION, RETURN TO MAIN PROGRAM MSB1285

RETURN MSB1290

C CALLED WITH LINE IN IB TO BE EDITED MSB1295

660 IB( IW*1 )»IA<47 ) MSB1300

LT-MODE MSB1305

IF (LOCK1) 670,680,670 MSB1310

670 CALL SUNLK ( I A, IB, IW, IOTAPE ) MSB1315

680 K2M MSB1320

ILK-0 MSB1325

690 N6"=0 MSB1330

N7-0 MSB1335

DO 760 K"K2,IW MSB1340

C CHECK FOR EMPTY TABLE MSB 1345

IF ( NFG2< LT)-NFG1( LT) ) 760,760,700 MSB1350

7C0 NGF1«NFG1(LT)»1 MSB1355

NGF2»NFG2(LT) MSB1360

N3»NSFG(LT) MSB 1365

C SEARCH FOR OCCURRENCE OF SEARCH STRINGS MSB1370

DO 750 I-NGF1 ,NGF2,2 MSB1375

IF ( IB(K )-IC( N3 )) 750,710,750 MSB1380

710 N2-NS(I-1) MSB1385

N22-NS( I

)

MSB1390

Kl -K MSB1395

N4-N3*N2-1 MSB1400

IZ-0 MSB1405

DO 740 J-N3,N4 MSB1410

IF ( IC(J )-IA( 89 )) 730,720,730 MSB1415

720 IZ-IZ*1 MSB1420

IX( IZ)»IB( Kl ) MSB1425

GO TO 740 MSB1430

730 IF ( IB( Kl )-IC( J )) 750,740,750 MSB1435

740 K1-K1»1 MSB1440

N7-I MSB 1445

N6-N3 MSB 1450 GO TO 77 MSB 1455 750 N3-N3*NS( I )*NS( I- 1 ) MSB1460

760 CONTINUE MSB1465

GO TO 960 MSB1470

770 IF (Kl-IW) 790,790,780 MSB1475

780 IW-K1 MSB1480

ILK-1 MSB1485

790 Kl-K MSB1490

IN2-I/2 MSB1495

KB-NIKIN2) MSB1500

52
N2=NS( N7-1 ) MSB1505

N22-NS(N7) MSB1510

N3=N6*N2 MSB1515

N4=N3*N22-1 MSB1520

N5=N22-N2 MSB1525

IF (N5) 930,800,890 MSB1530

C INSERT REPLACEMENT STRING MSB 1535

800 DA 850 J=N3,N4 MSB1540

IF ( IC( J )-IA( 90 ) ) 840,810,840 MSB1545

810 IY-IY*1 MSB1550

IF (IY-IZ) 830,830,820 MSB1555

820 WRITE ( I0TAPE, 1090 ) MSB1560

IY-IZ MSB1565

830 IB(K1 ) = IX( IY) MSB1570

GA T0 850 MSB1575

840 IBCKl)'IC(J) MSB1580

850 K1*=K1*1 MSB1585

860 IF (ILK) 870,870,960 MSB1590

870 K2=K1-KB MSB 1595

IF ( NT( I > ) 880,690,880 MSB1600

880 LT = NT( I

MSB1605

Gfl Tfl 690 MSB1610

890 IF (IW*N5-2999) 910,910,900 MSB1615

900 WRITE ( IflTAPE, 1 100

MSB 1 62 WRITE (IflTAPE, 990) ,( IB( J ), J- 1

, IW ) MSB1625

STflP MSB1630

C MAKE RflflM FOR LARGER STRING MSB 1635

910 IW=IW*N5 MSB1640

K2=IW MSB 164 5

Dfl 920 J*K1,IW MSB1650

K9=K2-N5 MSB1655

IB(K2 )-IB(K9) MSB1660

920 K2»K2-1 MSB1665

GO T6 800 MSB1670

C SH0RTEN RECORD FAR SHeRTER STRING MSB 1675

930 Dfl 940 J*K1,IW MSB1680

K9-J-N5 MSB 1685

940 IB(J)*IB(K9) MSB1690

K9»IW*N5*1 MSB1695

Dfl 950 J-K9.IW MSB1700

950 IB( J ) = IA< 47 ) MSB1705

IWIW*N5 MSB1710

IF (N22) 860,860,800 MSB1715

960 IF ( LACK2 ) 970,980,970 MSB1720

970 CALL SULflCK ( I A, IB, IW, IflTAPE

MSB1725

980 RETURN MSB1730

C MSB 1735

990 FflRMAT (1X.131A1) MSB1740

11000 FflRMAT (3A1.I1) MSB1745

i 1010 FflRMAT (1X,3A1,I1) MSB1750

1020 FflRMAT (77A1, 11,12) MSB1755

11030 FflRMAT ( 1 X, 77 Al , 2 12 ) MSB1760

1040 FflRMAT (1X,2A1,23H IS A BAD TABLE NUMBER.) MSB1765

1050 FflRMAT ( 1 5B0THE CHARACTER ,A1,52H DID NAT APPEAR FOUR TIMES 0N THEMSB1770

1 CARD BELAW. STflP ./ 1 X, 80 Al

MSB1775

1060 FflRMAT ( 65H0SUBSTI TUTE LIST IS Tflfl LANG. MAXIMUM CHARACTER LENGTHMSB1 780

1 flF IC IS ,I6,30H MAXIMUM NUMBER AF PHRASES IS , I 5 , 9H CURRENT .11HMSB1785

2VALUES ARE ,218, 7H STflP. ) MSB1790

1070 FflRMAT (6H TABLE, 13, 10H BEGINS AT,I6,8H ENDS AT,I6,15H FIRST CHAR MSB1795

1 IS, 16) MSB1800

1080 FflRMAT ( 1 X, 1 16 , 80 Al , 3 16 ) MSB1805

1090 FORMAT ( 3H ,/,65H ***Y6U ARE WRITING MARE MATCH CHARACTERS THAMSB1810

IN YflU READ. *«**» ) MSB 181

1100 FflRMAT ( 87H0THE LINE FALL0WING W9ULD HAVE EXCEEDED 3000 CHARACTERSMSB 1 82

1 IF SUBSTITUTION HAD CONTINUED ) MSB1825

END MSB1830-

53
SUBROUTINE SUNLK( IA.IB, IW, IOTAPE)

DIMENSION IA< 86 ), IB(999 ) MAXIW=998

L"=0 J-0

K-0

DO 60 I-l.IW

IF ( IB(I )-IA( 83 ) ) 40,20,40

20 L = L*1

IF ( L-J-l ) 30,60,30

30 K-l GO TO 60 40 IF ( IB( I )-IA( 85 ) ) 60,50,60

50 J-J»l

IF (L-J) 30,60,30

60 CONTINUE

IF (L-J) 80,70,90

70 IF (K) 80,120,80

80 WRITE (IOTAPE, 280)

GO TO 150 90 IF ( IA( 83 )-IA( 85) ) 80,100,80

100 K-2*( L/2 )-L

IF ( K) 110, 120, 110

110 IW-IW*1

IB( IW)-IA( 85

)

120 J-l

130 IF ( IB( J )-IA( 83 )) 140,160,140

140 J-J-M

IF (J_(IW*1)) 130,150,150

150 RETURN

160 IF ( IB( J*l )-IA( 85 ) ) 190,170,190

170 J = J*2

D0 180 I»J,IW

180 IB( 1-1 )-IB( I

)

GO TO 220

190 IF ( IB( J*2)-IA( 85 ) ) 230,200,230

200 J = J*3 DO 210 I-J,IW

210 IB( 1-1 )-IB< I ) 220 IW-IW-1

IB( IW*1 )-IA(47 ) J=J-1 GO TO 130 230 IF ( ( I W* 1 )-MAXIW) 250,250,240

240 WRITE (I0TAPE.27O)

GO TO 150 250 IW=IW*1

J = J»3 K»IW

DO 260 L-J,IW

IB( K)-IB( K-l ) 260 K-K-l J-J-l

IB( J )-IA( 83 ) GO TO 160 270 FORMAT (116H0THE WORK ON THE FOLLOWING LINE WAS HALTED JUST BEFO

1 THE MAXIMUM CHARACTER LINE LIMIT WAS EXCEEDED IN SUNLK ) 280 FORMAT ( 69H0THE FOLLOWING LINE DID NOT CONTAIN A BALANCED SET OF 1HIFT SYMBOLS. ) END

SSUK 1 SSUK 20 SSUK 30 SSUK 40 SSUK 50 SSUK 60 SSUK 70 SSUK 80 SSUK 90 SSUK 100 SSUK 1 1 SSUK 120 SSUK 130 SSUK 1 40 SSUK 1 50 SSUK 160 SSUK 1 70 SSUK 180 SSUK 190 SSUK 200 SSUK 21 SSUK 2?0 SSUK 230 SSUK 240 SSUK 250 SSUK 2b0

SSUK 270 SSUK 280 SSUK 290 SSUK 300 i SSUK 310 SSUK 320 SSUK 330 SSUK 340

SSUK 350 SSUK 360

SSUK 370 SSUK 380 SSUK 390 SSUK 400

SSUK 410 SSUK 420 SSUK 430 SSUK 440 SSUK 450 ! SSUK 460 j SSUK 470 SSUK 480 SSUK 490 SSUK 500 SSUK 510 SSUK 520 SSUK 530 SSUK 540 SSUK 550

FSSUK 560 SSUK 570 SSSUK 580 SSUK 590 SSUK 600

54
SUBROUTINE SULOCKC I A, IB,IW, IOTAPE

DIMENSION IA( 86 ), IB(999 ) MAXIW-998

J-l

IF ( IB( J )-IA( 84 ) ) 30,60,30

J-J*l

IF (J-(IW*1)) 20,20,50

WRITE (I0TAPE,14O)

RETURN

J-J»2

IF ( IB( J )-IA( 84 )) 110,80,110

IW-IW-1 DO 90 K-J.IW

IB( K)-IB( K*l ) IB( IW*1 )-IA(47

J-J*l

IF (J-IW) 70,70,100

IW=IW*1

IB( IW)-IA( 86

GO TO 50

IF (IW-MAXIW) 120,100,40

IW=IW*1

J-J*l K-IW

IB( IW*1 )»IA(47

IB( IW*2)-IA( 47 ) IB( IW*3)-IA(47

DO 130 L-J,IW

IB( K)»IB< K-l ) K-K-l

IB( J-l )-IA( 86

GO TO 20 FORMATC 1 16H0THE WORK ON THE FOLLOWING LINE WAS HALTED JUST

1 THE MAXIMUM CHARACTER LINE LIMIT WAS EXCEEDED IN SULOCK

END

SSLK 10 SSLK 20 SSLK 30 SSLK 40 SSLK 50 SSLK 60 SSLK 70 SSLK 80 SSLK 90 SSLK 100 SSLK 1 10 SSLK 120 SSLK 130 SSLK 140 SSLK 150 SSLK 160 SSLK 170 SSLK 180 SSLK 190 SSLK 200 SSLK 210 SSLK 220

SSLK 230 SSLK 240

SSLK 250 SSLK 260 SSLK 270 SSLK 280 SSLK 290 BEFORE

) SSLK 310 SSLK 320

MULTIPLE TABLE EXTENDED REFORM SUBROUTINE MXR MXR THIS REFORM PROGRAM ACCEPTS A LINE OF CHARACTERS, BREAKS IT INT0 MXR

PIECES, AND REARRANGES THE PIECES ACCORDING TO ONE OF 20 FORMATS, MXR

INSERTING AD HOC STRINGS. INPUT RECORDS MAY BE FIXED-FIELD, FREE-MXR

FIELD STRUCTURED, OR UNSTRUCTURED FLAGGED. 0UTPUT MAY BE FIXED- MXR FIELD OR FREE-FIELD. SUBROUTINE MXREFM ( M, KARD, LBUF, JW IDTH

MXR MXR

MXR

MXR MXR

MXR MXR MXR

MXR

THE ARGUMENTS IN THE CALL TO MXREFM ARE -- M - IF SET T0 ZERO, THE ROUTINE INITIALIZES ITSELF BY READING CONTROL CARDS. IF POSITIVE, IT IDENTIFIES THE FORMAT TO BE USED KARD - THE CARD IMAGE OR LINE TO BE REFORMATTED

LBUF - THE BUFFER WHICH RECEIVES THE REFORMATTED OUTPUT

JWIDTH - ON ENTRY, THE MAXIMUM AVAILABLE LENGTH OF LBUF, WHICH IF MXR EXCEEDED WILL CAUSE AN ERROR RETURN - ON RETURN, THE ACTUAL LENGTHMXR

OF THE OUTPUT LINE. MXR MXR STRINGS ARE NUMBERED IN THE ORDER OF THEIR DEFINITION BY THE MXR CONTROL CARDS. PIECES OF AN INPUT RECORD ARE NUMBERED (WITHIN THEMXR

RECORD) IN THE ORDER OF THEIR DEFINITION FOR A FIXED-FIELD OR MXR FLAGGED RECORD, AND FROM LEFT TO RIGHT FOR A STRUCTURED FREE-FIELDMXR

RECORD. MXR

MXR

5

1152025

30

35

4045

50

5560

6570

75

80

85

90

95

I 00 105

II

1 15 120 125

55
C THE CONTROL CARDS ARE AS FALLOWS -- MXR 130

C THE FIRST CONTROL CARD SHOULD HAVE THE 26 LETTERS, FROM A TO Z, INMXR 135

C COLUMNS 1 TO 26, AND THE DIGITS FROM TO 9 IN COLUMNS 27-36. MXR 140

C COLUMN 47 IS BLANK. COLUMN 50 CONTAINS A SCAN TERMINATOR, WHICH MXR 145

C ENDS THE SCANNING OF A CARD. THE SYMBOL IN COLUMN 52 INDICATES MXR 150

C THAT THE CARD ON WHICH IT APPEARS IS CONTINUED ONTO THE NEXT CARD. MXR 155

C MXR 160

C THE SECOND CONTROL CARD SPECIFIES THE NUMBER OF IDFFERiiNT FORMATS MXR 165

C TO BE READ. MXR 170

C MXR 175

C THEN THE FROGRAM READS IN THE STRINGS. EACH IS ON A SEPARATE MXR 180

C CARD, WITH ITS END MARKED BY THE SCAN TERMINATOR. THERE MAY BE UPMXR i85

C UP TO 99 STRINGS. A CARD WITH A TERMINATOR IN COLUMN 1 ENDS THE MXR 190 C READING OF STRINGS. MXR 195

C MXR 2 00 C THEN THE INPUT FORMAT DEFINITION FOR EACH FORMAT IS READ. THE MXR "05

C FIRST NUMBER IS THE FORMAT NUMBER (1-20) - THESE SHOULD BE IN MXR 210

C ASCENDING ORDER. THE NEXT NUMBER SPECIFIES THE FORMAT TYPE. A 1 MXR 215

C INDICATES FIXED-FIELD RECORDS, A 2 FREE-FIELD RECORDS WITH A 1-3 MXR 220

C CHARACTER SEPARATOR, AND 3 OR 4 FOR FLAGGED RECORDS. MXR 225

C IF FIXED-FIELD RECORDS ARE SPECIFIED, PAIRS OF NUMBERS FOLLOW. MXR 230

C THE FIRST NUMBER IN THE PAIR IS THE CARD COLUMN IN WHICH THE FIELDMXR 235

C BEGINS. THE SECOND IS ITS WIDTH. FIELDS MAY BE CONTIGUOUS, MXR 240

C MAY OVERLAP, OR MAY FAIL TO MEET. MXR 245

C IF PIECES ARE DEFINED BY FLAGS, THE FLAGS FOLLOW. EACH MUST BE MXR 250

C BRACKETED BY SOME CHARACTER, AS /AUTHORS/ a-CODEN* MXR 255

C IF THE RECORD IS TYPE 2, THE SEPARATOR (1-3 NON-NUMERIC MXR 260

C CHARACTERS) COMES NEXT. IF IT IS MISSING, FIELDS ARE DELIMITED BYMXR 265

C ONE OR MORE CONSECUTIVE BLANKS. THE SEPARATOR IS FOLLOWED BY THE MXR 270

C NUMBER OF FIELDS. MXR 275

C MXR 280

C THE LAST SET OF CONTROL CARDS DEFINES THE OUTPUT FORMAT. THE MXR 285

C FIRST NUMBER IS THE FORMAT OR TYPE NUMBER (ASCENDING ORDER). THE MXR 290

C NEXT NUMBER MAY BE 1 OR 2. IF 1, IT INDICATES THE INPUT FRAGMENTSMXR 295

C ARE TO BE PLACED IN THE OUTPUT WITHOUT WIDTH CHANGE. IF 2, EACH MXR 300

C PIECE IS TO BE INSERTED IN A FIXED-WIDTH FIELD. MXR 305

C IF THE FIRST OPTION IS ELECTED, THE CARD THEN LISTS WHAT ITEMS AREMXR 310

C TO BE ASSEMBLED. A NUMBER CALLS FOR A PIECE FROM THE INPUT. THE MXR 315

C LETTER S FOLLOWED BY A NUMBER CALLS FOR A STRING. MXR 320

C ON OPTION 2, THE SAME SYSTEM IS USED, BUT EACH CALL FOR AN INPUT MXR 325

C PIECE IS FOLLOWED BY TWO NUMBERS. THE FIRST IS THE WIDTH OF THE MXR 330

C OUTPUT FIELD. THE SECOND MAY BE , 1

, OR 2. IF 0, IT SPECIFIES

C THAT THE PIECE IS TO BE CENTERED IN THE FIELD. A 1 CALLS FOR IEFTI

C ADJUSTMENT AND A 2 FOR RIGHT ADJUSTMENT.

C

C A FREE-FIELD CONTROL CARD READER, INPUT, IS USED BY THIS PROGRAM,

C FREEING THE USER FROM ARBITRARY FORMAT RULES. IT CAN READ EITHER

C INTEGERS OR ALPHABETIC CHARACTERS.

CC

C PROGRAMMING INFORMATION

CC IN AND IOUT ARE THE UNIT NUMBERS FOR THE CARD READER AND PRINTER,

C RESPECTIVELY.

C IC IS A VECTOR, SHARED WITH OTHER PROGRAMS, FOR STRING STORAGE

C ICLEN IS ITS SIZE

C ICNOW POINTS TO THE FIRST AVAILABLE (UNUSED) LOCATION IN IC, AND

C MUST BE ADVANCED AFTER STORING STRINGS IN IC C IABC IS THE IMAGE OF THE IFRST CONTROL CARD (ALPHABET, ETC.)

C NFSTRT _ THE DEFINED STARTING COLUMN OF A FIXED FIELD

C NFWDTH - THE DEFINED WIDTH OF A FIXED FIELD

C NFORG - THE ACTUAL STARTING COLUMN OF A FIXED OR FREE FIELD

C NW

C NFWIDE - THE ACTUAL WIDTH OF A FIELD

C LIM - THE DEFINED WIDTH OF A FIXED OUTPUT FIELD

C ISIDE - THE CENTERING OR ADJUSTMENT INSTRUCTION

56

MXR ?35

MXR 340 MXR 345 MXR 350

MXR 355 MXR 360 MXR 365

MXR 370

MXR 3 75 MXR 380

MXR 385

MXR 390

MXR 395

MXR 400

MXR 4 05 MXR 41 MXR 415

MXE 42 MXR 425

MXR 430

MXR 435 MXR 440

MXR 445

MXR 450

MXR 455
MXR 460

JiXK 465

MXR 470 MXR 4 75 MXR 480

MXR 485 MXR 490 MXR 495

MXR 500 MXR 505 MXR 510

MXR 515 MXR 520

MXR 525

MXR 530 MXR 535 MXR 540 MXR 545

MXR 550 MXR 555

MXR 560 MXR 565 MXR 570

MXR 575

MXR 580 MXR 585 MXR 590 MXR 595 MXR 600 MXR 605

MXR 610

C NUMBR - THE STRING OR FIELD SPECIFICATION FOR OUTPUT

C TELLS WHETHER A STRING SB A FIELD IS SPECIFIED

C M0DE1 - TEE INPUT OPTION ( FIXED, FREE, FLAGGED ) FAR A FORMAT

C M6DE2 - THE OUTPUT OPTION FOR A FORMAT

C KSEP - THE SEPARATORS

C LS - THE NUMBER OF CHARACTERS IN A SEPARATOR

C NFTAB - POINTERS TO THE IC POSITION OF THE FLAGS

C NUMFL - TABLE MATCHING FLAG NUMBER, FIELD NUMBER

C ISSTRT - POINTERS TO THE AD HOC STRINGS IN IC C NFLDS - NUMBER OF INPUT FIELDS IN A RECORD FORMAT

C NOUT - NUMBER OF OUTPUT FIELDS IN A RECORD FORMAT

C IT1 - CONVERSION TABLE FROM RECORD*FIELD TO ONE NUMBER

C IRT1 - POINTERS FOR THE INPUT FORMAT TABLES

C IRT2 - POINTERS FOR THE OUTPUT FORMAT TABLES

C JDATA - THE INFORMATION RETURNED BY INPUT (INTEGERS, CHARACTERS)

C KEY - DISTINGUISHES BETWEEN I NTEGERS*CHARACTERS IN JDATA

C NC - NUMBER OF FORMAT TYPES

C COMMON /IO/ IN,IOUT

COMMON /STR/ ICLEN, ICNOW, IC( 8000 ) COMMON /IA/ IABC(120)

COMMON /W/ KL.NTABL DIMENSION NFSTRTt 200 ),NFWDTH( 200 ),LIM( 200 ),NFORG( 50 ),NFWIDE( 50

DIMENSION NUMBR( 200 ),MTYPE( 20 ), ISIDE( 2 00 ),M0DE1( 20 ),M0DE2( 20)

DIMENSION KSEP( 20,3 ),LS( 2 ),NFTAB( 50 ) , NUMFL( 2 00 ),ISSTRT(99 ) DIMENSION JDATA(6 ),KEY( 6 ),KARDIN( 80 ),NFLDS( 2 ),NOUT( 20)

DIMENSION KARD(999 ),LBUF( 999 )

, IT1 ( 20, 20 ), IRT1 ( 200 ) , I RT 2( 200

1 FORMAT ( 80A1 ) 20 FORMAT ( 1 1 HOTHEHE ARE ,I2,23H STRINGS. THEY ARE — /) 30 FORMAT (1X.3H S , 12 , 2X, 14, 1 2H CHARACTERS .100A1)

40 FORMAT (30H0INPUT INSTRUCTIONS FOR RECORD, 12)

50 FORMAT (60H RECORD IS FIXED-FIELD. STARTING COLUMNS AND WIDTHS ARMXR 615

IE -- ) MXR 620

60 FORMAT (41H RECORD IS FREE-FIELD. THE SEPARATOR IS ,3A1) MXR 625

70 FORMAT ( 32H RECORD BAS FLAGS. THEY ARE -- ) MXR 63

80 FORMAT (I4.2X.9A1) MXR 635

90 FORMAT ( 28H FLAGS NEED NOT BE IN ORDER ) MXR 64 100 FORMAT ( 10( 3X.2I3 )/10( 3X.2I3) ) MXR 645

110 FORMAT (31H06UTPUT INSTRUCTIONS FOR RECORD, 12 ) MXR 650

120 FORMAT (8H STRING ,12) MXR 655

130 FORMAT <7H PIECE ,12, 11H OF RECORD ,12) MXR 660

140 FORMAT (7H PIECE ,12, 11H OF RECORD ,I2,15H ADJUSTED IN A ,I2,25H CMXR 665

1HARACTER FIELD IN MODE ,11)

150 FORMAT ( 1 HO/ 1 X, 80 Al /42H0THE ABOVE CONTROL CARD IS IN ERROR.

160 FORMAT (49H0TOO MANY STRINGS, OR STRING TERMINATOR MISSING.

170 FORMAT ( 44HON0N-EXI STENT STRING OR FRAGMENT REQUESTED. ) 180 FORMAT ( 45H0THE OUTPUT LINE IS TOO LONG. ERROR RETURN. ) 190 FORMAT (64H0A PROGRAM PARAMETER HAS BEEN ASSIGNED AN ILLEGAL VALUEMXR 695

1 . STOP. ) MXR 700

200 FORMAT < 33H0REF0RM CONFUSED, CANNOT CONTINUE) MXR 705

C IS THIS INITIALIZATION OR OPERATION MXR 710

IF (M) 1320,210,860 MXR 715

C READ CONTROL CARDS MXR 720

210 JWMAX-JWIDTH MXR 725 NC=NTABL MXR 73 C READ STRINGS MXR 735

K"ICN0W MXR 740

ISSTRTC 1 )"ICNOW MXR 745

JJ-1 MXR 750

220 READ (IN, 10) ( KARDI N( JX ), JX- 1 , 80 ) MXR 755 NM MXR 760

IF (KARDIN( 1 )-IABC( 50 ) ) 230,280,230 MXR 765

230 IF ( KARDIN( N)-IA3C( 50 ) ) 240,270,240 MXR 770

240 IC(K)'KARDIN( N) MXR 775

57

MXR 670

STOP. )MXR 675

) MXR 680 MXR 685 MXR 690
K-K*l

IF (K-ICLEN) 250,830,830

250 N = N*1 IF (N-80) 230,230,260

260 READ (IN, 10) ( KARDI N( JX ), JX- 1

, 80

)

N = l G6 TS 230 270 JJ=JJ*1

ISSTRT( JJ )"K C GET AN6THER STRING

G6 T0 220

C END eF STRINGS - LIST THEM

280 NSTRNG-JJ-1

ICN8W-K

WRITE (I0UT.2O) NSTRNG

DS 290 J=l, NSTRNG

Nl =ISSTRT( J

)

N2 = ISSTRT( JM )-l LL=N2-N1*1

290 WRITE (ieUT,30) J, LL, ( ICC JX ), JX-N1 , N2

)

C READ INPUT SPECIFICATIONS

NFL-0

N-l NP-I KF-ICN6W

IRTK 1 )«1 D0 600 J-1,NC

READ (IN, 10) ( KARDIN( JX), JXM ,80 ) CALL INPUT (3.KARDIN, JDATA,KEY,80

)

I«JDATA( 1 ) IF (I-J) 820,300,820

300 IF (KEY(2)-1) 330,310,820

310 M0DEK J )*JDATA( 2 ) IF (IABS(M8DEKJ)-2)-2) 320,320,820

320 MI=M0DE1( J )*1 C WHAT 6FTI0N

GS T0 (330,340,410,460,470), MI 330 NFLDS(J)«0

G6 T0 590

C FIXED-FIELD

340 NN-NF

WRITE (I0UT.5O)

JN-3

350 IF ( IABS( KEY( JN ) ),1 ) 360,360,820

360 IF (KEY(JN>) 390,400,370

370 NFSTRT(NP )»JDATA( JN)

IF ( KEY( JN*1 )-l ) 820,380,820

380 NFWDTH( NP)-JDATA( JN*1 ) NP«NP*1

JN-JN*2

&0 TS 350 390 READ (IN, 10) ( KARDI N( JX ), JX- 1 , 80 ) CALL INPUT ( 4,KARDIN, JDATA,KEY,80 ) WRITE ( I0UT.4O ) I JN-1 GG Tfl 350 400 NFLDS( J)=NP-NN

NX-NP-1 WRITE (I0UT.1OO) ( ( NFSTRT( JX),NFWDTH( JX ) ), JX-=NN,NX)

G8 T0 590

C FREE-FIELD - GET SEPARATOR

410 CALL INPUT (2.KAKDIN, JDATA,KEY,80

)

D0 420 JJM ,3 IF (KEY( JJ*2)-1 ) 440,440,420

420 KSEP( J.JJ )=JDATA( JJ*2 )

MXR 780 MXR 785 MXR 790' MXR 795 MXR 800 MXR 805 MXR 810' MXR 815 MXR 820 MXR 825 MXR 83 MXR 835 MXR 840' MXR 845 MXR 850 MXR 855 MXR 860 1 MXR 865

j

MXR 870 MXR 875 MXR 880 MXR 885 MXR 890 MXR 895 MXR 900 MXR 905 MXR 910 MXR 915

MXR 92 MXR 925

MXR 930 MXR 935

MXR 94 MXR 945

MXR 950 MXR 955 MXR 960 MXR 965

MXR 970 MXR 975 MXR 980 MXR 985

MXR 990 MXR 995

MXR1000

MXR1005

MXR1010

MXR1015

MXR1020

MXR1025

MXR1030

MXR1035

MXR1040

MXR1045

MXR1050

MXR1055

MXR1060

MXR1065

MXR1070

MXR1075

MXR1080

MXR1085

MXR1 090

MXR1 095

MXR1 1 00

58
IF <KEY(6)-1) 430,430,820 MXR1105

LS(J)-3 MXR1110

G« T0 450 MXR1115

LS(J)«JJ-1 MXS1120

L-LS(J) MXR1125

NN-L*3 MXR1130

NFLDS( J)-JDATA( NN ) MXR1135

NP-NP*NFLDS(J ) MXR1140

WRITE (I0UT.6O) (KSEP( J, JX),JX-1,L) MXR1145

Gfl T0 590 MXR1150

FLAGGED FORMAT MXR1155

M*0 MXR1160

G0 T0 480 MXR1165

M-l MXR1170

WRITE (IflUT.70) MXR1175

N»l MXR1180

CALL INPUT (-2.KARDIN, JDATA.KEY.K MXR1185

NN»NP MXR1190

K-K*l MXR1195

IF (K-80) 500,500,570 MXR1200

IF ( KARDIN( K)-IABC( 52 ) ) 510,560,510 MXR1205

IF ( KARDIN( K)-IABC( 47 ) ) 520,490,520 MXR1210

BEGINNING flF FLAG MXR1215

KX*=KARDIN<K ) MXR1220

NFL*=NFL*1 MXR1225

K-K»l MXR1230

NFTAB( NFL )-ZF MXR1235

NUMFLC NP)-=NFL MXR1240

NP-NP*1 MXR1245

KK-KF MXR1250

IC( KF )«KARDIN( K) MXR1255

KF-=KF»1 MXR1260

K-K»l MXR126S

IF (K-80) 540,540,820 MXR1270

IF ( KARDIN( K)-KX) 530,550,530 MXR1275

END flF FLAG MXR1280

KJ=KF-1 MXR1285

NFTABC NFL*1 )-KF MXR1290

WRITE (IflUT.80) N, ( IC( JX), JX-KK.KJ ) MXR1295 N = N*1 MXR1300

G0 T0 490 MXR1305

READ (IN, 10) ( KARDIN( JX ), JX* 1 , 80 MXR1310

K-0 MXR1315

Gfl T8 490 MXR1320

END flF CARD - NO MARE FLAGS MXR1325

NFLDS(J)-N-1 MXR1330

IF (M) 580,590,580 MXR1335

WRITE (I0UT,9O) MXR1340

NN-NFLDS(J) MXR1345

NX-NP-NN-1 MXR1350

IRT1(J*1)-NP MXP.1355 D6 600 JJ-l.NN MXR1360

IT1(JJ,J)«NX»JJ MXR1365

CONTINUE MXR1370

ICNflW-KF MXR1375

READ OUTPUT SPECI FICATI flNS MXR1380

N=l MXR1385

IRT2( 1 )»1 MXR1390

D0 810 J-l.NC MXR1395

READ (IN, 10) ( KARDIN( JX ), JX= 1 ,80 ) MXR1400

CALL INPUT (3.KARDIN, JDATA,KEY,80 MXR1405

I-JDATA(l) MXP1410

NJ-N MXR1415

IF (I-J) 820,610,820 MXH1420

WRITE (IflUT.llO) I MXR1425

IF (KEY(2)-1) 640,620,820 MXR1430

59
630 640

650

660

670 680

690 C700

710

720 C

730 C750 760

770

790

800

810 C

820 C830 C840

M0DE2(

J )"= JDATA( 2 ) L-l

IF ( IABS( MflDE2(

J )- 1 )- 1 ) 630,630,820

IF (M6DE2(J)-1) 640,650,660

NFLDS( J)-0

Gfl Tfl 800 MX-0

G6 Tfl 670 MX-1 JN-3

MI-KEY( JN)*2

Gfl Tfl (790,800,730,690), MI

IF ( JDATA( JN)-IABC( 19 ) ) 820,700,820

STRING REQUESTED

IF (KEY< JN«1 )-l ) 820,710,820

NN*JDA1A( JN*1 ) IF (NN-NSTRNG) 720,720,820

NUMBR( N)»NN

MTYPE( N)«2 N = N*1 JN"=JN*2 WRITE (I0UT.12O) NN

Gfl TG 680 INPUT PIECE REQUESTED

Nl *=JDATA( JN)

NN-ITK Nl , J ) IF ( NN ) 840,840,740

NUMBR( N) = N1 MTYPE( N)-l

IF (MX) 750,780,750

FIXED 6UTPUT FIELD DEFINITION

IF ( KEY( JN*1 )-l ) 820,760,820

IF ( IABS( JDATA( JN*2 )- 1 ) ) 770,770,820

LIM( N)*JDATA( JN*1 ) ISIDE( N)-JDATA( JN*2 ) JN-JN*3

WRITE (IflUT,140) Nl , J,LIM(

N ), ISIDE(

N )

N*N*1 G6 Tfl 680 JN-JN*1 WRITE (I6UT.130) N1,J

N*N*1

Gfl Tfl 680 READ (IN, 10) ( KARDIN( JX ), JX-1 ,80 ) CALL INPUT (3.KARDIN, JDATA.KEY.80 )

JN-1

Gfl Tfl 680

NflUT(J )-N-NJ

IRT2( J*l )»N

C6NTINUE

RETURN ERRORS

WRITE ( I0UT.19O )

G0 Tfl 850 WRITE (IflUT,150) ( KARDIN( JX), JX-1,80)

Gfl Tfl 850

IC flVERFLflW WRITE ( I0UT.16O )

Gfl Tfl 850

SflRRY, Nfl SUCH NUMBER WRITE (I0UT, 170)

MXR1

MXR1

MXR1 MXR1

MXK1

MXR1

MXR1

MXR1

MXR1

MXR1 MXR1

MXR1

MXR1

MXK1 MXS1

MXR1 MXR1

MXR1 MXR1 MXR1

MXfil MXR1 MXR1

MXR1 MXR1

MXR1 MXR1

MXR1

MXR1

MXR1 MXR1

MXR1 MXR1 MXR1

MXR1

MXR1

MXR1 MXR1

MXR1

MXR1

MXR1 MXR1

MXR1

MXR1

MXR1

MXR1 MXR1

MXR1 MXR1

MXR1 MXK1

MXR1

MXR1

MXR1 MXR1

MXR1

MXR1

MXR1 MXR1

MXR1

MXR1

435

440; 445 450 ( 455 ! 460

465 ' 470

475

480

485

490

495

500 : 505

51515

520 525

53535

540

545 : 550

555 560

565

570

575 580

585

590 595

600

605

610

615

62625

63635

640

645

650

655

660

665

670

675

680

685

690

695

700

705

71715

72725

730

735

60
WRITE (IOUT,200)

STSP REFORMAT

A LINE J-M

DO 870 I-l.JWIDTH

LBUF( I )»IABC( 4 7 ) SET UP FIELD POINTERS

KNTR-1

N-l I-MODEH

J ) NN»NFLDS( J)

DO 880 J-1,NN

NFWIDE(

J )-0 NP-IRTH J ) 111-1*1 WHAT INPUT MODE

GO T6 (1100,1000,890,1020,1020), MI SEARCH F6R SEPARATORS

DO 900 JJ-1,JWIDTH

JX-JWIDTH*1-JJ

IF (KARD( JX)-IABC(47) ) 900,910,900

CONTINUE

LEN-0

G6 T6 1100 LEN-JJ

KK-LEN-1

NJ-N*NN,1

II-LS( J)

D0 980 JJ-l.LEN

NFORG( 1 )-l IF ( II ) 940,940,920

DO 930 JN-1 ,11 JZ*=JJ*JN-1

IF ( KARD( JZ)-KSEP< J, JN) ) 980,930,980

CONTINUE

GO TO 970

IF ( KARD( JJ )-IABC( 47) ) 980,950,980

IF ( NF6RG(N )-JJ ) 970,960,970

NFORG( N)-JJ*LS( J)

NFWIDE( N)*KK-JJ

G6 TO 980 NFWIDE( N ) "JJ-NFORG(

N 

N-N*l

NF0RG<N )-JJ*l

NFWIDE(N)-KK-JJ

C0NTINUE

BLANK FIELDS

DO 990 JJ"N,NJ

NFWIDE( JJ )»0 NF0RG( JJ )-KK

N»NJ»1

GO TO 1100 FIXED-FIELD - USE DEFINED FORMAT

NN-NFLDS(

J ) NJ-N*NN-1 DO 1010 JJ-N.NJ

I-JJ*NP-1

MXR1740

MXR1745

MXR1750

MXR1755

MXR1760

MXR1765

MXR1770

MXR1775

MXR1780

MXR1785

MXR1790

MXR1795

MXR1800

MXR1805

MXR181

MXR1815

MXR1820

MXR1825

MXR1830

MXR1835

MXR1840

MXS1845

MXR1850

MXR1855

MXR1860

MXR1865

MXR1870

MXR1875

MXR1880

MXR1885

MXR1 890

MXR1895

MXR1900

MXR1905

MXR191

MXR1915

MXR1920

MXR1925

MXR1930

MXR1935

MXR1940

MXR1945

MXR1950

MXR1955

MXR1960

MXR1965

MXR1970

MXR1975

MXR1980

MXR1985

MXR1990

MXR1995

MXR2000

MXR2005

MXR201

MXR2015

MXR2020

MXR2025

61
c1 02 1 03 c1 050 1 06 1 C70 1 080 1 100 cc1 120 C1 140

NF0RG< JJ ) -NFSTRT( I ) NF«IDE( JJ )-NFWDTH( I ) N-NJM

GO TO 1100 LOOK FOR FLAGS

NN-NFLDS(

J ) K-l NJ"N»NN-1

NFORG< N)-K

NFWIDEt N)-JWIDTH

NF-0

CONTINUE

De 1080 JJ-K,JWIDTH

DOES IT MATCH

D6 1070 JN-N,NJ

IZ"NUMFL( JN)

KF-NFTAB( IZ )

KS-NFTABC IZ*1 )- 1

DO 1040 JZ-KF.KS

II"=JJ*JZ-KF

IF ( IC( JZ)-KARD( II ) ) 1070,1040,1070

CONTINUE

IF (1-3) 1050,1050,1060

IF (JN-JTF) 1070,1070,1060

NFWIDE( NF )-JJ-NFORG< NF ) NF'JN

NF6RG( NF )=JJ*KS-KF*1 GO TO 1090 CONTINUE

CONTINUE

NFWDTJU NF )-JWI DTH-NFORG( NF ) GO TO 1100 K-NF6RG( NF) GO TO 1030 CONTINUE

ASSEMBLE THE OUTPUT

I-MODE2<J ) N-IRT2( J ) IF ( I ) 1310,1310, 1 1 10 NJ=N0UT< J )*N-1

KNTR-1

DO 1300 JJ-N,NJ

WHAT TYPE ITEM

IF ( MTYPE( JJ )-l ) 1300,1140,1120

TRANSFERA STRING

NX=NUMBR( JJ ) Kl "=ISSTRT( NX ) K2-ISSTKT< NX»1 )-l DO 1130 JZ-K1.K2

LBUF( KNTR )-IC( JZ )

KNTR-KNTR*1

GO TO 1300 A PIECE OF THE INPUT LINE

Nl -NUMBR< JJ ) N2=NF0RG( Nl ) N3-NFWIDE< Nl ) IF < KNTR*N3-JWMAX) 1150,1150,1330

IF (1-2) 1160,1170,1160

MXR20

MXR20

MXR20

MXR20

MXR20

MXR20

MXR20

MXR20

MXR20

MXR20

MXR20

MXR20

MXR20

MXR20

MXR21 MXR21

MXR21 MXR21

MXR21

MXR21

MXR21 MXR21

MXR21

MXR21

MXR21 MXR21 MXR21

MXR21

MXR21

MXR21

MXR21

MXR21 MXR21

MXR21 MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR22

MXR23

MXR23

MXR23

MXR23

3035

4045

50 ; 55 I 6065

70

7580

8590

95

00051152025

3035

40

45

5055

6065

70

75

8085

9095

0005

10

1520

25

3C35

40

45

5055

6065

70

75

808590

95

0005

101 5

62
LL IS THE OUTPUT WIDTH MXR2320

LL-N3 MXR2325

NX-0 MXR2330

GO TO 1180 MXR2335

LL-LIM(JJ) VXR2340

NX-LL-N3 MXR2345

IF ( LL ) 1190,1300,1190 MXR2350

DO 1290 JZ-l.LL MXK2355

IF (NX) 1200,1270,1270 UXR2360

IF ( ISIDE( JJ )- 1 ) 1210,1230,1250 MXR2365

CENTERING MXK2370

N4-(LL*1 )/2 MXR2375

N5-N3/2 UXK2380

IF < IABS( JZ-N4 )-N5 ) 1220,1220,1280 MXR2385

I I-JZ*N2*N5-N4-

MXR2390

LBUF( KNTR )-KARD( I T ) KXR2395

GO TO 1290 WXR2400

LEFT-ADJUST MXR2405

IF (JZ-N3) 1240,1240,1280 MXR24 1 IT=-JZ*N2-1 MXR24 15 LBUF( KNTR )-KARD( I I ) MXR2420

Gfl T« 1290 MXR2425

RIGHT-ADJUST MXR2430

IF (JZ-NX) 1280,1280,1260 MXR2435

I I =JZ*N2-NX

MXR2440

LHUF( KNTR )"KARn(I I ) MXR2445

GO TO 1290 14XR2450 MUST TRUNCATE TO FIT THE FIELD MXR2455

II-JZ»N2-1 MXR2460

LBUF( KNTR ><-KARD< I I ) '4XR2465 GO TO 1290 MXR2470

LBUK KNTR )»IABC<47 ) MXR2475

KNTR-KNTR»1 MXR2480

CONTINUE MXR2485

CONTINUE VIXR2490 JWIDTH-KNTR-1 MXR2495 RETURN MXR2500 GO TO 850 MXR2505

NO ROOM MXR2510

WRITE ( IOUT, 180) MXR2515 RETURN MXH2520

END MXR2525-

63
FORM NBS-114A (1-71) U.S. DEPT. OF COMM. BIBLIOGRAPHIC DATA

SHEET

1. PUBLICATION OR REPORT NO. NBS-TN-700

2. Gov't Accession

No.

3. Recipient's Accession No.

4. TITLE AND SUBTITLE COMBO: A General-Purpose Program for Searching,

Annotating, Encoding-Decoding, and Reformatting Data

Files

5. Publication Date September 1972

6. Performing Organization Code

7. AUTHOR(S) 8. Performing Organization Robert HcCleno n and Joseph Hilsanral-'n

9. PERFORMING 10. Project/Task/Work Unit No. ORGANIZATION NAME AND ADDRESS NATIONAL BUREAU OF STANDARDS DEPARTMENT OF COMMERCE

WASHINGTON, D.C. 20234

11. Contract/Grant No.

12. Sponsoring Organization Name and Address

Same as No . 9

13. Type of Report & Period Covered Final

14. Sponsoring Agency Code

15. SUPPLEMENTARY NOTES

16. ABSTRACT (A 200-word or less factual summary of most significant information. If document includes a significant bibliography or literature survey, mention it here.) COMBO, a FORTRAN program for searching magnetic tape files,

generating reports, and reformatting the file, is described and listed.

The program is capable of reading separate card images from a file

blocked in physical records and recognizing logical blocks marked bv a fixed-field ID. Up to 99 different types of lines, each with its own

format, can be recognized by examining a special code or label. The

program can be instructed to search for the occurrence of each of certain

character strings, using a different list for each type of line and two

levels of Boolean logic. Lines can be broken into pieces, using either

a fixed-field format or a single separator or flags to define the pieces,

and the pieces can be rearranged, with labels or comments optionally

inserted oetween them. Editing, in which specified strings are replaced

by other strings, can also be performed. The program can accommodate a variable number of cards of each type per block. It was assembled from

general-purpose subroutines of modular design and is substantially

machine-independent

17. key WORDS (Alphabetical order, separated by semicolons) Alphanumeric data files; data retrieval;

editing program; file editor; FORTRAN program; general-purpose modular programming;

reformatting program; report generator; searching program . 18. AVAILABILITY STATEMENT

H3 UNLIMITED.

Z\ FOR OFFICIAL DISTRIBUTION. DO NOT RELEASE

TO NTIS.

19. SECURITY CLASS

(THIS REPORT)

UNCLASSIFIED

20. SECURITY CLASS

(THIS PAGE)

UNCLASSIFIED

21. NO. OF PAGES

68

22. Price

7 5 cents

«U.S. GOVERNMENT PRINTING OFFICE:1972 477-VV3 USCOMM-DC 66244-P71




This is one in a series of general-purpose

programs for text editing, data retrieval, file

management and computer-assisted typesetting.

Other programs and subroutines are now being

documented for publication in the near future. If

you wish to be notified of the next publication in

this series, please fill out the post card below.

(Type or print)

Name

Affiliation

Address

City State ZIP Code

^^> I would welcome a notification of the

availability of the next publication in the

subject matter area of NBS Technical Note 500.

<3> Please send me price and ordering

instructions for the magnetic tape version of

this and other programs in the series.
National Bureau of Standards

Office of Standard Reference Data

Data Systems Design Group

Room A534, Administration Building

Washington, D.C. 20234
NBS TECHNICAL PUBLICATIONS

PERIODICALS JOURNAL OF RESEARCH reports National Bureau of Standards research and development in

physics, mathematics, and chemistry. Comprehensive

scientific papers give complete details of the work,

including laboratory data, experimental procedures, and theoretical and mathematical analyses. Illustrated with photographs, drawings, and charts. Includes

listings of other NBS papers as issued.

Published in two sections, available separately:

• Physics and Chemistry

Papers of interest primarily to scientists working in these fields. This section covers a broad range of

physical and chemical research, with major emphasis on standards of physical measurement, fundamental

constants, and properties of matter. Issued six times a year. Annual subscription: Domestic, $9.50; $2.25

additional for foreign mailing.

• Mathematical Sciences

Studies and compilations designed mainly for the mathematician and theoretical physicist. Topics in mathematical statistics, theory of experiment design, numerical analysis, theoretical physics and chemistry, logical design and programming of computers and computer systems. Short numerical tables. Issued

quarterly. Annual subscription: Domestic, $5.00;

$1.25 additional for foreign mailing.

TECHNICAL NEWS BULLETIN

The best single source of information concerning the Bureau's measurement, research, developmental, cooperative, and publication activities, this monthly

publication is designed for the industry-oriented

individual whose daily work involves intimate contact with science and technology

for engineers, chemists,

physicists, research managers, product-development

managers, and company executives. Includes listing of

all NBS papers as issued. Annual subscription: Domestic, $3.00; $1.00 additional for foreign mailing.

Bibliographic Subscription Services

The following current-awareness and literature- survey bibliographies are issued periodically by

the Bureau: Cryogenic Data Center Current Awareness Service (weekly), Liquefied Natural Gas (quarterly), Superconducting Devices and

Materials (quarterly), and Electromagnetic

Metrology Current Awareness Service (monthly). Available only from NBS Boulder Laboratories. Ordering and cost information may be

obtained from the Program Information Office, National Bureau of Standards, Boulder, Colo- rado 80302.

NONPERIODICALS Applied Mathematics Series. Mathematical tables, manuals, and studies. Building Science Series. Research results, test methods, and performance criteria of building materials, components, systems, and structures. Handbooks. Recommended codes of engineering and industrial practice (including safety codes) de- veloped in cooperation with interested industries, professional organizations, and regulatory bodies. Special Publications. Proceedings of NBS conferences, bibliographies, annual reports, wall charts, pamphlets, etc. Monographs. Major contributions to the technical

literature on various subjecfs related to the Bureau's

•scientific and technical activities. National Standard Reference Data Series. NSRDS provides quantitative data on the physical

and chemical properties of materials, compiled from

the world's literature and critically evaluated. Product Standards. Provide requirements for sizes, types, quality, and methods for testing various industrial products. These standards are developed co- operatively with interested Government and industry groups and provide the basis for common understanding of product characteristics for both buyers and

sellers. Their use is voluntary.

Technical Notes. This series consists of communications and reports (covering both other-agency and

NBS-sponsored work) of limited or transitory interest. Federal Information Processing Standards

Publications. This series is the official publication within the Federal Government for information on

standards adopted and promulgated under the Public Law 89-306, and Bureau of the Budget Circular A-86

entitled, Standardization of Data Elements and Codes

in Data Systems. Consumer Information Series. Practical information, based on NBS research and experience, cover- ing areas of interest to the consumer. Easily understandable language and illustrations provide useful background knowledge for shopping in today's tech- nological marketplace.

CATALOGS OF NBS PUBLICATIONS NBS Special Publication 305, Publications of the NBS. 1966-1967. When ordering, include Catalog No. C13.10:305. Price $2.00; 50 cents additional for foreign mailing.

NBS Special Publication 305, Supplement 1, Publications of the NBS, 1968-1969. When ordering, include Catalog No. C13.10:305/Suppl. 1. Price $4.50; $1.25 additional for foreign mailing.

NBS Special Publication 305, Supplement 2, Publications of the NBS, 1970. When ordering, include Catalog No. C13.10:305/Suppl. 2. Price $3.25 ; 85 cents additional for foreign mailing.

Order NBS publications (except Bibliographic Subscription Services)

..*~^ n.
U.S. DEPARTMENT OF COMMERCE

National Bureau of Standards

Washington, D.C. 30234

OFFICIAL BUSINESS

Penalty for Private Use. £300

POSTAGE AND FEES PAID

U.S. DEPARTMENT OF COMMERCE

21S