NBS I Imw I lunal

National Bureau of Standards

Ubrary, E-oi a^In. mg

WTE4t968

444

leform:

A General-Purpose Program for

Manipulating Formatted Data Files

/

#i** 0F

\ n

**»EAU 0»

'

Q

U.S. DEPARTMENT OF COMMERCE

National Bureau of Standards
NATIONAL BUREAU OF STANDARDS

The National Bureau of Standards1 was established by an act of Congress March 3, 1901. Today, in addition to serving as the Nation's central measurement laboratory,

the Bureau is a principal focal point in the Federal Government for assuring maximum application of the physical and engineering sciences to the advancement of technology in industry and commerce. To this end the Bureau conducts research and

provides central national services in three broad program areas and provides central national services in a fourth. These are: (1) basic measurements and standards,

(2) materials measurements and standards, (3) technological measurements and

standards, and (4) transfer of technology.

The Bureau comprises the Institute for Basic Standards, the Institute for Materials

Research, the Institute for Applied Technology, and the Center for Radiation Research.

THE INSTITUTE FOR BASIC STANDARDS provides the central basis within the

United States of a complete and consistent system of physical measurement, coor- dinates that system with the 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 an Office of Standard Reference Data and a group of divisions organized by the

following areas of science and engineering

Applied Mathematics—Electricity—Metrology—Mechanics—Heat—Atomic Physics—Cryogenics2—Radio Physics2—Radio Engineering2—Astrophysics2—Time

and Frequency.2 THE INSTITUTE FOR MATERIALS RESEARCH conducts materials research leading to methods, standards of measurement, and data needed by industry, commerce,

educational institutions, and government. The Institute also provides advisory and

research services to other government agencies. The Institute consists of an Office of

Standard Reference Materials and a group of divisions organized by the following areas of materials research:

Analytical Chemistry—Polymers—Metallurgy — Inorganic Materials — Physical

Chemistry.

THE INSTITUTE FOR APPLIED TECHNOLOGY provides for the creation of appropriate opportunities for the use and application of technology within the Federal Government and within the civilian sector of American industry. The primary functions

of the Institute may be broadly classified as programs relating to technological meas- urements and standards and techniques for the transfer of technology. The Institute

consists of a Clearinghouse for Scientific and Technical Information,3 a Center for

Computer Sciences and Technology, and a group of technical divisions and offices organized by the following fields of technology:

Building Research—Electronic Instrumentation — Technical Analysis — Product

Evaluation—Invention and Innovation— Weights and Measures —Engineering

Standards—Vehicle Systems Research.

THE CENTER FOR RADIATION RESEARCH engages in research, measurement,

and application of radiation to the solution of Bureau mission problems and the

problems of other agencies and institutions. The Center for Radiation Research consists of the following divisions:

Reactor Radiation—Linac Radiation—Applied Radiation—Nuclear Radiation.

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

2 Located at Boulder, Colorado 80302.

3 Located at 5285 Port Royal Road, Springfield, Virginia 22151.
UNITED STATES DEPARTMENT OF COMMERCE

C. R. Smith, Secretary

NATIONAL BUREAU OF STANDARDS • A. V. Astin, Director

NBS TECHNICAL NOTE 444

ISSUED AUGUST 1968

Reform:

A General-Purpose Program for

Manipulating Formatted Data Files

Robert C. McClenon and Joseph Hilsenrath

Office of Standard Reference Data

Institute for Basic Standards

National Bureau of Standards

Washington, D.C. 20234

NBS Technical Notes are designed to supplement the Bureau's regular publications program. They provide a means for making available scientific data that are of transient or limited interest. Technical Notes may be

listed or referred to in the open literature.

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

Price 40 cents

FOREWORD

This report describes one of a series of computer

programs being developed by the Data Systems Design Group

of the NBS Office of Standard Reference Data to assist the

Data Centers affiliated with the National Standard Reference

Data System. The text of this report was reproduced from a typescript prepared on a typewriter terminal connected to a time-shared computer system. The program listing was

produced on a phototypesetting machine at the Government

Printing Office from a magnetic tape produced at NBS.

Edward L. Brady, Chief

Office of Standard Reference Data

III
Contents

1. Introduction 1

2. Objectives-- 2

3. Characteristics of REFORM 3

4. Discussion of the Control Cards 3

5. Allocation of Core Storage 6

6. Applications of REFORM 7

Fortran Listings 20

IV
Reform:

A General-Purpose Program for Manipulating

Formatted Data Files

Robert McClenon and Joseph liilsenrath

A program listing and description is given of REFORM, an independent program with which it is possible to manipulate and

edit files containing as many as nine different fixed-field card

formats. It can select or abridge information from any of the

cards and print that information, or reformat new cards in any

desired order or arrangement. Provision is made for introducing as many as twenty-six arbitrary strings of characters, each of which

may be up to seventy-nine characters in length, thereby permitting

the insertion of labels, headings, or comments into the file. The

program, which operates on the 1108 computer at NBS, is written in

ASA FORTRAN, and care has been taken to reduce to a minimum the

program changes required to make the program run on other

computers

Key words: File editor; fixed-field file editor; Fortran

program; insert program; packing program; reformatting;

report generator; unpacking program.

1. Introduction

A large number of data files and bibliographies have been generated in

the NSRDS program and elsewhere on punched cards or stored as card images on magnetic tape, or written as fixed length records on magnetic tape. Such

files are usually formatted in such a way as to conserve space on the card or

on print-line. Thus, labels or other identifiers are a luxury that few

programmers indulge in when designing a file. In fact, in many files, the

decimal points and blank spaces are omitted from the stored data. These are inserted later during the print-out in accord with specific instructions via

format cards. While the insertion of decimal points and spaces between

columns of numbers is relatively easy, the insertion of textual material

requires considerably more labor.

REFORM is an independent program with which it is possible to manipulate

files containing as many as nine different card formats. It can select or abridge information from any of the cards and print that information, or reformat new cards in any desired order or arrangement. Provision is made

for introducing as many as twenty-six arbitrary strings of characters, each

of which may be up to seventy-nine characters in length, thereby permitting

the insertion of labels, headings, or comments into the file.
The program has application in the modification of formatted files of

data. Among the applications that are foreseen are:

a. abridgment of complex structured files,

b. selection of isolated items of information,

c. combination of two or more data files into a single file,

d. insertion of new data fields into an existing file,

e. insertion of labels or comments into existing files, either permanently or for printing of reports,

f. insertion of typesetting code instructions for a photocomposition machine,

g. rearrangement of the order of records in a file,

h. packing and unpacking of card images,

i. blocking and unblocking of tables of data.

2. Objectives

Conventional methods for handling the printing of such files -- suitably

spaced and with the desired notation -- require that a special computer

program be written and assembled. Such programs contain explicit

instructions for what is to be printed, and must therefore be rewritten if

changes are later desired. Such changes invariably require the services of

an experienced programmer.

The program described here is one of a series of general purpose

programs for text and data manipulation which permit one to reformat files

and print reports without writing a new program for each job. The

instructions for fragmenting the records, rearranging the fragments, and

inserting any ad hoc character strings between them are given in a series of

control cards, which are fed to the machine at run time.

The present version of the program, called REFORM, handles files in

fixed-field format. The program can handle three types of files:

a. one in which each record has an identical format,

b. a file with as many as nine different types of records (or cards or lines)

all of which must be present and in order within each group,

c. files with as many as nine different card or format types, but not

necessarily all present in each group. In this case, each card must carry

an identification number whose location is in a fixed column or position

in the line.

Each card can be broken into as many as nine fragments. The program

assigns names to the designated fragments of the various cards. Thus, the name 31 is assigned automatically by the program to the third piece of the

first card, while 43 is assigned to the fourth piece of the third card.

Similarly, the names A, B, C, etc., are assigned automatically to a series of

ad hoc strings which may be as long as seventy-nine characters. Having thus

defined all of the segments in the existing file as well as the ad hoc

strings, it is now possible to put together new cards or records by juxtaposing any desired sequence of names. Thus the sequence A11C31054B would

produce a card or line containing: the first ad hoc string, the first piece

of card 1, the third string, the third piece of card 1, followed immediately

by the fifth piece of card 4, and finally, the second string B.

-2-
3. Characteristics of REFORM

One of the goals in writing REFORM was to make it as machine- independent

and system-independent as possible. The program lias been written in ASA

FORTRAN IV so that it can be used on any computer with a compiler accepting

the standard FORTRAN IV instructions.

The logical unit numbers designating the system card reader, printer,

and card punch differ not only from machine to machine, but also from

installation to installation. Therefore, some changes will be necessary if

REFORM is to be used on any machine other than the UN I VAC 1108 at NBS. In

order to minimize the changes the input and output instructions reference

variables, READX, PRINTX, and PUNCUX, which are defined at the beginning of

the program. In the listing of the program accompanying this report they are equated to 5, 6, and 3 - the logical unit numbers for the reader, printer,

and punch, respectively, at NBS. The user of REFORM must set them equal to

the proper values for his system.

REFORM consists of a main program and two subprograms, COVFL and IFEND,

which are compiled separately. In a preliminary version of the program the

subroutines were incorporated in the main program. The linkages, however,

were of two types which some compilers do not allow. Since it was our aim to

make the program system- independent , it was necessary to rewrite the

subroutines as separately compiled programs. This may cause a slight

increase in compilation and loading time; but execution time should be

unaffected. The programmer who is interested in optimization can, if his

system allows it, incorporate the subroutines into the main program.

The input for a REFORM run consists of six types of control cards,

describing the form of the input and the desired output. These are followed

by a data deck. The input medium will normally be punched cards via the

system card reader or the peripheral input tape. If it is desired, the

control cards can be read from the standard system input unit and the data

deck from an alternate input tape. The unit number of the tape must be

specified.

There are two output media: the printer or system output tape, and the

card punch or punch tape. Typical print output from REFORM is shown in

Figure 4. Each line of print produced from the data is also punched onto a card, unless punching is suppressed. Either the print-out or the punch file

may be written on a magnetic tape. In this case, an end-of-file will be

written on the tape at the end of the run and the tape will be rewound.

4. Discussion of the Control Cards

Card Type 1 is a standard input to define the legal characters. The

symbol in card column 80 is used as a string terminator on the type 5 cards.

The first twenty-six characters should be the letters of the alphabet.

Card Type 2 contains 5 single digit numbers as follows:

a. The number of different cards in each input group

b. The number of different cards in each reformatted output group

c. Designations of the unit number for the card reader or input tape,

printer or output tape, and punch-file. If any of these are blank,

default values indicating the standard input and output units for the

system will be assigned.
ABCDEFGHI . . .XYZ012. . . 89 + - . ,

Figure 1. Arrangement of control cards and data deck for a REFORM run. The system control cards have been ommitted.

4-
d. These numbers are followed by a two-digit number indicating the column on each data card which carries a one-digit identification number telling

which format the card is in. This is necessary if not every kind of input

card is present in each group. If each group includes one card of each

format, and there are no identification numbers, the two-digit number

should be omitted or set to zero. If the input is from tape, a threedigit number follows specifying the number of characters to a record. If

it is omitted, records are assumed to be 80-character card images. In the

example above, column 72 contains an identification number on each card of

data. Input is in standard 80-character records.

Type 3 cards are used to partition each of the different card types in

the file. In this example each group is to consist of two cards as is

indicated by the first number in the Type 2 card. Hence there are two type

three cards. The first number on each tells which kind of input card it

applies to. In this case the first Type 3 card describes the first kind of

input card, which will be broken into four fields as follows:

a. The first is 10 characters long starting in column 1. The program names

this piece 11.

b. The second is 25 characters long starting in column 15. The program names

this piece 21.

c. The third is 3 characters long starting in column 46. The program names

this piece 31.

d. The fourth is 10 characters long starting in column 59. The program names

this piece 41.

The second card is broken into two pieces, the first 40 characters long, and

the next 30. Their names are 12 and 22, respectively. These segments will

henceforth be called by name. Note that columns 49 through 58 on input card

number 1 will be ignored.

Card Type 4 indicates how a new card (or line of print) is to be built

up from the existing file. Here again there is one card of instruction for

each type of card to be produced. In this case, there is only one card. It

is composed of pieces from the existing file and new information, consisting

of strings whose names are the letters A,B,C. . .X,Y,Z. In this case, the new

card will contain the pieces and strings A, 11, B, 41, C, 12, D, 31. The

format of this card requires that a single letter alternate with two -digit

numbers. Thus, if pieces 11 and 41 must be adjacent, it would be necessary

to insert a zero or a blank between them (11041 or 11 41).

Type 5 cards contain the strings of characters to be inserted between

the cards (lines) or the segments or both. The strings may be any

combination of characters or numbers or punctuation marks or even blanks.

The string is terminated by a $ sign in this case, as it is the $ sign which

appears as the last character of the Type 1 card. A string insert may be as long as 79 characters. There may be up to 26 strings. The strings ar?

automatically assigned as names the letters of the alphabet in order. Thus

the first string is A and the fourth is D.

Card Type 6 contains a $ sign (the terminator) in column 1 to indicate

the end of the input strings and signals the beginning of the data deck. If

the $ sign is used in the data bank, any other unique unused character can

be used in its place. It will be necessary to punch that character in

column 80 of the Type 1 card. The data deck will be read from a tape unit

if the Type 2 card indicates so. The repetition of a Type 1 card at the end of the data serves as a flag

to tell the program that its work is done.
5. Allocation of Core Storage

The present version of REFORM uses 8321 cells of storage in the Univac

1108. In the following paragraphs we describe how this space is allocated

and how it may, if necessary, be reduced.

The program itself when fully assembled occupies 3750 cells of core storage. This amount will vary from machine to machine, as it includes the

system input-output package and depends on the machine language. The

remaining 4571 cells are used by the program variables and data.

In the writing of REFORM we have been quite liberal in the use of core storage. In particular, we have used a full machine word for each

alphameric character, rather than conserving memory by packing the possible

6 characters into a 36-bit word. This non-optimal use of storage was necessary to assure complete machine-independence. To store more than one character to a word would have required a knowledge of the characteristics

of alphameric storage on the particular machine and would not have been

possible in ASA FORTRAN IV.

Much of the alphameric storage requirements is used by buffers. This

includes a temporary input buffer and nine line buffers, one for each kind

of input card or record, each consisting of 132 characters, accounting in

all for 1320 characters. An output buffer of 80 characters raises the

buffer spaces to 1400 cells. If the data file consists of 80 column card

images, it is possible to conserve 520 cells of memory by cutting the length

of each input buffer to 80. The 132 character buffers are only necessary if

the input is from a tape containing records longer than 80-character card

images.

The largest single component of storage is for the 26 ad hoc strings of

80 characters each. This allocation of 2080 characters is obviously a place

where considerable economization of core is possible. If it is necessary to

reduce the amount of storage used, one can cut either the maximum length of

a string or the number of strings. Since strings can be concatenated, it is

better to have provision for 26 strings of length 40 than 13 of length 80.

Few applications of REFORM are foreseen which will require 2080 characters

of strings. The insertion of the number 10 (the first piece of the zeroth

card) between two ad hoc strings concatenates them, as 10 refers to a non- existent fragment.

Another 839 cells are devoted to storage of the field and string

specifications. These specifications, read from the control cards, include

163 cells of input parameters and 676 cells of output parameters.

The 4571 cells of storage include 1487 cells of so-called blank common,

accessible to both the main program and the subprograms. The remainder is

divided into 3056 cells used by the main program, 9 used by COVFL, and 19 by

IFEND. Formats occupy 110 cells of memory. The breakdown of the 4571 cells

is as follows: 1400 cells of buffer arrays; 2080 cells of string storage;

110 cells of formats; 839 of input-output specifications; 80 cells

containing an image of the first control card; and 62 cells of indexes,

counters, switches, and parameters.

The arrays which can be reduced in size are called STRING, in the main

program, and KARD and KARDIN, buffers in blank common. The latter two

arrays are dimensioned in each subprogram and the main program. It is

important that these three declarations of size be identical.

-6'
6. Applications of REFORM

In this example of an abbreviated author index to certain references it

is desired to move the second author in a column adjacent to the first; to

enclose the journal code in parenthesis and to insert 'VOL.' between the

journal code and the volume number.

1st Card. The first card is the standard input card with a $ in column

80 denoting that symbol as the string delimiter in certain of

the control cards.

2nd Card. The numbers 5, 6, 3 refer to input and output units.

3rd Card. Tells how card format 1 is to be broken up: is characters

wide starting in CC7, 15 starting in 52, 03 starting in 22,

and 15 starting in 31. Note that the order is immaterial.

In fact the pieces can even overlap.

4th Card. Tells how to put the single output card together. The order

is: piece 1, piece 2, string A, piece 3, string B, and piece

4. Two strings follow on 2 cards. The first consists of ( and the second is ) VOL. A control card with $ in column 1 and the control cards and the data deck follows.

Figures 2 and 3 on the following pages show the arrangement of the

control cards in the original file as well as the reformatted information.

The authors wish to express their appreciation to a number of persons

who contributed toward the preparation of this report: to Wanda Hein who

prepared the typescript, and to Carla G. Messina whose program was used to

phototypeset the program listing. Special thanks are due Rubin Wagner, Chief

of the Electronic Printing Section, who, as editorial reader of this report,

tested the program by applying it to a problem of inserting instruction codes

for automatic typesetting on the Linofilm phototypesetter. Figures 11, 12,

and 13 show the result of that exercise.
ABCDEFGHIJKLMNOPQRSTUVWXYZO 123456789

11 563

1 0715 5215 2203 3115

011021A31341

( S

) VOL. $

S MORLEY ACJ 17 267 1895

AMAGAT ACP 29 68 1893

DULONG ACP 41 113 1829

CAZIN ACP 66 206 1862

KENNEDY AJS 248 540 1950

KENNEDY AJS 252 225 1954

KELLSTROM AM A 27 I 1941

TRAUTZ APK 2 733 1929 baumann

TRAUTZ APK 2 737 1929 STAUF

ECKERLEIN A P K 3 120 1900

V.'ULLNER APK 3 321 1878

TRAUTZ APK 3 40Q 1929 LUDEWIGS

WULLNER APK 4 321 1878

SCHULTZE APK 5 14C 1901

TRAUTZ APK 5 561 1930 BINKELE

TRAUTZ APK 7 409 1^30 MELSTER

TRAUTZ APK 7 427 1930 ZINK

TRAUTZ APK 9 981 1931 KURZ

TRAUTZ APK 10 81 1931 SORG

TRAUTZ APK 10 155 1931 HEBERLING

MICHELS APK 12 562 1932 NIJHOFF GFRVER

HEUSE APK 14 185 1^32 OTTO

GRAETZ APK 14 232 1881

MARKOWSKI APK 14 742 1904

BESTELMEYER APK 15 61 19 04 VALFNTINFR

MICHELS APK 16 745 1933 GERVER

TRAUTZ APK 20 118 1934 HEBERLING

HOLBURN APK 23 809 1907 HENNING

KOCH APK 27 311 1908

NOTHDURFT APK 28 137 1937

SCHLEIERMACHER APK 34 623 1888

WINKELMAMM APK 44 429 1891

HOLBURN APK 47 1089 1915 SCHULTZE

5CHWEIKERT APK 48 593 1915

GILLE APK 48 799 1915

ABCDEFGHI JKLMNOPQR'iTUVWXYZ0123456789

Figure 2. An arrangement of control cards to reformat an author index. See Figure 4 for an explanation of the control

cards

.

8-
MO R LEY ( ACU) VOL. 17 267 1895

AMAGAT ( ACP) VOL. 29 68 1893

DULONG ( ACP) VOL. 41 113 1829

CAZIN (ACP) VOL. 66 206 1862

KENNEDY ( AUS) VOL. 48 540 1950

KENNEDY ( AUS) VOL. 52 225 1954

KELLSTROM ( AMA) VOL. 21 1 1941

TRAUTZ BAUMANN ( A P K ) VOL. 2 733 1929

TRAUTZ STAUF ( APK) VOL. 2 737 1929

ECKERLEIN ( APK) VOL. 3 120 1900

WULLNER (APK) VOL. 3 321 1878

TRAUTZ LUDEWIGS (APK) VOL. 3 409 1929

WULLNER (APK) VOL. 4 321 1878

SCHULTZE (APK ) VOL. 5 140 1901

TRAUTZ BINKELE (APK) VOL. 5 561 1930

TRAUTZ MELSTER (APK) VOL. 7 409 1930

TRAUTZ ZINK (APK) VOL. 7 427 1930

TRAUTZ KURZ (APK) VOL. 9 981 1931

TRAUTZ SORG (APK) VOL. 10 81 1931

TRAUTZ HEBERLING (APK) VOL. 10 155 1931

MICHELS NIUHOFF GERVER (APK) VOL. 12 562 1932

HEUSE OTTO (APK) VOL. 14 185 1932

GRAETZ (APK) VOL. 14 232 1881

MARKOWSKI (APK) VOL. 14 742 1904

BE5TELMEYER VALENTINER (APK) VOL. 15 61 1904

MICHELS GERVER (APK) VOL. 16 745 1933

TRAUTZ HEBERLING (APK) VOL. 2 118 1934

HOLBURN HENNING (APK) VOL. 23 809 1907

KOCH (APK) VOL. 27 311 1908

NOTHDURFT ( APK) VOL. 28 137 1937

SCHLEIERMACHER (APK) VOL. 34 623 1888

WINKELMANN (APK) VOL. 44 429 1891

HOLBURN SCHULTZE (APK) VOL. 47 1089 1915

SCHWEIKERT (APK) VOL. 48 593 1915

GILLE (APK) VOL. 48 799 1915

Figure 3. Results of the reformatting run of the deck in

Figure 2. Note that the author fields have been moved, the

journal coden has been enclosed in parentheses and the

abbreviation VOL. now precedes the volume number. See

Figure 11 for the result of using REFORM to produce a phototypeset copy of this table.

9-
o

O

~ page:" ii

O READ UNIT IS 5 PRINT UNIT IS 6 PUNCH UNIT IS 6

O 1 CARDS ARE TO BE READ ON EACH PASS

1 CARDS ARE TO BE PUNCHED ON EACH PASS

O THE STARTING COLUMNS. AND FIELD_ W I DTHS ARE! _ 7_ 15 52 15 22 3 31 _15 O

.^Jlil^BlAR^NGEMENT^PLAN is;

O Oil 021 A.31 B<+1

o

o

o

THERE ARE 2 STRINGS, THEY ARE:

A _ 3 CHARACTERS ( B 8 CHARACTERS ) VOL,

"READ "DATA DECK"

Figure 4. A portion of the output of REFORM showing how the

control cards in Figure 2 were interpreted by the program.

-10-
r

jyj£J)fLE GHl JK L MNOPQ RSTUV W XVZni 2 3H56789

32 563 Oi

£L209-

0M06

i4 2 1 M 7 1008

1 1A21B31C12D22

E13

AT.NO.-S

AT.WT .«£

M#Pt«S

OESREES ~S**-

MALF-LIFE* $

I ACTINIUM 89 { 227

)

2AC1050 MJ^Q-Z

3AC227 22

\ At UMINUM

YR

44- 26 . 9815

2AL660.2 2.6989

1AMERICIUM95 <2M3)

3AM243 8800YR

IANTIMONV SI—121 , 75

2SB630.5 6.691

-t AR6QN 1 8 39.9 H 8

2AR-198. 2.001 73787

1 ARSENIC 33 7M . 9216

2AS81MS 5.727

1 A STAT1NE 85 (210)

3AT210 8.3 HR

1B A KIUW 56 137. 3H

28A725 3.51

A B CPEF 6 HIJKLHN0PQR5TUVWXYZQ123H5 6 7 8 9

Figure 5. Control cards for printing a report from a condensed file. Figure 6 shows how the program interpreted the control cards.

-11
3"

1 page:

MAS UNIT I S 5 PRINT UN IT IS 6 PUNCH UN I L JS.. J_

ABCDEFGHIJKLMN0PQRSTUVWXYZQ123^56789

J 3 CARDS ARE TO BE READ ON EACH PASS

j- 2_CA£D_S.JlRE_Tfl_BE PUI\tCiA£Q_0^-JEAC±L£ASS_

THE__S LAKJ.X NG. C.OLUMNS _ AND_ F I ELD _WI DTHS , ARE;

2__ 9 14 7_

4 6

8 7

10 8

THE REARRANGEMENT PLAN IS:

11 A21 B31 C12 D22

E13

THERE ARE 5 STRINGS. THEY ARE:

A 9 CHARACTERS AT.NO.=

B 10 CHARACTERS AT.WT.= _ „_

C 7 CHARACTERS M.P.=

___-0_„17.£HAKACI£RSL..._DEfiRE£S_...J5P*£R^. - -

E 30 CHARACTERS

READ DA T A~DECK

~ HALF-LIFE=

Figure 6. A portion of the output of REFORM showing how the

control cards in Figure 5 were interpreted by the program.

-12-
It! 3i

ul

U.cD 3HU

<1 4

«1

-I

r;

a4J

Lfl

to

p.

cs

14!

lid

*4>

rw

cC

Ul

-(

U

et

-»

H

uj

:. i i „

i»

Ul

Gfi.

-13-

•Hmuogu

•M -au8o
A8C9E

56 56

12

3

4

_5

1 1 -XZ

1 3

Im

15

F.QH1 JKLWN0PQS_5TLLywXY2al23JlS47a_5

3

0160

0160

0160

01 60

£LL6_H

A S

s1UU

1 u l 102

1U3 -XI

122

124 09

7 7 7 4 3 778 8 14

» 6-L + 096 « 1 32 *U

412 «4*»7 482 517

849

552

884

237

587

920 955

lZ1Z-±1Q7

621 656

ABC0EFGHIJKLMNOPQRSTUVWXYZQ123456789

Figure 8. Control cards for

every fifth line in a table.

inserting a blank line after

-14
page: |7

READ UNIT IS 5 PRINT UNIT IS 6 PUNCH UNIT IS 3

ABC0EFGH1JKLMN0PQRSTUVWXY2Q1 23*466789

S. CARDS ARE TO BE REAO ON EACH PASS

6 CARDS ARE TO BE PUNCHED ON EACH PASS

THE STARTING COLUMNS AND FIELD WIDTHS ARE;

1 60

I 60.

1 60

L_6-Q_

1 60

THE REARRANGEMENT PLAN IS?

1 I 4-Z

13

\*

15

• * THERE _Afi£ 1 ST R I N GS. Iii£-¥_JLR£-i

JU ^1_CHARACTFRS-

-REAO_Da TA D E CK

Figure 9. A portion of the output of REFORM showing how the

control cards in Figure 8 were interpreted by the program.

15-
ICO 000 043 087 130 173 217 260 303 346 389

101 432 475 518 561 604 647 689 732 775 817

102 860 903 945 988 -030 *072 *115 *157 *199 *242

103 01 284 326 368 410 452 494 536 578 620 662

104 703 745 787 828 870 912 953 995 *036 *078

105 02 119 160 202 243 284 325 366 407 449 490

106 531 572 612 653 694 735 776 816 857 898

107 938 979 *019 * 6 *100 *141 -181 *222 *262 -302

108 03 342 383 423 463 503 543 583 623 663 703

109 743 782 822 862 902 941 981 *021 *0 60 *100

110 04 139 179 218 258 297 336 376 415 454 493

111 532 571 610 650 689 727 766 805 844 883

112 922 961 999 *Q38 *Q77 *115 *154 *192 *231 *269

113 05 308 346 385 423 461 500 538 576 614 652

114 690 729 767 805 843 881 918 956 994 *032

115 06 070 108 145 183 221 258 296 333 371 408

116 446 483 521 558 595 633 670 707 744 781

117 819 856 893 930 967 *004 *041 *078 *115 *151

118 07 188 225 262 298 335 372 408 445 482 518

119 555 591 628 664 700 737 773 809 846 882

120 918 954 990 *027 *063 $099 * 1 3 5 *171 *207 *243

121 08 279 314 350 386 422 458 493 529 565 600

122 636 672 707 743 778 814 849 884 920 955

123 991 *026 *061 -096 *13 2 *167 * 2 2 *237 *272 *307 * 124 09 342 377 412 447 482 517 552 587 621 656

Figure 10. Results of the reformatting operation indicated in

Figure 8.

-16-
r- oo c-> vo O </~) — m h o - Os

VD vO — O ^ <N mr<-i<N(N|0

(N -i N T N t^t^ « ^Tt m -h ifl t t » — in ^ <n r-

•-», fN M- \o ^ "O <N "-!•-* «N > > "» oooooooooooooooooooooooo >>>>>>>>>>>>>>>>>>>>>>>>

z

5

D

<

03 CO

COa

Q

D

04

UJ>

en w

Z°

Uj 0^ !—! LL ^co^NqujOo

cqSn^coEZO

>-J

04O

5

S Z

>- > O » p^ Qj UJ H

<Z

< J

IN

NED NED LSTR UTZ UTZ

ERLE u N UJ H N N N N N N

z H Z J h H H H H H -J 3 J DD3D3DD

N Z Z J < < ^

J

D

< E < < < < < <

< uj uj uj o4 o4 u 04 (J 04 04 04 04 04 04 <QU^^^hhU ^ H S= whhhhhh

CO N

uj uj h CO UJ D <

UJ o4

U

COo

OS<

4-i 6 2 *J O crj c£ c o

V-. c •H /—

\

MUh o<

to o w CXtL,

a> J-. 04 11

• H PX N v—J t- r-H <

a) QJ >,

to X XI X +J

4-)

rt St 5 r-l o Q) o X o 4) [£< m 3 O

o to T3 eS c

5 O <+-i • H

O r-l <D X! ex exx c m X 4)

• H e 4-> •H

sz, Ol rt M-i O iH <D c •H m n re u

6 0) •U) e 0)

r-< (0 o a

3 04 w

N W> r-l CD •H o> *J to M U, 4J c •H

•P o •H

a> Cq! O X

m o IM ex u

<U ^ Ctt •H Cu a^ X ox >s Q o r^ s

+-> tt, o w aj c c

•M 04 XI • H o O H •H x X *J *J exx 0) £^

o w s

T3 to N

6 0) T3 to o

fH O (h •H <+-! •H 3 fi5 c m t) U to •H o O •H c r-. t-t X to •H CX O H •H J r-l X

<D *J 4J CU C o rt CS o to to *J u rH •H £

O 'J? +J u u c2 0) r—

I

U-i • H o N

+J Uh 3 J <u w m • 3 c 2 •H r—

>

a, M [t. GO

+j rt <y d

3 E-t •H O *J U

es t ex

a o o to

t=4 *j' c >»_/ rH a) s

t/> r-l o (30 0) "13 CXX d

r-l N rH «"i •H 3 O & T3 oo o +J e3 •H <u d w <D P- u H H rH

-17-
f

I i CARDS ARE TO BE READ ON EACH PASS

j 1 CARDS ARE TO BE PUNCHED ON EACH PASS

I THE STARTING COLUMNS AND FIELD WIDTHS ARE:

{ -yjtr 52 !<+ 22 3 31 2 "35~W~ 42

{ "theTrearrangement pl~an~is;_

I All "B2T"C31 DTl~t51 F61 ""'"

f

" THERE"ARE T STRINGS7~~ THEYARE"l

, "A 3 CHARACTERS =FA

| B 2 C»iARACTER_S_ _=L _„_„____

\ Q 6 CHARACTERS =L=G2(

| D 11 CHARACTERS )=L=Gl VOL. =G3

| E 6 CHARACTERS =36=G1

| F_ _3 CHARACTERS J=36

| G 4 CHARACTERS =L >

I rTad~daTa~deck

!

Figure 12. A summary of the instructions required to produce

records shown in Figure 13 from cards containing data shown in

Figure 2. The functions of the inserted strings are given in

the next figure.

18-
A

A

A

AA

A

AAA

A

A

AAA

A

_l _l -J _l -J _l _l -1 -1 _l -J -1 _l _l _l

II II II II II II II II II II II II II II II in to a> CM O d- T-1 C* o O CO CT> 00 »-l o

<r> 0> CM vO in in ^ CM CM o Is- CM Is- o to

00 CO CO COO CT> 0*OO

O 00 CT> C0 o 0>

*H *H »-l «-• «H »-< »H ** «H r-l «H <- «H ^ -I

vO vD vO \C vO vO vO vO vO vO vO vO vO vO vO

rO fO fO ro to to to to to to fO to to to to

II II II II II II II II II II II II II II II Is- CO to vO o in «H to Is- o «H O «H o «H

vD vO T-t

O cf CM to fO CM CM o CM d- vO

CM *-» CM in CM h- Is- wi to d- to «H in

CD CD CD CD CD CD CD CD CD' CD

O CD CD CD CD

II II II II ii II II II II II II II II II ii vO vO vO vO vO vO vO vO vO vO vO vO vO vO vO

fO fO to to to to fO to to to to to to to to

II II II II II II II II II II II II II II II Is- 0> «H vO CO CM Is- CM CM to to to cJ- in in

<-l CM d- vO 3- in CM

fO to to to to to to to to to to to to to to o o o o CD CD CD CD CD CD CD CD CD CD CD

II II II II IIn " II II II II '1 II II it

_l -J _» -1 -J _i _» -J -I _» _l _l -J _l _J o o o o o o O O O o o o o o o > > > > > > > > > > > > > > >

C£> o o CD CD CD CD CD CD CD CD CD CD CD CD

II II II II II II II II II II II II II II II _I _J -1 -1 _l _J -J _J _J _l _l _l _J _J

II II II II II II II II II " II II 11 II II 3 a. a. a. I/) to < X x ^ X XL XL X * u o o O 3 3 2 a. 0_ 0_ o_ 0. QL a. 0-

<t < < < <t < < < < < < < < < <

<M CM CM CM CM CM CM CM CM CM CM CM CM CM CM

CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD

II II II II II II II II II II II II II II II _l -J -I .J _l -I _J -1 _l _l -1 -1 -1 _l _l

II II II II II II II IIZZ?3<

CD

II

U-3

L0

II II II

(J) CD

UJa

_l

II II II

UJ

-IUJXz

l-l CO _l _l -1 -J _i _l _l -1 _l _l -J _J _l _l _J H II II •1 It

>-

II

>-

II o

or

II » •1 Z

*-* UJ

II II II II

UJM

II

>- h- CJ> 3 3 hN

NJ UJ NJ UJ t— fsj 'Jj < Z Z jj UJ 01 t- J- cr z K z _J \-

_l -D

O -• 2 2»J 3 3 UJ -1 3 -J 3 3

a: < -1

M Z 3 _l < < x _l < -IX < o s: 3 < UJ UJ UJ a a: u 3 QC 3 o X. ^ < 3 O :*: X x k >- UJ ^ »- 15 10 1- < < «* < < < < < < < < <t < < <

u. u. ti- ti- ii. u_ u. u. u. u. ti- U_ u. u. u.

II ii ll ll » II 11 ii ii II ll II II II II

oo ex a> c 3 o • H PS 4J a M </) V)

a>Mi w d +j v •H >H a ^ d

>.j2 3 j

vO o r^ to O O• II 03 (X• 1/) CD o m *J u Jrt ft} ©

*J> M,

C •f=)

d

•H

M •H T3 V vO

a> a, to •H X II m 4-> •H o ». u rtT

o> •H ac M

V) o bo

*J >sO

rt

V •HT) S^ rH •H M P3 M

O-O *-» 60

M-( eS «H

+J rH

ed a) «J « ^ s

V) AJ

M

V <4H

O

•H o ac CM 3

•H

d

© c o w X

bfi-H 60 4-J •H 4J d

V) o • H U) d H © < 3X5 M

tU CM

11 to 4-> 0) CD 1/) cox 81 o c +j M

•H o *. H c/> T3 rH

+J e •H CD

1/1

u

U II

Om

a> uh

O CX

xu© to

H

Vu c

P< a} S

-H 3 • ->l H

to 9!

O

fH ' d

U

Cl ^H 6 o d

a> rt ja a)

j-i Vi

a 3 Ci. H

60

O <u

M

•H MX ID) EI* CX.4J ,Q

19-
c

C REFORM

C THIS PROGRAM, REFORM, IS A GENERAL-PURPOSE INDEPENDENT PROGRAM

C FOR REFORMATTING FIXED- FIELD CARDS. UP TO 9 KINDS OF INPUT CARDS

C MAY BE ACCEPTED AS INPUT TO THIS PROGRAM. AND UP TO 9 KINDS OF

C OUTPUT CARDS PRODUCED. UP TO 26 STRINGS MAY BE INSERTED AS

C DESIRED BETWEEN FIELDS OF DATA. EACH KIND OF INPUT CARD MAY BE C DIVIDED INTO NOT MORE THAN 9 FIELDS. C

C THIS PROGRAM WRITTEN BY R. MCCLENON AT THE NATIONAL BUREAU OF

C STANDARDS JANUARY, 1968. C

C THE FIRST CONTROL CARD FOR THIS PROGRAM CONTAINS A LIST OF VALID

C CHARACTERS. THE FIRST 26 COLUMNS CONTAIN THE LETTERS OF THE

C ALPHABET IN ORDER. THE NEXT 10 COLUMNS (27-36) CONTAIN THE TEN

C DIGITS IN ORDER, STARTING WITH ZERO. COLUMN 79 MUST BE BLANK, AND

C COLUMN 80 CONTAINS A CHARACTER USED AS THE STRING TERMINATOR.

C THE SECOND CARD, IN (21 1 ,1X31 1

,

IX. 12. IX. 13) FORMAT. CONTAINS A

C LIST OF VARIOUS PROGRAM PARAMETERS. THE FIRST TWO ARE THE NUMBER

C OF KINDS OF INPUT CARDS TO BE READ AND THE NUMBER OF KINDS OF

C OUTPUT CARDS TO BE PRODUCED. THE NEXT THREE INTEGERS SPECIFY

C THE UNIT NUMBERS OF THE READER, PRINTER, AND CARD PUNCH. PUNCHING

C IS SUPPRESSED IF THESE LAST TWO ARE EQUAL. A TWO-DIGIT INTEGER

C GIVES THE COLUMN IN EACH INPUT CARD WHICH CONTAINS A LABEL (A ONEC DIGIT NUMBER) INDICATING WHICH OF THE UP TO 9 TYPES OF INPUT CARD

C IT IS. IF THIS FIELD ON THE CONTROL CARD IS BLANK. INPUT CARDS

C ARE NOT LABELED AS TO TYPE, AND TYPING IS DONE SEQUENTIALLY (THE

C FIRST CARD IS TYPE 1, THE SECOND CARD TYPE 2). THE LAST FIELD ON

C THIS CONTROL CARD GIVES THE NUMBER OF CHARACTERS TO A RECORD ON

C INPUT. IF THE INPUT IS FROM CARDS OR IF THE FIELD IS BLANK

C STANDARD 80-CHARACTER RECORDS WILL BE ASSUMED. (THIS FIELD IS C ONLY NECESSARY IF THE INPUT IS FROM TAPE.)

C THE THIRD TYPE OF CONTROL CARDS SPECIFY THE FIELD ARRANGEMENT ON

C THE INPUT CARDS. THERE MUST BE ONE FOR EACH TYPE OF INPUT CARD.

C IN (I1,4X.9(2I2,1X)) FORMAT. THE FIRST NUMBER INDICATES TO WHICH

C TYPE OF INPUT CARD THIS PARAMETER CARD APPLIES. THE REMAINDER OF

C THE CARD IS OCCUPIED BY PAIRS OF TWO-DIGIT NUMBERS IN WHICH THE

C FIRST NUMBER OF THE PAIR INDICATES THE STARTING COLUMN OF ONE OF

C THE FIELDS INTO WHICH THIS TYPE OF INPUT CARD IS DIVIDED. AND THE

C SECOND NUMBER THE WIDTH OF THE FIELD. C THE FOURTH TYPE OF CONTROL CARD FOR THIS PROGRAM GIVES THE OUTPUT

C INFORMATION. IT IS IN (24(A1,211)) FORMAT, THE LETTER DESIGNATING

C ONE OF THE AD HOC STRINGS TO BE INSERTED, AND THE TWO DIGITS THE

C NUMBER OF A FIELD ON AN INPUT CARD AND THE TYPE OF INPUT CARD ON

C WHICH THIS FIELD IS TO BE FOUND. IT WILL BE SEEN THAT STRINGS AND

C FIELDS ALTERNATE IN THE OUTPUT, AND THAT A STRING PRECEDS THE

C FIRST FIELD. IF THE SPACE RESERVED FOR THE STRING LETTER IS BLANK

C NO STRING WILL BE INSERTED.

C EACH OF THE TYPE FIVE CONTROL CARDS CONTAINS ONE AD HOC STRING.

C A STRING TERMINATOR INDICATES THE END OF THE STRING. THE LAST

C STRING CARD IS FOLLOWED BY A CARD WITH A STRING TERMINATOR IN C COLUMN 1. THIS SERVES AS A SIGNAL TO THE PROGRAM THE THE DATA

C DECK FOLLOWS THIS CARD.

C THE END OF THE DATA DECK IS INDICATED BY A DUPLICATE OF THE FIRST

C CONTROL CARD. THE ONE CONTAINING THE VALID CHARACTERS.

C

C THIS PROGRAM MUST BE LOADED WITH TWO SUBROUTINES, COVFL AND IFEND. C

A 10 A 20 A 30 A 40 A 50 A 60 A 70 A 80 A 90 A 100 A 110 A 120 A 130 A 140 A 150 A 160 A 170 A 180 A 190 A 200 A 210 A 230 A 240 A 250 A 260 A 270 A 280 A 290 A 300 A 310 A 320 A 330 A 340 A 350 A 360 A 380 A 390 A 400 A 410 A 420 A 430 A 440 A 450 A 460 A 470 A 480 A 490 A 500 A 510 A 520 A 530 A 540 A 550 A 560 A 570 A 580 A 590 A 600 A 610

20
c

510

15 20C

2530

3540

4550

5560

6570

75C

Cc

ALL VARIABLES IN THIS PROGRAM ARE DEFINED AS INTEGERS

INTEGER READX.PRINTX.PUNCHX.READ,PRINT.PUNCH.STOP.SPACE.BUFFR

INTEGER ALPHB.FWIDTH.FSTRT.STRING.FNUMBR.CNUMBR.SNUMBR.SLNGTH

DIMENSION FWIDTH(9.9). FSTRT(9,9), FNUMBR(9,24). CNUMBR(9,24)

DIMENSION SNUMBR(9.24), BUFFR(80). ALPHB(80), SLNGTH(26), NFLDS(9)

DIMENSION INFS(9), INFW(9)

**** THE DIMENSIONS BELOW MAY BE REDUCED TO CONSERVE STORAGE   DIMENSION KARDIN032). KARD(9.132). STRING(26.80)

** ** THE DIMENSIONS ABOVE MAY BE REDUCED TO CONSERVE STORAGE   THE FOLLOWING VARIABLES ARE SHARED WITH THE SUBPROGRAMS

COMMON ALPHB.READX,READ,PRINTX.PRINT.PUNCHX,PUNCH.KARDIN.KNTR.KARD

COMMON BUFFR

THESE ARE THE INPUT FORMATS

FORMAT (80A1) FORMAT (2I1,IX.3I1.1X.I2.1X.I3) FORMAT (I1,4X.9(2I2.1X)) FORMAT (24(A1.2ID) THESE ARE THE OUTPUT FORMATS

FORMAT (/1X.80A1) FORMAT (1X.I1.34H CARDS ARE TO BE READ ON EACH PASS)

FORMAT (1X.I1.37H CARDS ARE TO BE PUNCHED ON EACH PASS)

FORMAT (13H0READ UNIT IS.I2.14H PRINT UNITIS.I2.14H PUNCH UNIT IS

1,12) FORMAT (44H0THE STARTING COLUMNS AND FIELD WIDTHS ARE /) FORMAT (9(4X,I2,1X.I2)) FORMAT (48H0THE REARRANGEMENT PLAN IS (FIELD.CARD.STRING) /) FORMAT (24(1X,A 1,211)) FORMAT (10H0THERE ARE,I3,21H STRINGS. THEY ARE /) FORMAT (1X.A1.2X.I2.13H CHARACTERS .80A1) FORMAT (15H0READ DATA DECK/1H1)

READX, PRINTX. PUNCHX ARE DEFAULT VALUES FOR THE INPUT AND OUTPUT

UNIT NUMBERS

** *** THE INSTRUCTIONS BELOWARE SYSTEM-DEPENDENT ***** READX=5

PRINTX=6

PUNCHX=3

***** THE INSTRUCTIONS ABOVE ARE SYSTEM-DEPENDENT ***** READ A LIST OF VALID CHARACTERS

THE FIRST 26 CHARACTERS IN THIS LIST MUST BE THE ALPHABET IN ORDER

READ (READX.5) ,(ALPHB(J)J=1,80)

NCIN IS THE NUMBER OF KINDS OF INPUT CARDSTO BE READ ON EACH PASS

NCOUT IS THE NUMBER OF KINDS OF OUTPUT CARDS TO BE PUNCHED ON EACH

PASS THROUGH THE PROGRAM

READ, PRINT, PUNCH ARE THE UNIT NUMBERS FOR THE CARD READER.

PRINTER, AND CARD PUNCH

LCOL IS THE COLUMN IN WHICH THE CARD TYPE LABEL IS PUNCHED

IF IT IS ZERO, TYPING IS DONE BY ORDER OF APPEARANCE (FIRST CARD

IS TYPE ONE, AND SO ON)

READ (READX, 10) ,NCIN.NCOUT.READ,PRINT,PUNCH,LCOL.IWIDTH

IF THESE SPECIFICATIONS ARE BLANK, DEFAULT VALUES ARE TO BE ASSIGNED

IF (READ.EQ.0) READ=READX

IF (PRINT.EQ.0) PRINT=PRINTX

IF (PUNCH. EQ.0) PUNCH=PUNCHX

IF (IWIDTH.EQ.0.OR.READ.EQ.READX) IWIDTH=80

WRITE (PRINTX.40) .READ.PRINT,PUNCH

IF (PRINT.NE.PRINTX) WRITE (PRINT.40) .READ.PRINT.PUNCH

COLUMN 80 OF THE FIRST CARD (THE LIST OF VALID CHARACTERS)

CONTAINS A CHARACTER USED AS A STRING TERMINATOR

STOP=ALPHB(80)

COLUMN 79 OF THIS CARD IS BLANK

SPACE=ALPHB(79)

WRITE (PRINT.25) ,(ALPHB(J)J=1,80)

WRITE (PRINT.30) .NCIN

A 620 A 630 A 640 A 650 A 660 A 670 A 680 A 690 A 700 A 710 A 720 A 730 A 740 A 750

A 760

A 770 A 780

A 790 A 800 A 810 A 820 A 830 A 840 A 850 A 860 A 870 A 880 A 890 A 900 A 910

A 920

A 930 A 940

\ 950 A 960 A 970 A 980 A 990 A 1000 A1010

A 1020 A 1030 A 1040 A1050

A 1060 A 1070 A 1080 A 1090 A1100

A1110

A1120 A1130

A1140

A1150

A1160

A1170

A1180

A1190

Al 200 A1210 A1220

Al 230 A 1240 Al 250

21
WRITE (PRINT.35) .NCOUT

WRITE (PRINT.45)

DO 90 J=1.NCIN

C READ THE SPECIFICATIONS GIVING THE ARRANGEMENT OF THE INPUT CARDS

C INCARD SPECIFIES WHICH KIND OF CARD THESE SPECIFICATIONS APPLY TO

C INFS AND INFW ARE TEMPORARY STORAGE AREAS

READ (READ.15) .INCARD.((INFS(JX),INFW(JX))JX=1,9)

C TRANSFER THE TEMPORARY DATA TO FSTRT AND FWIDTH

DO 80 JJ=1.9 C FSTRT IS THE STARTING COLUMN OF AN INPUT FIELD ON A GIVEN CARD

FSTRT(INCARDJJ)=INFS(JJ)

C FWIDTH IS THE WIDTH OF THE FIELD BEGINNING IN A GIVEN COLUMN

FWIDTH(INCARDJJ)=INFW(JJ)

IF (INFW(JJ).EQ.O) GO TO 85 80 CONTINUE

NFLDS(J)=9

GO TO 90

85 NFLDS(J)=JJ-I

90 CONTINUE

DO 95 J=1.NCIN

M=NFLDS(J)

95 WRITE (PRINT.50) ,((FSTRT(JJX).FWIDTH(JJX))JX=1.M)

WRITE (PRINT.55)

C READ THE OUTPUT PLAN FOR EACH KIND OF CARD

DO 110 J=I,NCOUT

C FNUMBR IS THE NUMBER OF AN INPUT FIELD ON A GIVEN CARD

C CNUMBR IS THE NUMBER INDICATING ON WHICH TYPE OF INPUT CARD THE

C FIELD IS LOCATED

C CNUMBR AND FNUMBR TOGETHER SPECIFY THE INPUT FIELD UNIQUELY

C SNUMBR IS A LETTER SPECIFYING A STRING

READ (READ.20) ,((SNUMBR(J JX).FNUMBR(JJX).CNUMBR(JJX))JX=1.24)

DO 100 JJ=1.24 IF (FNUMBR(JJJ).EQ.O) GO TO 105

100 CONTINUE

NOUTS=24

GO TO 110

105 NOUTS=JJ-l

110 WRITE (PRINT.60) .((SNUMBR(JJX).FNUMBR(JJX CNUMBR(JJX))JX=1,N

lOUTS)

JJ=1 C READ A STRING

115 READ (READ.5) .(STRING(JJJ)J=1.80)

C IF COLUMN 1 CONTAINS A TERMINATOR, NO MORE STRINGS ARE TO BE READ

IF (STRING(JJ.l).EQ.STOP) GO TO 130 K=1

120 K=K+ 1 C SCAN THE STRING FOR A TERMINATOR TO DETERMINE ITS LENGTH

IF (STRING(JJ.K).EQ.STOP) GO TO 125 GO TO 120 C SLNGTH IS THE NUMBER OF CHARACTERS COMPRISING A STRING

125 SLNGTH(JJ)=K-1

JJ=JJ+]

C READ ANOTHER STRING

IF (JJ.LT.27) GO TO 115 130 NSTRNG=JJ-1

WRITE (PRINT.65) .NSTRNG

C LIST THE STRINGS

DO 135 J=l .NSTRNG

M=SLNGTH ) 135 WRITE (PRINTJ0) .ALPHB(J),SLNGTH(J).(STRING(J JX)JX=1,M)

C READ DATA DECK

WRITE (PRINT.75)

C SET THE INPUT ARRAY TO BLANKS

LTYPE=0

A1260 A1270

A1280 A 1290 A 1300 A1310

A1320

A1330

A1340

A1350

A1360

A1370

A1380

A1390

A 1400 A1410

A1420

A1430

A 1440 A1450

A 1460 A1470

A 1480 A 1490 A 1500 A1510

A1520

A1530

A 1540 A1550

A1560

A1570

A1580

A1590

A 1600 A1610

A 1620 A1630

A 1640 A1650

A 1660 A1670

A 1680 A 1690 A 1700 A1710

A1720

A1730

A 1740 A1750

A 1760 A 1770 A1780

A 1790 A 1800 A1810

A1820

A1830

A 1840 A1850

A 1860 A 1870 A 1880 A1890

22
140 DO 145 J=1.NC1N

DO 145 JJ=1,IWIDTH

145 KARD(JJJ)=SPACE

C READ THE PROPER NUMBER OF INPUT CARDS

IF (LTYPE.NE.O) GO TO 185 KT=0

150 DO 180 J=1,NCIN

C KARDIN IS A TEMPORARY INPUT AREA

READ (READ.5) .(KARDIN(JX)JX=1,IWIDTH)

IF (KARD1N(80).EQ.STOP) CALL IFEND

C IF LCOL IS ZERO. TYPE IS DETEMINED BY ORDER OF APPEARANCE

IF (LCOL.EQ.0) GO TO 160 C COMPARE LABEL WITH NUMBERS FROM ALPHABET CARD

DO 155 JJ=28.36 IF (ALPHB(JJ).NE.KARDIN(LCOD) GO TO 155 C KTYPE IS THE TYPE OF CARD BEING READ

KTYPE=JJ-27

GO TO 165

155 CONTINUE

KTYPE=1

GO TO 165 160 KTYPE=J

C IF THE CARD TYPE NUMBER IS LESS THAN FOR THE LAST CARD. THIS IS A

C NEW SET OF DATA

165 IF (KTYPE.LE.KT) GO TO 175 KT=KTYPE

DO 170 JJ=1,IWIDTH

C TRANSFER THE INPUT FROM KARDIN TO KARD

C KARD IS THE INPUT ARRAY

GO TO 180

170 KARD(KTYPEJJ)=KARDIN(JJ)

C LTYPE INDICATES WHAT TYPE OF CARD HAS BEEN LEFT IN KARDIN

175 LTYPE=KTYPE

KT=KTYPE

GO TO 195 180 CONTINUE

LTYPE=0

GO TO 195 185 DO 190 J=1.IWIDTH

190 KARD(LTYPEJ)=KARDIN(J)

GO TO 150 C PRODUCE THE OUTPUT CARDS, ACCORDING TO INSTRUCTIONS

195 DO 240 KN=l,NCOUT

C BUFFR IS THE BUFFER ARRAY USED TO STORE THE OUTPUT UNTIL A CARD IS C READY TO BE PRODUCED

C KNTR IS THE COLUMN POSITION IN BUFFER

KNTR=0

1=1 C FIND THE REQUESTED STRING

200 N=SNUMBR(KN,I)

DO 205 J=l,26 C COMPARE STRING LETTER WITH ALPHABET

IF (N.NE.ALPHB(J)) GO TO 205 M=J GO TO 210

205 CONTINUE

C IF NO STRING IS TO BE INSERTED, SKIP NEXT SECTION OF PROGRAM

GO TO 220

210 N=SLNGTH(M)

C TRANSFER THE STRING TO OUTPUT

DO 215 J=1,N

KNTR=KNTR+1

IF (KNTR.GT.80) CALL COVFL

215 BUFFR(KNTR)=STRING(MJ)

A 1900 A1910

A 1920 A1930 A 1940 A 1950 A 1960 A1970

A 1980 A 1990 A2000 A2010

A2020

A2030 A2040

A2050

A2060

A2070 A2080

A2090 A2100

A2110

A2120

A2130

A2140

A2150

A2160

A2170

A2180 A2200

A2190

A2210

A2220

A2230

A2240

A2250

A2260

A2270

A2280

A2290

A2300

A2310

A2320

A2330 A2

A2350 A2360

A2370

A2380

A2390

A2400 A2410

A2420

A2430

A2440

A2450

A2460

A2470

A2480 A2490

A2500 A2510

A2520

A2530

23
220

225 230 C

C

c

235 C

c

c

240 c

IF (FNUMBR(KN.I).EQ.O) GO TO 235 IF (CNUMBR(KN.I).EQ.O) GO TO 230 USE FNUMBR AND CNUMBR TO LOCATE A FIELD IN THE INPUT

N1=FNUMBR(KN,I)

N2=CNUMBR(KN,I)

N=FSTRT(N2,N1)

NN=FWIDTH(N2,N1)+'N-1

READ THE FIELD INTO THE OUTPUT

DO 225 J=N,NN

KNTR=KNTR+1

IF (KNTR.GT.80) CALL COVFL

BUFFR(KNTR)=KARD(N2J)

1=1 + 1 IF ANY MORE FIELDS ARE TO BE FILLED, RECYCLE AND CONTINUE WRITING

IN THE OUTPUT ARRAY

GO TO 200 PRINT THE BUFFER ARRAY

WRITE (PRINT.25) ,(BUFFR(J)J=1,KNTR)

PUNCHING IS SUPPRESSED IF THE SAME UNIT IS SPECIFIED FOR PUNCH AS

FOR PRINT

IF (PUNCH. EQ.PRINT) GO TO 240 PUNCH THE BUFFER ARRAY ON A CARD

WRITE (PUNCH,5) ,(BUFFR(J)J=1.KNTR)

ASSEMBLE THE NEXT KIND OF OUTPUT CARD

CONTINUE

MAKE ANOTHER PASS THROUGH THE PROGRAM

GO TO 140 END

A2535 A2540 A2550

A2560

A2570

A2580

A2590 A2600

A2610

A2620

A2630

A2640 A2650

A2670

A2680

A2690

A2700

A2710

A2720

A2730

A2 740 A2750

A2760

A2770

A2780

A2790

A2800

A2810-

SUBROUTINE COVFL

C THE SUBROUTINE COVFL IS CALLED IF KNTR EXCEEDS 80, INDICATING THAT

C THE OUTPUT ARRAY BUFFR HAS BEEN FILLED

COMMON ALPHB,READX,READ,PRINTX.PRINT,PUNCHX,PUNCH,KARDIN,KNTR.KARD

COMMON BUFFR

INTEGER PUNCH,PRINT,BUFFR

DIMENSION BUFFR(80), ALPHB(80)

C

  THE DIMENSIONS BELOW MAY BE REDUCED TO CONSERVE STORAGE ** ** DIMENSION KARD(9,132), KARDINU32)

C   THE DIMENSIONS ABOVE MAY BE REDUCED TO CONSERVE STORAGE ** **

5 FORMAT (80A1)

10 FORMAT (/1X,80A1)

KNTR=1

C TRANSFER THE ARRAY TO OUTPUT AS SPECIFIED BY THE UNIT NUMBERS

WRITE (PRINT.10) ,(BUFFR(JX)JX=1 .80) IF (PUNCH.EQ.PRINT) RETURN

WRITE (PUNCH.5) ,(BUFFR(JX)JX=1 ,80) RETURN

END

B 10 B 20

B 30

B 40

B 50

B 60

B 70

B 80

B 90

B 100 B 110 B 120 B 130 B 140 B 150 B 160 B 170 B 180 B 190

SUBROUTINE IFEND

C THE SUBROUTINE IFEND IS CALLED WHEN A STOP CHARACTER IS READ IN C COLUMN 80 OF AN INPUT

C IT CHECKS TO SEE WHETHER AN END-OF-DATA CARD HAS BEEN READ

COMMON ALPHB.READX.READ.PRINTX.PRINT,PUNCHX.PUNCH,KARDIN,KNTR,KARD

COMMON BUFFR

DIMENSION BUFFR(80), ALPH8(80)

C   THE DIMENSIONS BELOW MAY BE REDUCED TO CONSERVE STORAGE ** ** DIMENSION KARD(9.132). KARDINU32)

c 10 c 20 c 30 c 40 c 50 c 60 c 70 c 80

24
C

  THE DIMENSIONS ABOVE MAY BE REDUCED TO CONSERVE STORAGE ** ** INTEGER KARD.BUFFR.READ.PRINT,PUNCH,READX,PR1NTX.PUNCHX,ALPHB

5 FORMAT (22HOEND-OF-DATA CARD READ)

DO 10 J=!,80 C COMPARE EACH COLUMN AGAINST THE FIRST CONTROL CARD

IF (KARDIN(J).NE.ALPHB(J)) RETURN

10 CONTINUE

C THIS IS AN END-OF-DATA CARD

C WRITE END-OF-JOB MESSAGE

WRITE (PRINTX.5)

C WRITE AN END OF FILE ON ANY OUTPUT TAPE UNITS

C REWIND ALL TAPE UNITS

IF (READ.NE.READX) REWIND READ

IF (PRINT.NE.PRINTX) END FILE PRINT

IF (PRINT.NE.PRINTX) REWIND PRINT

IF (PUNCH.NE.PUNCHX.AND.PUNCH.NE.PRINT) END FILE PUNCH

IF (PUNCH.NE.PUNCHX.AND.PUNCH.NE.PRINT) REWIND PUNCH

STOP

END C 280-

25

C 90 c 100 c 110 c 120 c 130

( 140 c 150 c 160 c 170 c 180 c 190 c 200 c 210 c 220 c 230 c 240 c 250 c 260 c 270

* U.S. GOVERNMENT PRINTING OFFICE : 1968 —318-379

NBS TECHNICAL PUBLICATIONS

PERIODICALS

JOURNAL OF RESEARCH reports National

ireau of Standards research and development in

rsics, mathematics, chemistry, and engineering,

jmprehensive scientific papers give complete details the work, including laboratory data, experimental

procedures, and theoretical and mathematical analyses. Illustrated with photographs, drawings, and

charts.

Published in three 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, 35.00; for- eign, $6.00*.

• 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,

32.25; foreign, $2.75*.

• Engineering and Instrumentation

Reporting results of interest chiefly to the engineer

and the applied scientist. This section includes many

of the new developments in instrumentation resulting

from the Bureau's work in physical measurement,

data processing, and development of test methods.

It will also cover some of the work in acoustics,

applied mechanics, building research, and cryogenic

engineering. Issued quarterly. Annual subscription:

Domestic, $2.75; foreign, $3.50*.

TECHNICAL NEWS BULLETIN

The best single source of information concerning

the Bureau's 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. Annual subscription: Domestic,

$1.50; foreign, $2.25*.

•Difference in price is due to extra cost of foreign mailing.

NONPERIODICALS

Applied Mathematics Series.

tables, manuals, and studies. Mathematical

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) developed 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 subjects 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

cooperatively with interested Government and in- dustry 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. CLEARINGHOUSE

The Clearinghouse for Federal Scientific and

Technical Information, operated by NBS, supplies

unclassified information related to Governmentgenerated science and technology in defense, space, atomic energy, and other national programs. For

further information on Clearinghouse services, write:

Clearinghouse

U.S. Department of Commerce

Springfield, Virginia 22151

Order NBS publications from:

Superintendent of Documents

Government Printing Office Washington, D.C. 20402
U.S. DEPARTMENT OF COMMERCE

WASHINGTON, D.C. 20230

POSTAGE AND FEES PAID

U.S. DEPARTMENT OF COM MERC

OFFICIAL BUSINESS

"