A UNITED STATES DEPARTMENT OF COMMERCE

PUBLICATION ,/<->*- tf

*Nt« o«

'

NBS TECHNICAL NOTE 740

SETAB:

An Edit/Insert Program

for Automatic Typesetting

of Spectroscopic

and Other Computerized Tables

QC

100

115153

t» .740

tZ

U.S.

iPARTMENT

OF

COMMERCE

National

Bureau

of

Standards
NATIONAL BUREAU OF STANDARDS

The National Bureau of Standards 1 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 measurement 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 Institute 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 — Mechanics — Heat — Optical Physics — Nuclear

Sciences 2 — Applied Radiation 2 — Quantum Electronics s — Electromagnetics 3 — Time

and Frequency 3 — Laboratory Astrophysics a — Cryogenics 3. THE INSTITUTE FOR MATERIALS RESEARCH conducts materials research leading 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 promote

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 consists of a Center for Building Technology and the following divisions and offices: Engineering and Product Standards — Weights and Measures — Invention and Innovation — Product Evaluation Technology — Electronic Technology — Technical Analysis — Measurement Engineering — Structures, Materials, and Life Safety* — Building

Environment * — Technical Evaluation and Application 4 — Fire Technology.

THE INSTITUTE FOR COMPUTER SCIENCES AND TECHNOLOGY conducts research and provides technical services designed to aid Government agencies in improving cost effec- tiveness 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 Institute consists of the following

divisions: Computer Services — Systems and Software — Computer Systems Engineering — Information 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. The Office consists of the following

organizational units: Office of Standard Reference Data — Office of Information Activities — Office of Technical

Publications — Library — Office of International Relations.

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

3 Part of the Center for Radiation Research.

3 Located at Boulder, Colorado 80302.

4 Part of the Center for Building Technology.
APR 2 9 1974SETAB: An Edit/Insert Program for

Automatic Typesetting of Spectroscopic

and Other Computerized Tables

Robert C. Thompson and Joseph Hilsenrath

Office of Standard Reference Data

National Bureau of Standards

Washington, D.C. 20234

.et»T OF _

U.S. DEPARTMENT OF COMMERCE, Frederick B. Dent, Secretary

NATIONAL BUREAU OF STANDARDS, Richard W. Roberts, Director

Issued December 1973
JNational Bureau of Standards Technical Note 740

Nat. Bur. Stand. (U.S.), Tech. Note 740, 30 pages (Dec. 1973)

CODEN: NBTNAE

U. S. GOVERNMENT PRINTING OFFICE

WASHINGTON: 1973

For sale liy tlie Superintendent of Documents, U.S. Government Printing Office, Washington, D.C. 20402 (Order by SD Catalog No. C13.46:740). Price $0.55
Contents

1

.

Introduction 1

2. Characteristics of SETAB 2

3. Discussion of the Parameter Cards k

Sample Parameter Cards 5

4

.

Description of the Program 6

Block Diagram of SETAB 8

5 . Applications of SETAB 9

6 . Summary and Conclusions 15

References 15

Appendix I (Program listing) 17

Appendix II (Modification listing) 23

in

SETAB

An Edit/Insert Program for Automatic Typesetting

of Spectroscopic and other Computerized Tables

by

Robert C. Thompson and Joseph Hilsenrath

SETAB is a FORTRAN program which accepts a card deck or Fortran records on magnetic tape and inserts the appropriate flags

and shift symbols required by many programs associated with

phototypesetting devices. The program is specialized to the

particular application, the phototypesetter and typography

programs, and to the desired typefaces by means of parameter cards

supplied at run time. Examples are shown of spectroscopic tables

typeset on the Linofilm phototypesetter at the Government Printing

Office using the Autoset Typography Program. The program has also

been used for tables of other types of data. The program can handle any records which can be read by a FORTRAN "READ" statement

under "A" format control. The original record can be divided into

as many as 40 fields and these fields can be combined in any order

with any of 26 strings in front of or between the pieces. The

program will, on a signal, replace a field by another field or by a combination of fields and strings. The output lines are blocked

and paged via the insertion of the required strings between blocks

and pages.

Keywords: Automatic typesetting; computer-assisted typesetting

>

edit insertion program; FORTRAN program; phototypesetting of

spectroscopic tables; typesetting of tables.

1. Introduction

For years spectroscopists have been sending handwritten manuscripts to

the printer to have their spectroscopic tables typeset in graphic arts

quality. This was quite natural as long as all data logging and data

manipulation were performed manually. With the advent of automatic data

logging and the use of the computer for data reduction, the spectroscopists

began to keep their data on punched cards. The appearance of

phototypesetters provided a mechanism for the typesetting of machine

readable data without the necessity of rekeyboarding the data.

A technique for automatic typesetting of spectroscopic tables direct

from magnetic tapes was developed by W. R. Bozman in 1962. [1] . Since that

time several books of data have been produced by this method. The

production of each of these books entailed the preparation of special

programs by a programmer experienced in machine language programming and

having detailed knowledge of the operation of the Linofilm phototypesetting

machine.

The design of the SETAB program was motivated by the conviction that

the economic viability of computer-assisted typesetting rested on the use of

general-purpose rather than special-purpose programs. That this is indeed

the case, has been born out by experience with a number of applications that

are discussed in this paper.

1
In an earlier report, [2] McClenon and Hilsenrath have shown that the FORTRAN program REFORM can be used to insert the flags required by the typography programs. However, REFORM lacks a number of features desirable in a generalized edit/insertion program for phototypesetting of tables Therefore, the program SETAB, described in this report, was written incorporating many of the features of REFORM and containing a number of additional features desired for an edit/insert program.

While the magnetic tapes produced by Bozman had the codes required to

drive the photounit directly, SETAB produces tapes which need to be

processed by a typography program before the material can be set. It is,

however, a feature of SETAB that it can insert any required flags. It is

therefore not restricted to a particular typography program or to a particular typesetting machine. The specific flags are supplied at run

time.

Except for two READ statements (500,510), the program is written in a subset of ANSI FORTRAN. No logical statements are used, since the format of

these deviates from the standard on some computers. Particular care was taken to make it machine independent with respect to internal bit

configuration and as system independent as possible. The logical unit

numbers designating the system card reader, printer, card punch and tape

drives differ not only from machine to machine, but also from installation

to installation. Therefore some changes will probably be necessary if this

program is to be used at any other installation. In order to minimize the

modifications required in implementation, the input and output devices are designated by variables which are defined at the beginning of the program.

2. Characteristics of SETAB

The program discussed here operates on a fixed field file consisting of

cards, card images or Fortran records on a magnetic tape, and produces a magnetic tape suitable for input to typography programs such as those used

by the Government Printing Office. The program, suitably instructed via

parameter cards, divides the original record into as many as 40 fields and

then combines these fields in the specified order with up to 26 strings.

These strings can be typesetting flags such as locators to be put at the

beginnings of lines or columns, or a grid change flag to set a particular

column in boldface or italics.

Since a field can be defined as a single, character, it is possible to

make a character, a subscript or a superscript by bracketing it with the

required typesetting flags. It is also possible to add information that is

not in the input data stream if the information is to appear in the same place in every typeset line. Also, card decks often have blank cards

between blocks of data, and computer listings often have blank lines between

blocks. When that information is typeset the blank line between blocks is

usually of a different spacing than the spaces between normal data lines.

To accomodate this the program deletes all blank cards or lines and inserts

specified typesetting flags after each block of a specified number of lines

and after each page of a specified length. There are times when a character

in the input is not the character that is desired in the typeset copy. To

cope with this, the program can be instructed to replace one character by another in a specified portion of the record.
The over-all format of an output line is controlled by a parameter card

that designates the order of the fields and the strings, if any, to be

inserted. The latter control the typography and may even insert information

which was not contained in the original record. However, there are times

when the way the information in a given field is to be printed depends not

only on its position but also on its content. An example of the need for

handling information in a designated field differently depending on the

content of a portion of that field is shown in figure 1. Here the

information in the classification column is handled quite differently from

line to line depending upon whether the character in position 44 is numeric

or alphabetic.

Table 3. Observed and classified lines of W I

mm/_- .^l ,. «l. Intensity Wavenumber (cm -1

) Wavelength

A

Classification Arc Spark Observed o—

c

2746.734 40 36396.11 +0.02 15 3- 518°4 2747.005 50 2 36392.52 +0.06 3 P1- 496°2

2747.155 15 3 36390.54

2747.826 40 2 36381.65 -0.21

+0.16

*D 4-

*D 2-

426°3 397°2 2748.312 20 15 s 36375.21 -0.04 3 G 4- 528°3 2748.577 30 3 36371.71 +0.02 18 3- 553°4 2748.767 5 36369.20 -0.10 20 2- 573°3 2748.844 80 20 36368.17 +0.03 5 D 3- 411°4 2748.997 25 2 36366.15 +0.15 19 2- 556°2 2749.538 1 2 36359.01

2749.641 10 36357.65

2750.145 40 4 36350.98 -0.02 3 G 3- 496°2 2750.325 10 20 s 36348.60 +0.01 19826 5- 561

4

2750.444 10 36347.03 +0.08 193-

3 G 4-

561 4 527° 2746,73*+ 40 36396. 1J. +0.02 153 - 51840 5 2747.005 50 2 36392.52» +0.06 3P1 - 49620 19 4- 555

°4 2747.155 15 3 36390.54I 19 6- 559°5 2747.826 40 2 36381.6!> -0.21 5D4 - 42630 18 1-

544°i

+0.16 5D2 - 39720 19535 5- 558°4 2748.312 20 15S 36375. 21i -0.04 3G4 - 52830

2748.577 30 3 36371. 7JL +0.02 133 - 55340

2748.767 5 36369. 2() -0.10 202 - 57330

2748.844 80 20 36368.1"f +0.03 5D3 - 41140 5 D 2— 396°3 591 4 2748.997 25 2 36366.1!> +0.15 192 - 55620

22852 4—

2749.538 1 2 36359.03L

Figure 1. A portion of a spectroscopic table phototypeset from

information supplied on ordinary punched cards. Note how differently

the lines containing pure numerics are treated from those that contain

mixtures of letters and numbers.

8
3. Discussion of the Parameter Cards

A partial listing of the parameter cards for one run is shown in figure

2. A number of the cards were removed to permit one of each type of

parameter card to be shown in a single figure. The first card contains the

alphabet, beginning with A in column 1 and the digits starting with zero in

column 27. Column 47 must be blank and column 80 contains the character

used as a string delimiter.

The second card contains the following parameters in 13 format.

1. The number of fields in the input record

2. The length of the input record

3. The number of lines in an output block

4. The number of lines on an output page (This must be an integral

number of blocks)

5. The input unit number

6. The output tape unit number

7. The output print switch; = for a printer copy of the output, = 1

for only writing an output tape

8. The EOF switch;=0 for an end of file to be written at end of output

file, =1 if no EOF is to be written

9. The input tape rewind switch; = for tape to be rewound before

reading, = 1 if input tape is not to be rewound

10. The output tape rewind switch. =0 for tape to be rewound before

writing =1 if not

The last three fields are normally left blank or set equal to zero. These switches were provided to permit the processing of several input files

into one output file.

The third parameter card contains the character stream required to

achieve the spacing desired between blocks. The fourth card contains the

character stream which is desired to be placed at the end of each page. The

fifth card contains the line to be printed at the end of the table.

The sixth card, in 2613 format, gives the beginnings and lengths of the

input fields in pairs. Columns 1-3 contain the character or column number

that begins the first field. Columns 4-6 contain the number of characters

in the first field. Columns 7-9 contain the character or column number that

begins the second field, and so forth. If more than 13 fields are desired,

they are put on another card. A maximum of 40 fields can be specified. The

input record cannot exceed 132 characters.

The seventh card, in 26 (12, Al) format, specifies the makeup of the

output. If the output is to begin with a string, columns 1 and 2 can be

left blank or made zero. However, if any other pair of columns that would

specify a field number is blank or if the field number is zero, this is

taken as the end of the output record specification and no more fields or strings are put into the output record.

The eighth and succeeding cards contain the strings to be inserted

between fields of the input. Each string is terminated by the character in

column 80 of the first parameter card. The last card is to have the

character in column 1. This terminates the reading of strings. Only 26

strings are permitted.. The strings are automatically assigned names, which

are the letters of the alphabet in order.

The next set of cards contains the fields and characters for the single

character substitution. The cards are in 413 format. The first field

(columns 1-3) contains the column number where the substitition is to start.
/T5sT

/I99" (card to end field substitutions)

f

H14I15J (field replacement format card)

123456789

6 44 81 123456789

(field replacement designation card)

(card to end single character substitutions)

15 17 47 44 123456789012 (single character substituion card)

/* (card to end strings)

A«50' (string B)

/^Fl^IT1 (string A)

f A IB 2B 3B 4B 5B 6C 8D 7E 9C11D10F12G (main format card)

1234567890123456789012345678901234567890

A

1 9 11 7 19 6 25 8 34 5 40 5 45 1 46 1 47 6 53 1 54 1 57 3 40 3

^ 12345678901234567890123456789012345678901234567890123456789012345678901234567890

(field specification card)

F3 =F3$ END OF JOB / (end of job card)

f-F3 =F3 / (page separator card)

^F2 / (block separator card)

21 72 5 50 5 8 12345678901234567890

4 + U--

Output tape unit

Input unit

Line per page

1 Lines per block

"" Characters in input record

*~ Number of input fields

(^ABCDEFGHIJKLMNOPQRSTWWXYZ0123456789 ' /(*)=,$•+ - 1l2345678901234567890123456|7890123456p8901234567890123456789012345678901234567890

alphabet | numerics | t— blank End of string char -4

/

/

J

J

Figure 2. Sample Parameter Cards - A sampling of the parameter cards

required for a run, showing at least one of each type used. The numbers

on the second line of some of the cards are put there to show the

position for fixed field input.
The second field (columns. 4-6) contains the column number of the last column

for this substitution. The third field (columns 7-9) is the character code

(the card column from the first parameter card) of the character to be

replaced. The fourth field is the character code of the character that is

to replace the original character. The last card of the set must have the

number 199 in the first field. This signals the end of this set of cards.

Only 25 cards are allowed in this set unless the dimensions of IBST, IBEN,

LCAR, and LREP are changed.

The next cards contain, in pairs of cards, the changes in output

desired in up to 30 different fields. The first card of the pair, in 313

format, contains: in columns 1-3, the field to be replaced; in columns 4-6,

the input card column in which the flag character is to be found; in columns

7-9, the column of the first parameter card that contains the character that

is to act as a flag signaling the change in format. The second card of the

pair contains the strings and fields to replace the given field. This card

has the same format as the seventh parameter card which specified the normal

output. A maximum of 30 fields may be substituted for. The last card of

this set must have the number 199 in columns 1-3. If the column number

given for the flag character is 80 or less, it designates the character in

that card column of the first parameter card. If the number is 81 it

designates that the flag character is one of the characters in columns 1-26

of the first parameter card, i.e., any alphabetic character. The number 82

designates that the flag character is numeric (column 27-36 of the first

parameter card) . 83 designates any graphic character (not a character in

columns 1-36 of the first parameter card) . 84 designates any nonalphabetic

character (not in columns 1-26 of first parameter card) . 85 designates any

non-numeric character (not in columns 27-36 of first parameter card) . 86

designates any non-graphic character (any character in columns 1-36 of the

first parameter card) . The same character on input can be used to signal

changes in output for more than one field. The last card of this set shall

have the number 199 in the first field signaling the end of the set of

cards.

The last card, in 413 format, specifies the condition that signals when

the counter containing the number of lines processed is to be reset. When

the card contains the number 199 in columns one to three, the program will

insert the characters required to start a new page on the basis of the line

count in accord with the instructions given on card two. When it is

desirable to start a new page on the basis of the content of a line, it is

done by matching characters in the input to one of the ad hoc strings.

Columns 1-3 specify the beginning character number, columns 4-6 specify the

final character to be matched, columns 7-9 specify the number of the string

to be matched, and columns 10-12 contain the number to which the counter is

to be reset.

4. Description of the Program

The program consists of a main program with no subroutines. There are

a number of comment cards at the beginning that explain how the parameter

cards are to be prepared. In order to minimize changes when adapting this

program to other installations, the input and output instructions reference

the variables: ITAPE, IOTAPE, IRTAPE, and IPTAPE. The latter two are defined

via parameter cards input at the beginning of the program. In the listing

of the program accompanying this report, ITAPE is equated to logical unit 5 which is the card reader, IOTAPE is equated to . 6 which is the printer,

IRTAPE may have a default value of 5, and IPTAPE may have a default value of

3 specifying the card punch. The last two are normally specified on the

second parameter card, and only if the units specified are obviously

incorrect are the default values used. In installations where these

peripherals have different numbers, the nine statements (cards 790-870)
which check whether they have been correctly specified would have to be

changed. The first executable statements define ITAPE as the card reader

and IOTAPE as the printer.

A block diagram of the program is shown in figure 3. The first

parameter card serves to define the punch configuration for the characters

on the data and parameter cards. The presence of the characters on the

first card obviates the need to define them explicitly in the program. This

simple device makes the program independent of a variety of

incompatabilities which are often such a source of trouble in adapting

programs to different computers. The program logic uses the disposition of

the characters on the first parameter card in such a way as to avoid

entirely the need to know how a particular machine recognizes a character on

a card, what the internal bit representation of that character is, and where

that character is placed in a machine word. In this way the program is

independent of whether the particular machine stores away 3 characters per

machine word, or 6 or even 7. Nor is it dependent on whether a single

character is stored left-adjusted, right-adjusted or in any other way. The

second card specifies the input and output parameters. The program checks

the values supplied for the input and output units to see if they are reasonable and, if not, assigns default values. The strings to be inserted

between blocks and pages and at the end of the file are read into buffers.

The beginning and length of the fragments on the input record are defined.

Then the normal output format card is read, and the fields are checked to see that they were specified. The strings are then read into a buffer, and

the lengths of the strings are determined and stored. After reading the

cards specifying the single character substitutions, the field replacements

and the new page signal, the program is ready to process the input.

First a record is read into buffer IB in 132A1 format. If the record

is a blank line a new record is read in. The record is checked to see if it

has a flag signaling a change in paging. If the flag is found the line

counter is reset to the value specified. The single character substitution

is performed next.

The program is now ready to start building a new record in buffer

IBUFR, from pieces of the input record and the strings. The first number on

the output format card is checked, and the specified piece of the input

buffer IB is moved into IBUFR. If the first number is zero the program

skips down to the next step. Then the program checks the alphabetic

character to determine which string is to be transferred, and the specified

string is moved to IBUFR. If the alphabetic character is a blank no string

is moved. The program then checks to see if 'the next field number is zero

or blank, if it is, this signals that the record is complete. If the next

field number is one that is sometimes replaced by a different field or combination of fields and strings, the program checks the flag character. If

the field is to be replaced, the program moves the appropriate fields and

strings into IBUFR, otherwise it moves the specified field in. Then the

program places the next string into IBUFR and checks to see if the next

field number is zero or blank signaling that the record is complete.

If the record is complete, it is written out on tape, and if the print

switch (ITEST) is nonzero the record is also written on the printer. The

line counter is advanced by one. The counter is then checked to see if the

record was the last of a block. If it was, the counter is checked to see if

the line was the last line on the page. If the line was the end of a page

or a block the appropriate string is written on the output tape. Then the

program reads in a new record.
Standard characters Parameters & tapes Block separater

Page separater

End of job print Definition of fields Main output format

Ad Hoc strings,,

SJumglie char sib'Stiit«rt»ns FiieM repilace'inwrnt pairs

New page card >*

Read a record

Write out EOJ print EOF tapes STOP

Write omiit record

Write block separator

k *-Z

Write page separator

I Reset I ine com inter 3—

Do si m g he character

sin bst it inflows

Replace field by alternate

fields and strings

I

Figure 3. Block diagram of SETAB.

8
5. Applications of SETAB

An example of a simple table in a NSRDS publication [3] typeset by

using this program is shown in figure 4. The parameter cards and the data

cards for this portion of the' table are shown in figure 5. The output of

the program is shown in figure 6. The program, following the instructions

on the format card, has put =F1 at the beginning of each line of data. This

was used as the format flag for the Autoset Typography Program at the

Government Printing Office. It serves to select the desired typeface, point

size and leading (space between lines). The =40 causes 40 units of space to

be set between columns. The slash at the end of each line is the end of

record character. Between each block of five lines the character string

=F2=P1./ is defined to put the desired quad line between blocks. There is

nothing in the output to instruct the phototypesetting machine how to set

the column headings. This program does not have provision for table

headings, column headings, or rules. We prefer to have these set only one

time and then put on the table as an overlay.

Table 2. Thermodynamic i^unctions for Copper

Gram atomic wt. =63.5400, T °K= 273.1 5 + r°C, 1 cal=4.1840J T C% Ht—Ho (m-m)IT 5? -(C?-7/8) -(G?-m)IT

°K Jldeg-mol Jlmol Jldeg-mol Jldeg-mol Jlmol Jldeg-mol 1.00 0.000743 0.000359 0.000359 0.000711 0.000351 0.000351

2.00 0.00177 0.00158 0.000790 0.00152 0.00145 0.000727

3.00 0.00337 0.00409 0.00136 0.00251 0.00345 0.00115

4.00 0.00582 0.00860 0.00215 0.00379 0.00657 0.00164

5.00 0.00943 0.0161 0.00322 0.00546 0.0112 0.00223

6.00 0.0145 0.0279 0.00466 0.00760 0.0176 0.00294

7.00 0.0213 0.0456 0.00652 0.0103 0.0265 0.00379

8.00 0.0301 0.0712 0.00889 0.0137 0.0385 0.00481

9.00 0.0414 0.107 0.0119 0.0179 0.0542 0.00602

10.00 0.0555 0.155 0.0155 0.0229 0.0746 0.00746

11.00 0.0727 0.219 0.0199 0.0290 0.100 0.00913

12.00 0.0936 0.302 0.0251 0.0362 0.133 0.0111

13.00 0.119 0.407 0.0313 0.0447 0.173 0.0133

14.00 0.149 0.541 0.0386 0.0545 0.223 0.0159

15.00 0.184 0.706 0.0471 0.0660 0.283 0.0189

16.00 0.225 0.910 0.0569 0.0791 0.355 0.0222

17.00 0.273 1.158 0.0681 0.0941 0.442 0.0260

18.00 0.328 1.458 0.0810 0.111 0.544 0.0302

19.00 0.390 1.816 0.0956 0.131 0.665 0.0350

20.00 0.462 2.242 0.112 0.152 0.806 0.0403

25.00 0.963 5.703 0.228 0.305 1.917 0.0767

30.00 1.693 12.25 0.408 0.541 3.995 0.133 35.00 2.638 22.99 0.657 0.871 7.487 0.214 40.00 3.740 38.89 0.972 1.294 12.86 0.322 45.00 4.928 60.54 1.345 1.802 20.57 0.457

50.00 6.154 88.23 1.765 2.385 31.01 0.620

55.00 7.385 122.1 2.220 3.029 44.52 0.809

60.00 8.595 162.0 2.701 3.724 61.38 1.023 65.00 9.759 208.0 3.199 4.458 81.82 1.259 70.00 10.86 259.5 3.708 5.222 106.0 1.514

Figure 4. A portion of Table 2 of NSRDS-NBS-18 which was set on the

Linofilm phototypesetter from punched cards using SETAB to insert the

flags required by the Autoset Typography Program at the Government

Printing Office. The rules and headings were supplied with overlays.

9
ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' (*'1/=,$.+ $

7 72 5 50 5 7 1 =F2 =P /

• =F3 =P / =F4 =P /

2 6 ) 9 20 11 32 9 42 9 52 11 64 9 A IB 2B 3B 4B 5B 6B 7C =F1$

= 40$

/$

199

199

199

1.00 0.000743 0.000359 0.000359 0.000711 000351 000351CU JOULE

2.00 0.00177 0.00158 0.000790 0.00152 0. 00145 000727CU JOULE

3.00 0.00337 0.00409 0.00136 0.00251 00345 00115 CU JOULE

4.00 0.00582 0.00860 0.00215 0.00379 00657 00164 CU JOULE

5.00 0.00943 0.0161 0.00322 0.00546 0112 00223 CU JOULE

6.00 0.0145 0.0279 0.00466 0.00760 0176 00294 CU JOULE

7.00 0.0213 0.0456 0.00652 0.0103 0265 00379 CU JOULE

8.00 0.0301 0.0712 0.00889 0.0137 0385 00481 CU JOULE

9.00 0.0414 0.107 0.0119 0.0179 0542 00602 CU JOULE

10.00 0.0555 0.155 0.0155 0.0229 0746 00746 CU JOULE

11.00 0.0727 0.219 0.0199 0.0290 100 00913 CU JOULE

12.00 0.0936 0.302 0.0251 0.0362 133 0111 CU JOULE

Figure 5. The parameter cards and a portion of the data cards input to SETAB to produce the table shown in Figure 4. Note that the text in

columns 73-80 of the original file is ignored by defining the input

record to extend only to 72 characters. Had these comments appeared

between the desired data, they could have been ignored in the same manner that the blanks are ignored in the field definition card.

= F1 1.00=40 0.000743=40 0.000359=40 0.00035'1 = 40 0.000711=40 .000351=40 .000351 / =F1 2.00=40 0.00177 = 40 0.00158 = 40 0.00079C1=40 0.00152 = 40 .00145 = 40 .000727 / =F1 3.00=40 0.00337 = 40 0.00409 = 40 0.00136 = 40 0.00251 = 40 00345 = 40 .00115 / =F1 4.00=40 0.00582 = 40 0.00860 = 40 0.00215 = 40 0.00379 =40 00657 = 40 00164 /

= F1 5.00=40 0.00943 = 40 0.0161 = 40 0.00322 = 40 0.00546 = 40 ,0112 = 40 00223 / =F2 -P /

= F1 6.00=40 0.0145 = 40 0.0279 = 40 0.00466 = 40 0.00760 = 40 0176 = 40 00294 / =F1 7.00=40 0.0213 = 40 0.0456 = 40 0.00652 = 40 0.0103 = 40 0265 = 40 00379 / =F1 8.00=40 0.0301 = 40 0.0712 = 40 0.00889 = 40 0.0137 = 40 0385 = 40 00481 / =F1 9.00=40 0.0414 = 40 0.107 = 40 0.0119 = 40 0.0179 = 40 0542 = 40 00602 /

= F1 10.00=40 0.0555 = 40 0.155 = 40 0.0155 = 40 0.0229 = 40 0746 = 40 0, 00746 /

= F2 =P /

= F1 11.00=40 0.0727 = 40 0.219 = 40 0.0199 = 40 0.0290 = 40 100 = 40 0, 00913 /

= F1 12.00=40 0.0936 = 40 0.302 = 40 0.0251 = 40 0.0362 = 40 0. 133 = 40 0111 / =F1 13.00=40 0.0119 = 40 0.407 = 40 0.0313 = 40 0.0447 = 40 0. 173 = 40 0. 0133 / =F1 14.00=40 0.0149 = 40 0.541 = 40 0.0386 = 40 0.0545 = 40 0. 223 = 40 0. 0159 / = F1 15.00=40 0.0184 = 40 0.706 = 40 0.0471 = 40 0.0660 = 40 0. 283 = 40 0. 0189 / =F2 = P /

Figure 6. The output of SETAB resulting from the input shown in Figure

5. This was processed by the Autoset Typography Program at the

Government Printing Office and run on the Linofilm Phototypesetter to produce the results shown in Figure 4. The character inserted by SETAB

serve the following functions =F1 is a format flag which serves to select the type face, the point size and loading the sequence' =F2 =P /

provides for an appropriate space between the data blocks. =4

introduces 4 units of space between the columns. The slash acts as an end of record symbol.

10
A more interesting example of the use of SETAB for spectroscopic tables

is shown in figure 1 taken from a paper by Corliss [5] . A portion of the

original card deck used to produce the results shown in that figure are reproduced in figure 7. Figure 8 shows the character strings inserted in

the original records by SETAB from the instructions shown in figure 9 to

achieve the results shown in figure 1. The requirement that a digit in a particular position be typeset as a superscript character when it was part

of a term designation and as a normal character when part of a number was met by using the field replacement capability. Field 6 begins at position

40 and contains five characters. The normal format assumed the field

contained all digits or blanks and digits. The bracketed pair of field

replacement cards in figure 8 changes the format for term designations. The

first card of the pair can be read as: Replace Field 6 if the character in

position 44 is an alphabetic character (designated by 81), by the strings

and fields specified on the next card. The second card of the pair says the

replacement format is string P (!25!G2), field 14 (position 43), string L

(IG1() , field 15 (position 44), string M ) . String P (!25!G2) puts in 25

units of space so columns line up and pulls in the superscript grid. Field

14 is the character to be set as a superscript. String L brings back the

normal grid and shifts to upper case. Field 15 is the alphabetic character

and String M shifts to lower case. The next pair of cards accomplishes the same effect for the second level.

t 2 3 4 5 6 7 8 9 10 11 12 13 14 IS 1S 17 11111111111111111

18 19 20 21 27 23 24 25 26 27 28 29 30 31 32 33 34 3b 36 37 38 39 4C 41 42 43 44 45 4S 47 48 49 50 51 52 53 54 55 11111111111111111111111111111111111111

£746,734 40 36396.11 + 0.02 153 - 5 1840

2747. 005 50 2 36392.52 + 0. 06 3P1 - 4962D

2747.155 15 *-> 36390.54

c'747. 826 40 » •Z'O'-'O 1 a t«-J -0.21

+ 0,16

5D4 - 5D£ - 4263d

39720

£748.312 20 15S •_«0_w •_'. i_ i -0. G4 3G4 - 5283Q

O "7 ••; O c "7 ~? i- I -r '_; « _' i i 3 •^i -i £ --i -n i -? -i Z't'Z'i 1 . f 1 + 0. 02 183 - 55340

2748.767 5 0£0£Q Oft •JO-JO ? « C-J -0.10 202 - 5733D

c!74y. 844 80 £0 -£ "•£ O 1 "7 + 0. 03 5D3 - 41140

Figure 7. A part of the original card deck used to produce the table

shown in figure 1.

1F1 !F1

!F1

!F1

!F1! !F2

!F1

IF1

!F1

!F1

1F1

!F2

2746.734!

2747.005! 2747.155!

2747.826!

78!51!72!

!P / 2748.312!

2748.577!

2748.767!

2748.844!

2748.997!

!P /

51 40$$$!45 $$$15236396.11158+0. 02156 15!G2$ !G33!G1- 518 !G20'G34 " 60 'G4 / 51 50$$$!45 2$$$!5236392. 52158+0. 06!56!25!G23!G1(P)!G2$!G31!G1- 496 ' G20 ' G32 1 60 'G4 / 51 15$$$!45 3$$$!5236390.54!!58# / !56 !C2$!G3$!G1 !G2$ ' G3$ ' 60 'G4 / 51 40$$$!45 2$$S!5236381.65!58-0.21!56!25!G25!G1(D)!G2$!G34!G1- 426 ' G20'G33 ! 60 'G4 / 45!63!52!69!58+0.16!56!25!G25!Gl(D) !G2$!G32!G1- 397 !G20'G^2 ' 60 ' G4 / 20$$$!45 15S$$!5236375.21!58-0.04!56!25!G23!G1(G)!G2$!G34!G1- 528 !G20 'G33 60 ' G4 / 30$S$!45 3$$$!523637] .71158+0. 02156 18 !G2$ !G33 !G1- 553!G20!G34 ' 60 -G4 '/ 5$$$!45 $$$15236369. 20 ! 58-0. 10! 56 20!G2$ !G32 !G1- 5731G20' G33 ' 60 >G4 / 80$$$145 20$$$!5236368.17!58+0.03!56!25!G25!G1(D)!G2$!G33!G1- 411!G2CP G34 > 60 ' G4 / 25$$$!45 2$$$!5236366. 15158+0. 15J56 19 !G2$ 1G32 1G1- 556 1 G201G32 ' 60 >G4 '/

Figure 8 The records from figure 7 showing the character strings inserted by SETAB via the instructions shown in figure 9.

11
ABCDEFGHI JKLMN0PQRSTUVWXYZ0123456789 ' / ( 22 72 5 50 5 8

)=.».+

!P /

!F3 ! !F2

!F3

!F3

1 43

A Fl'

51'

45'

52'

58'

56'

G2'

G3'

G,l' 60!G4

/'

!G1'

(

)!25!G2'

!25!G2'

!16'

!78'

!72'

!63'

!69'

F3 !P /

/

11

44

2C

17

24

36

47

47

47

46 47

54 47

47

3D

7 19

1 47

4E

50

50

50

50

50

60

15

22

36

45

53

34 34

199

1 6 47

R

2 6 47

S

3 6 47

T4 6 47

U

^j"6 44 81

*(_P14L15M

9 52 81

16Q20G17L18M

12 57 18

N19M22

199

199

6 25

1 51

5F 6G

BLOCK SEPARATOR

PAGE SEPARATOR

END. OF TABLE

8 34 5 40 5 45

1 8H

STRING A STRING B

: /STRING C STRING D

STRING E

,.STRING

STRING

STRING

STRING

_ STRING J _ STRING K

STRING L

STRING--;*

, STRING N

STRING

; STRING P STRING Q

STRING R

STRING S

STRING T

STRING U

1 46

52 1 57 1 50 1 59

71 9G11H10J12K

LOCATOR TO BEGIN LINE

1 47

1 58

6 53 1 54 1 57 3 40 3

SPACE BETWEEN COLS.

SPACE BETWEEN COLS

.

SPACE BETWEEN COLS

.

SPACE BETWEEN COLS

.

SPACE BETWEEN COLS.

^SUPERSCRIPT GRIP FLAG

: .SUBSCRIPT GRID FLAG

NORMAL GRID FLAG

END OF STRING SYMBOL

1 AND 2

2 AND 3

3 AND 4

5* AND 6

7 AND 8'

LOWER CASE SHIFT

UPPER CASE SHIFT

WIDTH

WIDTH

WIDTH

WIDTH

OF COLUMN

OF COLUMN

OF COLUMN

OF COLUMN

SYMBOL

SYMBOL

END OF STRINGS I IN COLS 15 THRU 18 REPLACE A BLANK (47) BY A $ [50]

IN COL 36 REPLACE A BLANK (47) BY A / (38!

END OF CHARACTER REPLACEMENT CARDS

REPLACE FIELD 1 IF COL 6 IS BLANK

REPLACE FIELD 2 IF COL 6 IS

REPLACE FIELD 3

:

: m STRING R

BLANK

BY STRING S

IF COL 6 IS BLANK

BY STRING T

REPLACE FIELD 6 BY THE FOLLOWING IF COL 44 IS ALPHABETIC

REPLACE FIELD 9 BY THE FOLLOWING IF COL 52 IS ALPHABETIC

Figure 9. The parameter cards used witii SETAB to produce

the output sliown in figure 8. The bracketed pair of field

replacement cards are the ones that permit the typographic

variation between lines in the classification column in

figure 1. The grey area contains comments which the

program ignores.

12
An example of a different spectroscopic table from a paper by Sugar [6]

is shown in figure 10. The parameter cards input to SETAB are shown in

figure 11. Note that J values in the classification column are given as integers in columns 33 and 42 with an added 1/2 being implied. It was possible to change the integers to fractions by making use of the field

replacement feature of the program. The J value is defined as a separate

field. The string !G3 inserted before the J value calls up the subscript

grid. Then pairs of field replacement cards are used to replace the

integers by the required fractions. Field 7 is a single character in

position 33. The bracketed pair of field replacement cards replace a 2 by

5/2. The first card of the pair can be read as: Replace Field 7 , if the

character in position 33 is a 2 (designated as character 29) , by the strings

and fields specified on the next card. The second card of the pair

specifies the 'replacement format as string M, which is 5/2. Ten sets of

cards are required to handle the ten possible digits which define the J

values in one field. Since this is done for two fields, a total of forty

cards are required for this purpose.

A

Intensity

(cm- 1 )

Classification

3011.282

3006.469

3004.002

3002.106

2982.236

2980.583

2978.907

2976.347

2963.032

20* v 60* r 10* r 2

9*r

9*

40*

33198.77

33251.92

33279.22

33300.24

33522.11

33540.70

33559.57

33588.43

33739.36

50227 s/2 - 38726 7/2 52026 3/2 - 38694 5/2-

45844 3/2 -

50869 , /2 - 45807 5/2 - 45807 5/2-

36642 ,3/2- 3011

3006

3004

3002

2982

2960

29S0

2978

2976

2963

2940

2933

2930

2924

2910

.262

.469

.002

.106

.236

.607

.583

.907

.347

.032

.896

.827

.192

.661

.612

2Q*V

60*R

10*R

2

9*R

5C

5*R

9*V

40*V

2

7*V

1 50*V

2*V

70*V

33196.

33251.

33279.

33300.

33522.

33540.

33540.

33559.

33588.

33739.

33993.

34075.

34117.

34181.

34346.

7750227

9238726

2252026

2438694

1145844

4250869

7050869

5745807

4345807

3636642 6

3051312 2

2137919 3

4635291 4

9950227 1 9828885 4

83426°5/2 71978°7/2 85306°5/2

71994°5/2 79366°5/2

84409°3/2

79366°5/2 79395°7/2 70381°,3/2

8342602

7197803

8530602 B12 5/2 7199402 )19 7/2 - 7936602 >Q1 , _

8440901 %l 912 8440901 ' Z ' 3/2 7936602

7939503

7038106

8530602

7199402

6940805

8440901

6323203

$85 9/2 —

85306°5/2 71994°5/2 69408°„/2 84409°3/2 63232°7/2

Figure 10. A portion of a table phototypeset using SETAB as the

Edit/Insertion program to transform the records shown as an insert. Note that the character before the dash is an integer.

Each of the integers in this position is replaced by a fraction

as follows: 2 becomes 5/2, 3 becomes 7/2 etc. This table v/as

set in 8 point type in galley form and pasted up into 2 columns.

The rules and column headings were stripped in manually.

13
ABCoEFGHlJKLMNOPQRSTUVWXYZO 123456789 /(*)=»$.+ - 11 72 5 55 7 8

!P %

-'Fl .'Fl !F1 fP %

.'Fl .'Fl !F1>E<ND OF JOB %

8 11 4 15 2 18 9 27 5

$

IB 2 3C 4V

.'Fl !F1

!F1

2

A

!.Flt !45i

.'45'

! G2> • !G3<r»

!G1<»

% » !68»

.'36.

.'77. l>/<2$»

3>/<2$»

5>/<2$»

7>/<2$«

9>/<2$»

ll>/<2»

13>/<2»

15>/<2»

17>/<2»

19>/<2»

.'G4>-<;gi»

!54»

i 15 16 47 5n

31 31 47 65

32 32 15 43

32 32 27 43

32 32 47 50

41 41 15 43

41 41 27 43

41 41 47 50

199

1 1 40

H

2 1 40

I3 15 40

Ull

4 1 40

33 27

33 28

33 29

199

199

BLOCK SEPARATQR

PAGE SEPARATOR

END OF TABLE

32 1 33 1 34 7

8D 9E10G

LOCATOR TO BEGIN LINE

SPACE BETWEEN COLS. 1 AND 2

SPACE BETWEEN COLS. 2 AND 3

SUPERSCRIPT GRID FLAG

SUBSCRIPT GRID FLAG

NORMAL GRID FLAG

END OF LINE SYMBOL

WIDTH OF COLUMN 1 WIDTH OF COLUMN 2

WIDTH OF COLUMN 3

REPLACES

12

3

4

5

6

7

41 1 42 1 16 1 5D 6E 7F

STRING A

STRING B

STRING C

STRINGSTRING E

STRING F

STRING G

STRING H

STRING I STRING J

STRING K

STRING L

STRING M

STRING N

STRING

STRING P

STRING Q

STRING R

STRING S

STRING T

STRING U

STRING V

ENO OF STRINGS

IN COLS 15-16 REPLACE A BLANK (47) BY A S(50>

IN COL 31 REPLACE A BLANK (47) BY A *(65)

A 0(151 BY A »<43)

A 0(27) BY A »<43)

REPLACES

REPLACES

REPLACES

REPLACES

REPLACES

REPLACES

REPLACES

REPLACES 8

REPLACES 9

IN COL 32 REPLACE

IN COL 32 REPLACE

END OF CHARACTER REPLACEMENT CARDS

REPLACE FIELD 1 IF COL 1 IS A * (40)

BY STRING H (WIOTH OF COL

REPLACE FIELO 3 IF COL 15 IS A *(40)

BY STRING U» FIELD 11

1)

REPLACE FIELD 7 IF COL 33

BY STRING KU/2)

IS A 0(27)

2(29)

....._£!£*-.

END OF' FIELD REPLACEMENT CARDS

LAST PARAMETER CARD

Figure 11. The parameter cards used with SETAB to produce the output shown

In figure 10. The bracketed pair of field replacement cards are the ones

that permit pnototypeseting a 5/2 for the 2 before the dash on the first

line.

14
6. Summary and Conclusions

SETAB is a general-purpose program written in ANSI FORTRAN that inserts

into a character stream, symbol sequences required by typography programs at

the U.S. Government Printing Office. This program permits any computer user

to prepare a magnetic tape for phototypesetting of spectroscopic and other

tables from fixed field records. The generality of the program arises from

the fact that all of the typographic instructions are supplied in the form

of parameter cards which are external to the program. The use of this

program makes it economical to produce tables with complex spectroscopic

notation for tables as short as 10 pages or less. The program is listed in

Appendix I. The examples used in this report are from jobs run through an old 1401 Autoset program. Since then the G. P. 0. has changed the computer

as well as the typesetting programs, and the typesetting flags they

recognize. In spite of these substantive changes in the typesetting

programs, the SETAB program described here did not need to be rewritten,

because the typographic instructions are carried on the control cards. For

example, the present method uses the string !I01 instead of !F1. Similarly

the string !P is no longer used at the end of the strings used to denote

block separaters, page separators, etc.

The program listed in Appendix I produces an output tape containing a separate record for each line to be printed. Now that the Typography

programs at the Government Printing Office have large input buffers they

request blocked records. The modification used at NBS is listed in Appendix

II. It was not written in ANSI FORTRAN because the NBS computer can not

write FORTRAN records longer than 132 characters.

References

[1] William R. Bozman, "Phototypesetting of Computer Output", Nat. Bur.

Stand. (U.S.), Tech. Note 170 (June 1962). Available from the

Superintendent of Documents, U.S. Government Printing Office, Washington,

D.C. 20402

[2] Robert C. McClenon and Joseph Hilsenrath, "Reform: A General Purpose

Program for Manipulating Formatted Data Files", Nat. Bur. Stand. (U.S.),

Tech. Note 444 (Aug. 1968). Available from the Superintendent of Documents,

U.S. Government Printing Office, Washington, D.C. 204 02

[3] George T. Furukawa, William Saba, and Martin L. Reilly, "Critical

Analysis of Heat-Capacity Data of the Literature and Evaluation of

Termodynamic Properties of Copper, Silver and Gold from to 300°K", Nat.

Stand. Ref. Data Ser. Nat. Bur. Stand. (U.S.), 18 (Apr. 1968). Available

from the Superintendent of Documents, U.S. Government Printing Office,

Washington, D.C. 20402

[4] Donald D. Laun and C. H. Corliss, "The First Spectrum of Tungsten

(WI)" , J. Res. Nat. Bur. Stand. (U.S.), 72A, (Phys. and Chem. ) No. 6 (Nov. - Dec. 1968)

[5] Jack Sugar, "The Third Spectrum of Praseodymium (Pr III) in the Vacuum

Ultraviolet", J. Res. Nat. Bur. Stand. (U.S.), 73A (Phys. and Chem.) No. 3

(May - June 1969)

15

APPENDIX I

The program as listed here was written to permit easy

implementation on various computers and compilers of

different vintage. If it is desired to block the output,

modifications must be made. The markings to the right of

the listings indicate which lines of the program were

replaced by correspondingly marked lines in APPENDIX II to

provide blocked output from the NBS computer. The < means

insert and the dot and brace denote lines to be replaced by

corresponding sections in APPENDIX II.

17
C SETAB STB 10

C STB 20

C THIS PROGRAM WAS WRITTEN BY R.C.THOMPSON NBS NSRDS IN AUGUST 1968. STB 30

C IT IS A EXPANSION OF CTGPO WRITTFN BY R.CTHOMPSON IN DECEMBER OF 67 STB 40

C IT CAN BE USED TO REFORMAT TABLES IN GALLY FORMAT INTO GPO FORMAT. STB 50

C THE PROGRAM DIVIDES THE CARD OR LINE INTO A MAXIMUM OF 40 FIELDS. THESTB 60

C . NEW LINE IS COMPOSED OF THESE FIELDS REARRAINGED IN ANY ORDER WITH STB 70

C AD HOC STRINGS ADDED BETWEEN THE FIELDS. SINGLE CHARACTER SUBSTITUTIOSTB 80

C MAY BE PERFORMED ON ANY RUN OF COLUMNS. USING A COL AS A FLAG A FIELDSTB 90

C MAY BE REPLACED BY A LIST OF STRINGS AND FIELDS. STB 100

C THE FIRST CONTROL CARD CONTAINS THE LIST OF CHARACTERS WITH THE STB 110

C LETTER A IN COL 1. B IN COL 2, ET SEQ. THE NUMBERS FOLLOW WITH ZERO STB 120

C IN COL 27 ET SEQ. COL 47 IS BLANK AND COL 80 HAS THE CHARACTER USED STB 130

C TO END THE STRINGS. STB 140 • A

C THE SECOND CARD IS IN 2613 FORMAT. ALL NUMBERS TO BE RIGHT ADJUSTEDSTB 150

C cOLS 1-3 IS THE NUMBER OF FIELDS TO DIVIDE THE INPUT RECORD INTO, STB 160

C u-6 LENGTH OF INPUT RECORD* 7-9 IS NUMBER OF LINES IN A BLOCKr 13-12 STB 170

C IS THE NUMBER OF LINES ON A PAGE* 13-15 IS THE INPUT TAPE UNIT, IF STB 180

C THIS FIELD IS OR BLANK A DEFAULT NUMBER OF 5 DESIGNATING THE CARD STB 190

C READER IS USED. 16-18 IS THE OUTPUT TAPE NUMBER, A DEFAULT NUMBER OP STB 200

C 3 DESIGNATES THE CARD PUNCH. 19-21 IS 1 IF A COPY OF THE OUTPUT ON STB 210

C THE PRINTER IS NOT DESIRED. 22-24 IS 1 IF A END OF FILE IS NOT DESIRESTB 220

C ON THE OUTPUT TAPE. 25-27 IS 1 IF THE INPUT TAPE IS NOT TO BE REWOUNDSTb 230

C 28-30 IS 1 IF THE OUTPUT TAPE IS NOT TO BE REWOUND. STB 240

C THE THIRD CARD CONTAINS THE LINE TO BE PRINTED BFTWEEN BLOCKS. STB 250

C THE FOURTH CARD CONTAINS THE LINE TO BE PUT AT THE END OF A PAGE. STB 260

C THE FIFTH CARD CONTAINS THE LINE TO BE PUT AT THE END OF THE TABLE STB 270

C THE SIXTH CARD IN 2613 FORMAT GIVES THE START AND WIDTHS OF THE INPUTSTB 280

C FIELDS, IF MORE THAN 13 FIELDS ARE REQUIRED THEY ARE PUT ON ANOTHER STb 290

C CARD. THE NEXT CARD IN 26(12, Al) FORMAT SPECIFIES THE MAKEUP OF THE STB 300

C OUTPUT CARD OR LINE. THE INPUT AND OUTPUT CAM NOT EXCEED 132 CHARS. STB 310

C THE FOLLOWING SET OF CARDS CONTAIN THE STRINGS TO BE INSERTED. EACHSTB 320

C STRING MUST BE TERMINATED BY THE CHARACTER IN COL 80 OF THE FIRST STB 330

C CONTROL CARD. A CARD WITH THAT CHAR IN COL 1 TERMINATES THE READING STB 340

C oF STRINGS. ONLY 26 STRINGS ARE PERMITTED. STB 350

C THE NEXT SET OF CARDS CONTAINS THE FIELDS AND CHARACTERS FOR THE STB 360

C SINGLE CHAR SUBSTITUTION. IN 413 FORMAT. THE FIRST FIELD CONTAINS STb 370

C THE COL WHERE SUBS STARTS, THE SECOND FIELD WHERE SUBS ENDS ,THE THI STr 380

C rD FIELD IS THE CARD COL OF THE FIRST CONTROL CARD OF THE CHAR TO BE STB 390

C REPLACED, THE FOURTH FIELD IS CARD COL OF CHAR TO BE INSERTED IN PLACSTB 400

C oF THE ORIGINAL CHAR. THE LAST CARD OF THIS SET IS TO HAVE 999 IN THESTB 410

C FIRST FIELD, THIS TERMINATES THE READING OF THIS SET. ONLY 25 CARDS STB 420

C fl RE ALLOWED IN THIS SET. STB 430

C THE NEXT CARDS CONTAIN IN SETS OF TWO CARDS THE CHANGES IN OUTPUT STB 440

C REQUIRED IN UP TO 30 DIFFERENT FIELDS. THE FIRST CARD IN 313 FORMAT STb 450

C CONTAINS 1 THE FIELD TO BE REPLACED, 2 THE COL THE FLAG IS TO BE IN. STB 460

C 7S THE CHAR THAT IS TO ACT AS A FLAG SIGNALING REPLACEMENT. THE STB 470

C SECOND CARD CONTAINS THE STRINGS AND FIELDS TO BE INSERTED IN TH SAMESTB 480

C FORMAT AS IN THE CARD SPECIFYING THE OUTPUT. IF THE NUMBER OF FIELD STB 490

C j> IS 80 OR LESS IT DESIGNATES THE CHARACTER IN THAT CARD COL OF THE STB 500

C FIRST CONTROL CARD. IF IT IS 81 IT DESIGNATES ANY ALPHABETIC CHARACTRSTB 510

C 82 IS ANY NUMERIC CHAR, 83 IS ANY GRAPHIC CHAR, 84 IS ANY NONALPHABETSTB 520

C <-HAR, 85 IS ANY NONNUMERIC CHAR, 86 IS ANY NONGRAPHIC CHARACTER. STB 530

C THE LAST CARD IN 413 FORMAT SPECIFIES THE CONDITION THAT IS TO STb 540

C c;TART A NEW PAGE. COL 1-3 CONTAINS THE STARTING COL. 4-6 CONTAINS STB 550

C THE LAST COL. 7-9 CONTAINS THE NUMBER OF THE STRING TO BE MATCHED. STB 560

C 10-12 CONTAINS THE NEW NUMBER THF LINE COUNTER IS TO BE SET TO. STB 570

C tO START A NEW PAGE WITH THE LINE MATCHED, THE NUMBER OF LINES PER STB 580

C dAGE IS PUT IN COL 10-12. STB 590

C IF THE NUMBER INPUT AS THE STARTING COL. IS GREATER THAN 150 THE STB 600

C PROGRAM SKIPS THE CHECK FOR A NEW PAGE. STB 610

C STB 620

DIMENSION ISTRT(40), IWIDTH(40), IA(IOO), ISTRNG (26 , 80 ) , IB(132) STB 630

DIMENSION IBUFR(135), IBTX(IOO), IPTX(IOO), IETX(IOO), IFNBR(30) STB 640

DIMENSION ISNBR(30), LNGTH(29), IBST(?5), IBEN(25), LCAR(25), LREPSTr 650

1(25) STB 660

DIMENSION JFNBR(30), JCAR(30), JCOL(30), KFNBR ( 30 , 30 > , KSNBR ( 30 , 30STR 670

1) STB 680 / d

C THE NEXT TWO CARDS ARE INSTALLATION DEPENDENT. STB 690 S ITAPE=5 STB 700

I0TAPE=6 STB 710

C INPUT PARAMETER CARDS. STR 720 READ (ITAPE,1140) ( I A ( J) , J=l , 80) STR 730 • C

WRITE (IOTAPE,1150) ( I A ( J) , J=l , 80

)

STB 740 READ (ITAPE,1160) NFLDS, IRLNG, IBLK , IPAG, I&TAPF, IPTAPE, ITEST, IEND, ISTB 750

1RCK,IPCK STB 760

18
1020

3040

5060

7080

90

100

110

120

130

C

140

150

160

C170

180

190

200

210

220

230

210

250

260

270

280

290

300

THE NEXT TEN CARDS CHECK I/O TAPES AND ARE INSTALLATION

IF (IRTAPE-5) 10.50.20

IRTAPE=5

GO TO 50

IF (IRTAPE-6) 10.10.30

IF (IRCK) 50.40.50

REWIND IRTAPE

IF (IPTAPE-6) 60r90r70

IPTAPE=3

GO TO 90

IF (IPCK) 90.80.90

REWIND IPTAPE WRITE (IOTAPE.1170) NFLDS . IRLNGr IBLK » IPAG. IRTAPE . IPTAPE. l.IRCK.IPCK

INPUT BLOCK AND PAGE SEPARATOR AND END OF JOB CARDS. READ (ITAPE.1140) ( IBTX ( J) . J=l . 80

WRITE (IOTAPE.1150) < IBTX ( J) . J=l . 80

READ (ITAPE.1140) ( IPTX ( J) J=l . 80

WRITE (IOTAPE.1150) ( IPTX ( J) » J=l » 80

READ (ITAPE.1140) ( IETX ( J) » J=l .80

WRITE (IOTAPE.1150) ( IETX ( J) . J=l . 80

INPUT FIELD SPECIFICATION CARDS. 40 FIELDS MAXIMUM.

READ (ITAPE.1160) ( ( ISTRT ( J) . IWIDTH ( J) ) , J=l .NFLDS)

DO 110 J=l .NFLDS K=J KLS=J

IF (ISTRT(J)) 100.120.100

IF (IWIDTH(J)) 110.120.110

CONTINUE

GO TO 130

WRITE (IOTAPE.1200) NFLDS.K

WRITE (IOTAPE.1170) (< ISTRT (J) . IWIDTH (J) ) »J=1 .NFLDS) INPUT THE OUTPUT FORMAT CARD. CHECK IP FIELD IS DEFINED.

READ (ITAPE.1180) ( ( IFNBR ( J) . ISNBR < J) ) . J=l . 26)

WRITE (IOTAPE.1190) ( ( IFNBR ( J) . ISNBR ( J) ) . J=l . 26) DO 140 J=1.26

KK=IFNBR(J)

IF (KK-K) 140.140.150

CONTINUE

GO TO 160

WRITE (IOTAPE.1210) KK.K STOP WRITE (IOTAPE.1220)

JJ=1

INPUT AD HOC STRINGS.

READ (ITAPE.1140) ( ISTRNG ( JJ. J) . J=l . 80)

IF (ISTRNG(JJ.1)-IA(80)) 180.280.180

K = l K=K+1

IF (ISTRNG(JJ.K)-IA(80)

IF (K-80) 190.210.210

DO 220 L=1.80

LE=81-L

IF (ISTRNG(JJ.LE)-IA(47)

CONTINUE

LNGTH(JJ)=LE

K=LE+1

IF (ISTRNG(JJ.LE)-IA(47) ) 270.240.270

WRITE (IOTAPE.1230) JJ JJ=JJ+1

IF (JJ-27) 170.170.260

WRITE (IOTAPE.1240) IA(80)

STOP

LNGTH(JJ)=K-1

M=K-1 WRITE (IOTAPE.1150) ( ISTRNG ( JJ. J) . J=l , 80

JJ=JJ+1

GO TO 250

NSTRNG=JJ-1

WRITE (IOTAPE.1250) NSTRNG

K = l KtJTR = LINES=0

WRITE (IOTAPE.1260) IRLNG

IF (IRLNG) 300.300.290

IF (IRLNG-132) 310.310.300

WRITE (IOTAPE.1270)

19

DEPENDENT STR

STB

STB

STB

STR

STR

STB

STR

STB

STB

STR

STB

ITEST.IENDSTR

STB

STB

STB

STB

STB

STB

STR

STB

STB

STB

STB

STB

STR

STB

STB

STB

STB

STR

STB

STB

STB

STB

STB

STB

STB

STB

STB

STB

STB

STB

STB

STB

STB

200.270.200

230.220.230

770

780

790

800

810

820

830

840

850

860

870

880

890

900

910

920

930

940

950

960

970

980

990

1000

1010

1020

1030

1040

1050

1060

1070

1080

1090

1100

1110

1120

1130

1140

1150

1160

1170

1180

1190

1200

1210

1220

< D

STB1230

STB1240

STB1250

STB1260

STB1270

STB1280

STB1290

STB1300

STB1310

STB1320

STB1330

STB1340

STB1350

STR1360

STB1370

STB1380

STB1390

STB1400

STB1410

STB1420

STB1430

STB1440

STB1450

STB1460

STB1470

STB1480

STB1490

STB1500

STB1510

STB1520

STB1530
310

C320

330

31*0

C350

360

370

380

C

C390

395

C

CCtoo

410

420

C430

440

450

460

470

480

C490

500

510

C520

530

540

STOP

J=l

WRITE (IOTAPE.1280)

IREP=0 INPUT SINGLE CHARACTER SUBSTITUTION CARDS. READ (ITAPE.1160) IBST ( J) . IBEN ( J) . LCAR ( J) .LREP ( J) IF (IBST(J)-199) 330.340.340

IREP=J

WRITE (IOTAPE.1170) IBST ( J) . IBEN( J) . LCAR ( J) »LREP ( J)

J=J+1

GO TO 320

J=J-1

WRITE (IOTAPE.1290) J L=l

K=KLS

INPUT FIELD REPLACEMENT SPECIFICATION CARDS. READ (ITAPE.1160) JFNBR (L) . JCOL (L) . JC AR (D

WRITE (IOTAPE.1170) JFNBR ( L ) » JCOL ( L ) . JC AR ( L) IF (JFNBR(L)-40) 360.360.390

READ (ITAPE.1180) ( (KFNBR (L.K) . KSNBR (L»K ) ) fK=l .26)

WRITE (IOTAPE.1190) ( (KFNBR (L.K )» KSNBR (L. K )) »K = 1 » 26)

DO 37n J=1.26

KK=KFNBR(L.K)

IF (KK-K) 370.370,150

CONTINUE

L=L+1

IF (L-30) 350.350.380

WRITE (IOTAPE.1130)

INPUT NEW PAGE SPECIFICATION CARD.

* NEXT STATEMENT NOT ASA FORTRAN *****

READ (ITAPE.1160.END=395) MCST. MCEN. MSTRNG. MLINE

GO TO 400

MCST = 199

WRITE (IOTAPE.1170) MCST.MCEN» MSTRNGr MLINE START PROCESSING RECORDS.

INPUT A RECORD.

* NEyT STATEMENT NOT ASA FORTRAN *****

READ (IRTAPErll40»END=1070) ( IB ( J) > J=l > IRLNG)

L=l

CHECK FOR END BY PARAMETER CARD

DO 410 J=lr26

IF (IB(J)-IA(J) ) 420»410»420

CONTINUE

GO TO 1070

1 = 1 IF (IBLK) 450.450f430

CHECK FOR BLANK LINE' IF BLANK READ NEW LINE

DO 440 J=l» IRLNG

IF (IB(J)-IA(47) ) 450.440.450

CONTINUE

GO TO 400

IF (MCST-150) 460.480.480

K=0

DO 470 J=MCST»MCEN

K=K + 1 IF (Ir(J)-ISTRNG(MSTRNG.K) ) 480.470.480

CONTINUE

LINES=MLINE

IF (IREP) 520,520.490

START CHARACTER SUBSTITUTION BY FIELDS

DO 510 J=1»IREP

LC=LCAR(J)

LR=LREP(J)

LS=IBST(J)

LE=IBEN(J)

DO 510 K=LS.LE

IF (IA(LC)-IB(K) ) 510.500.510

IR(K)=IA(LR)

CONTINUE

BUILD A NEW RECORD FROM OLD RECORD AND AD HOC STRINGS.

N=IFNBR(I)

IF (N) 530.550.530

NN=ISTRT(N)

DO 540 J=NN.NX

KNTR=KNTR+1

IF (KNTR-132) 540.540.1120

IBUFR(KNTR)=IB(J)

STB1540

STB1550

STB1560

STB1570

STB1580

STB1590

STB1600

STB1610

STB1620

STR1630

STB1640

STB1650

STB1660

STB1670

STB1680

STB1690

STB1700

STB1710

STB1720

STB1730

STB1740

STB1750

STB1760

STB1770

STB1780

STB1790

STB1800

STB1810

STB1820

STB1830

STB1840

STB1854

STB1858

STR1850

STB1860

STB1870

***** STB1880

STR1890

STB1900

STB1910

STB1920

STB1930

STB1940

STB1950

STR1960

STB1970

STB1980

STB1990

STB2000

STB2010

STB2020

STB2030

STB2040

STB2050

STB2060

STB2070

STB2080

STR2090

STB2100

STB2110

STR2120

STB2130

STB2140

STR2150

STB2160

STR2170

STB2180

STB2190

STB2200

STB2210

STB2220

STB2230

STB2240

STR2260

STB2270

STB2280 • STB2290

20
550 IF (ISNBR(I)-IAU7) ) 560»610»560

560 N=ISNBR(I)

DO 580 J=lf26

IF (N-IA(J)) 580»570»580

570 M=J

GO TO 590

580 CONTINUE

GO TO 610

590 N=LNGTH(M)

DO 600 J=1»N

KNTR=KNTR+1

IF (KNTR-132) 600»600»1120

600 IBUFR(KNTR)=ISTRNG(M»J)

610 1=1+1

IF (IFNBR(D) 620»9l0f620

620 IF (IFNBR(I)-JFNBR(L)) 520r640»630

630 IF (L-30) 930»520»520 C CHECK TO SEE IF FIELD REPLACEMENT IS REQUIRED.

6«*0 LCO=JCOL(L)

IF (JCAR(L)-81) 650»660»680

650 LCA=JCAR(L)

IF (IA(LCA)-IB(LCO)) 810»820»810

660 DO 670 J=l»26

STB2300

STB2310

STB2320

STB2330

STB2340

STB2350

STB2360

STB2370

STB2380

STB2390

STB2400

STB2410

STB2420

STR2430

STB2440

STB2450

STB2460

STB2470

STB2480

STB2490

STB2500

STR2510

STB2520

IF (IB(LCO)-IA(J)) 670»820»670

670 CONTINUE

GO TO 810

680 IF <JCAR(L)-83) 690»710»740

690 DO 700 J=27»36

IF (IB(LCO)-IA(J)) 700»820»700

700 CONTINUE

GO TO 810

710 IF (IB(LC0)-IA(47) ) 720r810»720

720 DO 730 J=lr36

IF (IB(LCO)-IA(J)) 730»810f730

730 CONTINUE

GO TO 820

71+0 IF (JCAR(L)-85) 750*770*790

750 DO 760 J=l»26

IF (IB(LCO)-IA(J) ) 760»810»760

760 CONTINUE

GO TO 820

770 DO 780 J=27.36

IF (IB(LCO)-IA(J)) 780»810»780

780 CONTINUE

GO TO 820

790 DO 800 J=l»36

IF (IB(LCO)-IA(J)) 800»810»800

800 CONTINUE

GO TO 820

810 L=L+1

GO TO 620

C REPLACE FIELD BY NEW FORMAT.

820 K=l

830 N=KFNBR(L»K)

IF (N) 8U0»860»8i+0

840 NN=ISTRT(N)

NX=NN+IWIDTH(N)-1

DO 850 J=NN»NX

KNTR=KNTR+1

IF (KNTR-132) 850»fl50»1120

850 IBUFR(KNTR)=IB(J)

860 IF (KSNBR(L»K)-IA(17) ) 870»910>870

870 N=KSNBR(L»K)

DO 880 J=l»26

IF (N-IA(J)) 880»890»880

880 CONTINUE

GO TO 910

890 M=J N=LNGTH(M)

DO 900 J=1»N

KNTR=KNTR+1

IF (KNTR-132) 900»900»1120

900 IBUFR(KNTR)=ISTRNG(M» J)

910 K=K+1

IF (KFNBR(LfK)) 830»920»830

920 L=L+1

STB2530

STB2540

STR2550

STB2560

STB2570

STR2580

STB2590

STB2600

STB2610

STB2620

STB2630

STB26U0

STB2650

STB2660

STR2670

STB2680

STR2690

STB2700

STB2710

STB2720

STR2730

STR2740

STR2750

STB2760

STR2770

STR2780

STR2790

STB2800

STB2810

STB2820

STR2830

STR28<+0 STB2850

STB2860

STR2870

STB2880

STR2890

STR2900

STR2910

STR2920

STR2930

STR29U0

STR2950

STR2960

STR2970

STR2980

STR2990

STR3000

STB3010

STB3020

STR3030

STR3010

STR3050

H

ai
c930

940

950

960

970

980

990

100r> loin

I02n

1030

1040

105n

1060

c107n

108n

109o

1100

111(1 1120

C

C

C1130

1140

1150

1160

117o

1180

1190

1200

1210

1220

123o

124o

1250

1260

127n

128n

129n

130o

GO TO 550

CHECK FOR END OF BLOCK AND END OF PAGE.

L=L+1

GO TO 620

WRITE (IPTAPE.1140) ( IBUFR (JX) .JX=1 »KNTR)

IF (ITEST) 960»950»960

WRITE (IOTAPE»1150) ( IBUFR (JX) »JX=1 »KNTR)

KNTR=0

LINES=LINES+1

IF (LINES) 400»1010f970

IF (IBLK) 400,400*980

IF (IRLK*(LINES/IBLK)-LINES) 400»990»400

IF (IPAG) 1010rl010»1000

IF (IPAG*(LINES/IPAG)-LINES) 1010 » 1040 » 1010

WRITE (IPTAPE.1140) ( IBTX( J) » J=l »80)

IF (ITEST) 1030rl020»1030

WRITE (IOTAPE.1150) ( IBTX ( J) » J=l » 80

)

GO TO 400

WRITE (IPTAPEfll40) ( IPTX ( J) r J=l » 80

)

IF (ITEST) 1060»1050rl060

WRITE (IOTAPE#1150) ( IPTX ( J) » J=l » 80

)

GO TO 400 END LAST PAGE

WRITE (IPTAPE»1140) < IETX ( J) > J=l t 80)

IF (ITEST) 1090»1080»1090

WRITE (IOTAPErll50) ( IETX ( J) t J=l t 80

)

IF (IFND) 1110»1100»1110

END FILE IPTAPE WRITE (IOTAPE.1150) IA (47) » I A ( 5) t IA ( 15) 1 1 A (6)

STOP

WRITE

STOP

100~[

110 J

(IOTAPE»1300)

FORMAT (79H ONLY 30 FIELD SUBSTITUTIONS ARE PERMITTED. THE

1WAS THE 31ST SPECIFIED. ) FORMAT (132A1)

(1X.131A1)

(2613)

(1X.26I3)

(26(I2f AD)

(1X»26(I2»A1)

)

(20H YOU HAVE SPECIFIED. 114 r26H FIELDS, BUT DEFINED ONLY

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

1114)

FORMAT (26H

1LD IS. 113)

FORMAT (18H

FORMAT (11H

FORMAT (82H

STB3060

STB3070

STR3080

STB3090

STB 3 STB3

STB3120

STB3130

STB3140

STB3150

STB3160

STB3170

STB3180

STB3190

STB3200

STB3210

STB3220

STB3230

STB3240

STB3250

STR3260

STR3270

STB3280

STB3290

STB3300

STB3310

STB3320

STB3330

STB3340

STB3350

STB3360

STB3370

STB3380

STB3390

STR3400

ABOVE STB3410

STB3420

STB3430

STB3440

STB3450

STB3460

STB3470

STB3480

rSTB3490

STB3500

YOU HAVE REQUESTED FIELD* 113 » 26H THE LAST DEFINED FIESTB3510

STB3520

THE STRINGS ARE ) STR3530

*** STRING»1I3»13H IS BLANK. S$) STB3540

*** YOU HAVE MORE THAN 26 STRINGS OR YOU FORGOT TO ENDSTB3550

1 THE LIST OF STRINGS WITH A»1A1»10H IN COL. 1) FORMAT (11H THERE ARE»1I3»9H STRINGS ) FORMAT (26H THE LENGTH OF RECORD IS .115)

FORMAT (83H *** THE PROGRAM CAN NOT READ RECORDS SHORTER THAN

1 LONGFR THAN 132 CHARACTERS.)

FORMAT (28H THE SUBSTITUTION CARDS ARE)

FORMAT (12H THERE ARE »H3f20H SUBSTITUTION CARDS.)

FORMAT (73H *** YOU ARE TRYING TO WRITE RECORDS OF MORE THAN 1CHARACTERS. STOP. ) END

STB3560

STR3570

STB3580

1 ORSTR3590

STR3600

STB3610

STB3620

132 STB3630

STB3640

STB3650-

92
APPENDIX II

This Appendix shows how the program in Appendix I was

modified to provide blocked output from the NBS computer.

The subroutine used to take advantage of the buffered tape

write is also listed. These changes should also serve as a

guide for modifying the program for other systems.

23
C TO END THE STRINGS. COL 78 IS USED TO FILL THE LAST RECORD OUTPUT. STB 140 «A

COMMON /A/ ITAPE.IOTAPE.IW.ITEST.ICHK.NSTAB.TABNO.IEND

COMMON /B/ IAT(100).IE(750>

COMMON /G/ IBLEN»IBFR(3000)

COMMON /H/ IPTAPE.IOUT

EQUIVALENCE ( IBFR ( 1 ) . IBUFR ( 1 ) ) . ( I AT ( 1 ) . I A ( 1 )

)

IOUT = 1998 IBLEN = 2995

ICHK = 1 CALL TNPACK(l) READ (ITAPE»1140.END=1100) ( IA ( J) . J=l .80

)

DO 15n0 J = 1.80

K = 81-J

IF (IrTX(K) - IA(47)) 1510.1500.1510

1500 JBTX = K 1510 DO 1530 J = 1.80

K = 81-J

IF (IpTX(K) - IA(47>) 1540.1530.1540

1530 JPTX = K 1540 DO 1560 J = 1.80

K = 81-J

IF (IETX(K) - IA(47>) 1570.1560.1570

1560 JFTX = K 1570 CONTINUE

IF (KNTR-2900) 540.540.1120

IF (KmTR-2900) 600.600.1120

IF (KmTR-2900) 850.850.1120

IF (KmTR-2900) 900.900.1120

910 lw = KNTR CALL REPACK (IWRT. IKOWT)

945 IEND r

IF (ICHK) 960.960,950

1010 IW = JBTX

DO 10?0 J = lr JBTX

1020 IBUFR(J) = IBTX(J)

CALL REPACK (IWRT. IKOWT)

1030 GO TO 400

104-0 IW = JPTX

DO 10<^0 J = l.JPTX

1050 IBUFR(J) = IPTX(J)

CALL REPACK (IWRT. IKOWT)

1060 GO TO 400

c end last page

1070 IW = JETX

DO lOftO J=1.JETX

1080 IRUFR(J) = IETX(J)

CALL REPACK (IWRT, IKOWT)

IF (IKOWT - IOUT) 1094.ln94.1097

1094 JOT = IOUT - IKOWT + 2 DO 10q5 J = l.JOT

IBUFR(J) = IA(78)

IW = J

IF (J-2000) 1095.1095.1096

1095 CONTINUE

1096 CALL REPACK (IWRT.IKOWT)

IF (IKOWT - IOUT) 1094.1097.1097

1097 IF (IwRT) 1098.1098.1090

109fl IF (IwRT + 2) 1099,1099.1097

1099 WRITE (IOTAPE.1600) IWRT

1600 FORMAT (44H NTRAN WRITE ERROR ON LAST RECORD. STATUS = .15)

1090 IF (IEND) 1110.1100.1110

STB 681

STB 682

STB 683

STB 684

STB 685

STB 686

STR 687

STB 688

STB 689

STB 730 • C

STB

STB

971

972

STB 973

STB 974

STB 975

STB 9755

STB 976

STB 9765

STB 977

STB 9775

STB 978

STB 9785

STB 979 _ STB2280 • E STB2410 • F

STB2890 • G

STB3010 • H

STB3200

STR3210

STB3215

STB3220

STB3230

STP3235

STR3240

STB3250

STR3260

STR3270

STB3280

STB3282

STB3284

STB3286

STR3288

STB3290

STB3294

STB3298

STB3300

STR3302

STB3304

STB3306

STB3308

STB3310

STB3312

STB3314

STB3316

STB3318

STB3320

J

24
BIT FOR REPAKtREPAK

SUBROUTINE INPACK (IK)

COMMON) /A/ ITAPE»IOTAPE»ICHAR» ITEST, ICHK»NSTAR»TABNO»IEND

COMMON /B/ IA(IOO) tIE(750)

COMMON /G/ IBLEN»ISTRIN(3000)

COMMON /H/ IPTAPErlOUT

DIMENSION IWORDS(IOOO)

K^IK

I0PT=T0UT/6

IF (IoUT-6*I0PT) 10»20»10

WRITE (IOTAPE»230) IOUT

STOP

RETURm

ENTRY REPACK (IWRTrlKOWT)

IF (IwRT) 40»60>60

IF (IwRT+2) 50»50»30

WRITE (IOTAPE»240) IWRT

IF (K-IOUT-D 150#90»70

Kl=l

K2=K/6+l

K3=I0PT+1

DO 80 J=K3»K2

IWORDq(Kl)=IWORDS(J)

K1=K1+1

K=K-InUT

IF (K-IOUT-1) 150»100»10f)

CALL nTRAN (IPTAPE»l»IOPT»IWORDS»IWRT)

IF (ITEST) 110.30,110

DO 140 I=l,I0PTr21

J=I+20

IF (J-IOPT) 130,130,120

J=IOPT

(IWORDS(L) ,L=I,J)

10

20

30

40

5060

70

80

90

100

110

120

130

140

150

160

170

180

190

200

210

220

C 230

240

250

260

WRITE (IOTAPE,250)

CONTINUE

NREC=nREC+1

WRITE (IOTAPE,260) NREC , IOUT, ICHAR, IOPT,K

GO TO 30 DO 16n 1=1, ICHAR

IK=I+K-1

J=IK-((IK-l)/6)*6

IZ=(lK-l)/6+l

FLD(6*(J-1) ,6,IW0RDS(IZ) ) =FLD ( » 6 , ISTRIN ( I )

)

CONTINUE

K=K+ICHAR

IKOWT=K

IF (K-IOUT-1) 220.170*170

CALL mTRAN (IPTAPE,l»IOPT»IWORDS,IWRT)

IF (ITEST) 180,220,180

DO 210 I=1,I0PT,21

J=I+20

IF (J-IOPT) 200,200,190

J=IOPT

WRITE <IOTAPE,250) ( IWORDS (L) ,L=I » J)

CONTINUE

NREC=NREC+1

WRITE (IOTAPE.260) NREC > IOUT, ICHAR , IOPT,K

RETURm

FORMAT

FORMAT

FORMAT

FORMAT

1,6110) END

(1X»44H OUTPUT WIDTH NOT

(29H NTRAN WRITE ERROR.

(1X,21A6)

(17H ABOVE IS REC0RD»1I5,6H

AN EVEN NUMBER OF WORDS

STATUS = .111)

,116

IT IS,1I5,17H CHARACTERS LONG

RPC 20

RPC 30 RPC 40

RPC 50

RPC 60

RPC 70 RPC 80

RPC 90

RPC 100

RPC 110

RPC 120

RPC 130

RPC 140

RPC 150

RPC 160

RPC 170

RPC 180

RPC 190

RPC 200

RPC 210

RPC 220

RPC 230

RPC 240

RPC 250

RPC 260

RPC 270

RPC 280

RPC 290

RPC 300

RPC 310

RPC 320

RPC 330

RPC 340

RPC 350

RPC 360

RPC 370

RPC 380

RPC 390 RPC 400

RPC 410

RPC 420

RPC 430

RPC 440

RPC 450

RPC 460

RPC 470

RPC 480

RPC 490

RPC 500

RPC 510

RPC 520

-PC 530

RPC 540

RPC 550

RPC 560

RPC

) 570

RPC 600

.-PC 610

RPC 620

RPC 630-

it U.S. GOVERNMENT PRINTING OFFICE: I 973--5<»2-651 /93

26
FORM NBS-114A U-71)

2. Gov't Accession No.U.S. DEPT. OF COMM. BIBLIOGRAPHIC DATA

SHEET

1. PUBLICATION OR REPORT NO. NBS TN-7403. Recipient's Accession No.

4. TITLE AND SUBTITLE

SETAB : An Edit/Insert Program for Automatic Typesetting of

Spectroscopic and other Computerized Tables

5. Publication Date December 1973

6. Performing Organization Code

7. AUTHOR(S)

Robert C. Thompson and Joseph Filsenrath

8. Performing Organization

10. Project/Task/Work Unit No. 1510109

9. PERFORMING 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 Pinal

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.)

SETAB is a FORTRAN Drogram which accepts a card deck or Fortran records on magnetic

tape and inserts the appropriate flags and shift symbols required by many programs

associated with phototypesetting devices. The program is specialized to the

particular application, the phototypesetter and typography programs, and to the

desired typefaces by means of Darameter cards supplied at run time. Examples are shown of spectroscopic tables typeset on the Linofilm phototypesetter at the

Government Printing Office using the Autoset Typography Program. The program has

also been used for tables of other types of data. The program can handle any

records which can be read by a FORTRAN "READ" statement under "A" format control.

The original record can be divided into as many as 40 fields and these fields can

be combined in any order with any of 26 strings in front of or between the pieces.

The program will, on a signal, replace a field by another field or by a combination

of fields and strings. The output lines are blocked and paged via the insertion

of the required strings between blocks and pages.

17. KEY WORDS (Alphabetical order, separated by semicolons) , , ... ,. , . , . Automatic typesetting, computer-assisted typesetting; edit insertion program;

FORTRAN program; phototypesetting of spectroscopic tables; typesetting of tables.

18. AVAILABILITY STATEMENT

[~Xl UNLIMITED.

I I FOR OFFICIAL DISTRIBUTION. DO NOT RELEASE

TO NTIS.

19. SECURITY CLASS

(THIS REPORT)

UNCLASSIFIED

20. SECURITY CLASS

(THIS PAGE)

UNCLASSIFIED

21. NO. OF PAGES

30

22. Price $0.55

USCOMM-DC 66244-P71
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 (Section A)

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, $17.00; Foreign, $21.25.

• Mathematical Sciences (Section B)

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, $9.00; Foreign,

$11.25.

DIMENSIONS, NBS

The best single source of information concerning the Bureau's measurement, research, developmental, co- operative, and publication activities, this monthly

publication is designed for the layman and also 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, $6.50; Foreign, $8.25.

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 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 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.

BIBLIOGRAPHIC SUBSCRIPTION SERVICES

The following current-awareness and literature-survey bibliographies are issued periodically by the Bureau

Cryogenic Data Center Current Awareness Service (Publications and Reports of Interest in Cryogenics).

A literature survey issued weekly. Annual subscription: Domestic, $20.00; foreign, $25.00.

Liquefied Natural Gas. A literature survey issued quarterly. Annual subscription: $20.00. Superconducting Devices and Materials. A literature survey issued quarterly. Annual subscription : $20.00. Send subscription orders and remittances for the preceding bibliographic services to the U.S. Department

of Commerce, National Technical Information Service, Springfield, Va. 22151. Electromagnetic Metrology Current Awareness Service (Abstracts of Selected Articles on Measurement

Techniques and Standards of Electromagnetic Quantities from D-C to Millimeter-Wave Frequencies). Issued monthly. Annual subscription: $100.00 (Special rates for multi-subscriptions). Send subscription order and

remittance to the Electromagnetic Metrology Information Center, Electromagnetics Division, National Bureau

of Standards, Boulder, Colo. 80302. Order NBS publications (except Bibliographic Subscription Services)

from: Superintendent of Documents, Government Printing Office, Washington, D.C. 20402.
U.S. DEPARTMENT OF COMMERCE

National Bureau of Standards

Washington. D.C. 20234

OFFICIAL BUSINESS

Penalty for Private Use, $300

POSTAGE AND FEES PAID

U.S. DEPARTMENT OF COMMERCE COM-215

9 8