Ref.

NBS TECHNICAL NOTE 590

A Preliminary Design of a Data

Retrieval Language to Handle

a Generalized Data Base: DRL
NATIONAL BUREAU OF STANDARDS

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

technology and facilitate their effective application for public benefit. To this end, the Bureau conducts research and provides: (1) a basis for the Nation's physical measure- ment system, (2) scientific and technological services for industry and government, (3) a technical basis for equity in trade, and (4) technical services to promote public safety.

The Bureau consists of the Institute for Basic Standards, the Institute for Materials

Research, the Institute for Applied Technology, the Center for Computer Sciences and

Technology, and the Office for Information Programs.

THE INSTITUTE FOR BASIC STANDARDS provides the central basis within the United States of a complete and consistent system of physical measurement; coordinates

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

Radiation2—Nuclear Radiation2—Applied Radiation2—Quantum Electronics3—

Electromagnetics3—Time and Frequency3—Laboratory Astrophysics3—Cryogenics3

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

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

Government; provides advisory and research services to other Government agencies;

and develops, produces, and distributes standard reference materials. The Institute consists of the Office of Standard Reference Materials and the following divisions: Analytical Chemistry—Polymers—Metallurgy—Inorganic Materials—Reactor

Radiation—Physical Chemistry.

THE INSTITUTE FOR APPLIED TECHNOLOGY provides technical services to pro- mote the use of available technology and to facilitate technological innovation in industry and Government; cooperates with public and private organizations leading to the development of technological standards (including mandatory safety standards), codes

and methods of test; and provides technical advice and services to Government agencies

upon request. The Institute also monitors NBS engineering standards activities and

provides liaison between NBS and national and international engineering standards

bodies. The Institute consists of the following technical divisions and offices: Engineering Standards Services—Weights and Measures—Flammable Fabrics

Invention and Innovation—Vehicle Systems Research—Product Evaluation

Technology—Building Research—Electronic Technology—Technical Analysis

Measurement Engineering.

THE CENTER FOR COMPUTER SCIENCES AND TECHNOLOGY conducts re- search and provides technical services designed to aid Government agencies in improving cost effectiveness in the conduct of their programs through the selection, acquisition,

and effective utilization of automatic data processing equipment; and serves as the principal focus within the executive branch for the development of Federal standards for automatic data processing equipment, techniques, and computer languages. The Center

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

THE OFFICE FOR INFORMATION PROGRAMS promotes optimum dissemination

and accessibility of scientific information generated within NBS and other agencies of

the Federal Government; promotes the development of the National Standard Reference

Data System and a system of information analysis centers dealing with the broader

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

that the NBS staff has optimum accessibility to the scientific information of the world,

and directs the public information activities of the Bureau. The Office consists of the following organizational units: Office of Standard Reference Data—Office of Technical Information and

Publications—Library—Office of Public Information—Office of International

Relations.

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

2 Part of the Center for Radiation Research.

3 I nr-ateH at TtnnMpr Tnlnrarin 80302
ML BUREAU Of STANDARD

P 2 1 1971

.-\ UNITED STATES DEPARTMENT OF COMMERCE

Maurice H. Stans, Secretary

D $ NATIONAL BUREAU OF STANDARDS • Lewis M. Branscomb, Director

hi

v NBS TECHNICAL NOTE 590

ISSUED JULY 1971

Nat. Bur. Stand. (U.S.), Tech. Note 590, 26 pages (July 1971)

CODEN: NBTNA

A Preliminary Design of a Data Retrieval

Language to Handle a Generalized Data Base: DRL

Elizabeth Fong

Systems Development Division

Center for Computer Sciences and Technology

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.

(Order by SD Catalog No. C 13.46:590). Price 35 cents. Stock Number 0303-0886
TABLE OF CONTENTS

I. INTRODUCTION 2

II. BRIEF DESCRIPTION OF LANGUAGE 3

II. 1 Input/Output Commands 4

II. 2 Data Description Commands 7

11.

3

Data Maintenance and Manipulation Commands 9

11.

4

Data Retrieval Commands 11

11.

5

Higher Order Functions 13

11.

6

Built-in String Manipulation Functions 14

III. METHOD OF IMPLEMENTATION 14

IV. OPERATION 18

V. REFERENCES 18

Appendix A

A Sample Run of DRL A_1

II
A PRELIMINARY DESIGN OF A DATA RETRIEVAL LANGUAGE

TO HANDLE A GENERALIZED DATA BASE: DRL

ELIZABETH FONG

DRL (Data Retrieval Language) is a high-level programming language for information retrieval. The language includes a data description language which can describe fixed- length hierarchical data structures , and

DRL includes a data retrieval statement whereby a user

can retrieve data by specifying conditions on to the

data value. DRL also has an environment declaration

statement in which the user can indicate specific peripheral devices by unit number for files. The rest of the

language consists of an operation repertory of input-output functions and other data manipulations

.

DRL is implemented as a preprocessor to FORTRAN V on the UNIVAC 1108, under EXEC II Operating system. Keywords act as triggers and are replaced by blocks of FORTRAN code.

The purpose of this project is to investigate the

design of an information retrieval language to handle a generalized data base. The DRL system consists of a set

of primitives utilizing both compile-time macros and runtime subroutines. These primitives are embedded in a high-level procedure-oriented programming language—the

"host language" — FORTRAN in this case. These primitives

form a base upon which a class of languages can be defined,

Key words: Data base*, data retrieval*, data structure-,

information storage and retrieval-, language extension;

preprocessor; programming language.
I . Introduction

In implementing an information storage and retrieval system, one

is faced with the problem of choosing a suitable programming language.

Requirements of that programming language are:

ability to define data structures

ability to describe an environment

ability to manipulate data structures

ability to address data by content

ability to offer computational power comparable to FORTRAN.

It is possible to implement information storage and retrieval system

in procedure-oriented language such as ALGOL, FORTRAN, COBOL, or PL/1,

but it is unnatural and requires indirectness in the use of primitives

of the language. For example, let us consider writing a program to

do the following simple task:

Fine the first element of the array A, of length N, whose value

is equal to 3 and set I equal to the value of the index. If

none, set I equal to zero.

In a procedural-oriented language such as FORTRAN, one would say:

DO 10 I = 1,N

IF (A(I) .EQ. 3) GO TO 20

10 CONTINUE

1 =

20 ...
Using languages such as LISP, SNOBOL, L6, etc. , in doing information retrieval seems even more awkward. COBOL has file manipulation

[5] capability but lacks the ability of addressing data by content.

This leads to the notion of addressing data by content, which is more

natural to a user, who is not a professional programmer. Hence the

design of an information retrieval language should be convenient and

natural for the user, yet the language should be powerful enough to

handle complicated types of data structure. Such a language must have

primitives at the level of what is to be done rather than how it is

to be done.

An information retrieval language called DRL (Data Retrieval Language) has been designed and is partially implenented at the National

Bureau of Standards to meet these objectives on an experimental basis.

The DRL language is designed as an extension to FORTRAN explicitely

to include the primitives necessary for an information retrieval language. The language will enable us to investigate the benefits of this

approach to retrieval problems

.

II. Brief Description of the Language

The DRL language is embedded in the FORTRAN V language system on

the UNIVAC 1108 computer. It will allow all the usual FORTRAN capabilities plus the following four classes:

1. Input /Output statements

2. Data description statements

3. Data maintenance and manipulation statements

4. Data retrieval statements
II.l Input /Output Commands

The input /output commands include the peripheral device declaration

and also record accessing commands. The input/output devices permitted

at present are card reader, card punch, printer, magnetic tape and drum.

The logical unit number is the same as FORTRAN V standard table as set

up at National Bureau of Standards, Gaithersburg.

a. ENVIRO

The ENVIRONMENT declaration provides information about the physical

location of the data set associated with a file. This information allows

the preprocessor to determine the method of accessing the data set, and

causes the tape or drum to position at the beginning.

FORMAT

ENVIRO ( <filename >, <logical unit no> )

<filename>: := A FORTRAN variable.

<logical unit no> ::= An integer variable/integer.

Allowable values for the logical unit numbers and their assignments

are listed as follows

:

LOGICAL UNIT ASSIGNMENT

Reread

1 Card reader

2 Printer

3 Card punch

4- Console
5

6

7

-

- 32

33

34

35 and 36

37 and 38

39 and 40

41 and 42

43 and 44

45 and 46

EXAMPLE

Card reader

Printer

Tapes A - Z

Tape (

Tape -

Entire Drum 1300000 to 3777777 (octal)

Lower Half 1300000 to 2537777 (octal)

Upper Half 2540000 to 3777777 (octal)

Lower third 1300000 to 2177777 (octal)

Middle third 2200000 to 3077777 (octal)

Upper third 3100000 to 3777777 (octal)

ENVIRO (PAYR0L, 35)

The above means declaring the entire drum as a mass storage device

for a file called PAYROL.

b. PUTOUT

PUTOUT will write a record currently set up in core onto the indicated peripheral device. Unless a FORTRAN format label is supplied,

the output is assumed to be binary.

FORMAT

PUTOUT ( <where> , {<label> ,} <filename> )

<where>::= peripheral device unit number. It is assumed that

the device is positioned to be written.

<filename>: := A FORTRAN variable.

<label>::= FORTRAN format label. This field is optional
EXAMPLE

PUTOUT (35, PAYROL)

or

PUTOUT (6,100, PAYROL)

100 FORMAT (IX , 22A6)

The first PUTOUT example means write out a record which is

in main storage array PAYROL onto the previously positioned drum. The

second PUTOUT example means write on the printer the record according

to the FORTRAN format statement labeled 100.

c. GETIN

GETIN reads in a record from the indicated peripheral device onto

the record image space in core. Unless a FORTRAN format label is supplied, the input is assumed to be binary.

FORMAT

GETIN ( <where> , {<label> ,}<filename> )

<where>::= peripheral device unit number. It is assumed that.

the device is positioned to be read.

< filenames := A FORTRAN variable.

<label>: := FORTRAN format label. This field is optional

EXAMPLE

GETIN (35, PAYROL)

or

GETIN (5, 100, PAYROL)

100 FORMAT (80A1)
The first GETIN example reads one record from the previouslypositioned drum into the main storage array PAYROL. The second

GETIN example reads from the card reader according to FORTRAN format

statement labeled 100 into the array PAYROL.

II. 2 Data Description Commands

Facility for declaring hierarchically structured data is provided.

The declaration format is patterned after PL/1 where the level of

hierarchy is indicated by the level number in front of the variables

in the declaration. When the variable occurs without the level number

in front, it is assumed that the declaration is merely a. single data

item or an array. To facilitate character manipulation, the string

declaration is added to the FORTRAN type statements.

a. DECLAR CHARAC or BITS

DECLAR with the data type CHARAC means the variable being declared

is a string of n six-bit Fieldata code as defined for the UNIVAC 1108.

DECLAR with the data type BITS means the variable being declared is of

n bits taking on values one or zero.

FORMAT

DECLAR ( <variable> CHARAC ( <n> ))

DECLAR ( <variable> BITS ( <n> ))

<variable> ::= A FORTRAN Variable.

<n> :

: = An integer greater than .

EXAMPLES

DECLAR ( NAME CHARAC (10))

DECLAR ( MATRIX BITS (8))
b. DECLAR hierarchically

DECLAR with a hierarchical data list declares a data structure

consisting of elementary data items (terminal nodes) and composite

data items (non-terminal nodes or meta syntactical variable). The

composite data items must have one or more subordinates and the elementary data items must have data type and size specifications associated with them.

FORMAT

DECLAR ( hierarchical data list> ) hierarchical data list>::= <hierarchical data>/

hierarchical data list>, hierarchical data>

hierarchical data>::= <n> <variable>/

<n> <variable> <type> <dimension>

<type>: := all legal FORTRAN data types (only first six characters) plus CHARAC and BITS

<dimension>: := ( <n> )

<variable> :

: = A FORTRAN variable

<n>::= An integer greater than

EXAMPLE

DECLAR ( PAYROL,

1 NAME

,

2 FIRST CHARAC (10),

2 MIDDLE CHARAC (10),

2 LAST CHARAC (10),

1 SALARY

,

2 REGU INTEGE (1),

2 OVER INTEGE (l),

1 OCC CHARAC (20) )
II. 3 Data Maintenance and Manipulation Commands

a. PUT

PUT assumes a data structure into which values are to be stored.

If the attribute name happens to be an elementary data item, then the

value is simply put in. If the attribute is not an elementary data

item, then the lists of values to fill the attributes subordinate to

it must be given.

FORMAT

PUT ( <attribute>, <value list> )

<attribute>: := elementary data item variable or composite

data item variable as declared in DECLAR

statement

<value list> ::= <value>/<value list>, <value>

<value>: := any expression (The present version can only

handle constants , literals and variables

)

EXAMPLE

The following example assumes the declaration which appears in the

DECLAR hierarchically example given above

.

PUT (LAST, 'FONG'

)

PUT (NAME, 'LIZ', 'NEE', 'FONG')

The first PUT expression whose first argument is the elementary

data item LAST and therefore the value is immediately assigned. In

the second PUT expression the first argument is the composite data item

NAME consisting of three subordinates and therefore the three values

'LIZ', 'NEE', and 'FONG' are assigned to FIRST, MIDDLE and LAST respectively .
b. LOCATE

Records within a file have an ordinal number according to their

position within the file. LOCATE positions the file with respect to

this ordinal number of the record.

FORMAT

LOCATE ( <filename>, <index> )

<filename> : := A FORTRAN variable defined in ENVIRO and

DECLAR statements

<index> : := An integer / An integer variable. If index =

the file is position to the beginning of the file.

EXAMPLE

LOCATE (PAYROL, 5)

LOCATE (PAYROL, IXGET)

c. DELETE AND DELIX

DELETE deletes the first encountered record which satisfies

the given condition list.

DELIX deletes the Nth record in the file where N is given.

FORMAT

DELETE ( <filename> , <condition list> )

DELIX ( <filename >, <index> )

<condition list> : := This is the same as described under the

Get command

<filename> :.:= A FORTRAN variable defined in ENVIRO and DECLAR

statements

<index> ::= An integer / An interger variable

10
EXAMPLE

' The following example assumes the declaration which appears in

the DECLAR (hierarchically) example.

DELETE (PATROL, LAST EQ 'SMITH")

DELIX (PATROL, 5)

II. M- Data Retrieval Commands

a. GET

GET is a retrieval function which returns the value of the

specified attribute in the first encountered record which satisfies

the given conditions.

FORMAT

A - GET ( < filename > , <atbribute> , < condition list> ) <filename> ::= A FORTRAN variable declared in EiWIRO and

DECLAR statements. It is assumed that the

peripheral device is positioned to start searching.

< attribute > ::= Elementary data item variable or complex data

item variable as declared in DECLAR statement.

< condition list > : := < wff >

<wff> ::= <proposition> /< wff>< connect!ves><wff>

<proposition> ::= < attribute><rel><value>

Connectives >: := AND / OR

<rel > : := EQ / NE / GT / GE / LT / LE

<value> : := Any expression

11
EXAMPLE

The following example assumes the declaration which appears in

the DECLAR (hierarchically) example.

A = GET ( PAYROL, NAME, REGU EQ 400 AND OCC EQ 'MATH' )

This GET command will search the PAYROL file. If the field REGU

equal 400 and the field OCC equals MATH, then the field NAME will be

retrieved and stored in A. A must be properly dimensioned.

DEFAULT CONDITIONS

If an error occurs, RUNERR routine is executed. RUNERR is a

routine which may be supplied by the user to handle error recovery. If

the user does not supply a RUNERR routine, the DRL system will execute

the UNIVAC EXEC II error routine which will just stop execution.

REMARK

If there is no second argument of the GET command, i.e., two

commas with nothing in between, then it is assumed that the index value

is required. In any case an internally defined variable called IXGET

will always contain the index value after each GET function. The IXGET

value will be destroyed upon initiation of the next GET function.

b. GETALL

GETALL is the same as GET except instead of retrieving a single

item, a whole set is retrieved. The variable occurring on the left of

the GETALL statement must be pre-declared as one dimensional array with

an estimate of maximum size. After retrieving, the first entry of that

array will contain the count of the number of items retrieved followed

by the values. The user must also DIMENSION the IXGET to be one dimensional array of maximum size. After each execution of GETALL, IXGET (l)

12
contains the count of the number of items retrieved followed by the list

of pointer to the retrieved records

.

II. 5 Higher Order Functions

These functions could be defined by combining appropriate previously defined primitive functions.

a. REPLACE

REPLACE may be defined by combining the following four DRL primitives .

GET - get a whole record that meets given conditions

PUT - change value as desired

LOCATE - position back

PUTOUT - put back the modified record in the file.

b. SUBSET

SUBSET may be defined by the following pseudo statements.

ENVIRO - declared a different unit number for a subfile

10 GET - get a record that meets the given conditions

IF end-of-file THEN stop

PUTOUT - putout on the new unit

GO TO 10

An alternative way of defining assumes the existence of the primitive MOVE. This may be defined as a user's subroutine.

ENVIRO - declare a different unit number for a subfile

GETALL - get all records that meets the given conditions

MOVE - move to individual buffers for a unit record

PUTOUT - putout on the new unit.

13
c. COUNT

COUNT may be defined with the GETALL command and reading out the

first word of the IXGET array or the user-defined array containing the

answers

.

II. 6 Built-in String Manipulation Functions

There exists in the DRL system a group of run-time subroutines

which are accessible to the user. The following is a set of string

i.e., characters manipulation functions which are patterned after PL/1.

The string variables must be declared as characters in a DECLAR CHARAC

statement.

CONC (A.B) is the concatenation of string A and B.

LENGTH (A) is the length of string A.

INDEX (A, ' B' ) returns the starting location for the first occurrence of ' B' in string A or zero if not found.

SUBSTR (A, I, J) extracts the substring starting at position I of

length J. If J equals the rest of String A is

returned.

MATCH (A,B,N) compares the first N characters of A to B. If they

are identical, the value of MATCH is true, otherwise

the value of MATCH is false.

III. Method of Implementation

The DRL language translator is a preprocessor to FORTRAN V on the

UNIVAC 1108. It consists of two major phases:

Phase 1 - A scanner reads the input stream and traps all the DRL

keywords and replaces them with appropriate blocks of FORTRAN code.

14
The declarative statements generate FORTRAN dimensioning statements

and tables containing the data descriptions.

Phase 2 - A collection of predefined run-time subroutines to perform all of the above described tasks.

Both phase 1 and phase 2 work. All of the primitives defined

above have been implemented. The higher order functions have not been

implemented.

The main routine is the lexical scanner called LSCAN. This routine reads the DRL statements and branches according to the keywords

scanned. The DRL syntax conforms to the FORTRAN statement format. If

a given statement does not contain a DRL keyword, then it is assumed to

be a FORTRAN statement, and the line is carried over to the generated

program. The DRL keyword analysis is described individually as follows:

a. DROP - This should be the first statement of the DRL program.

The operand of this statement defines a name for the output

FORTRAN source.

b. ENVIRO - This statement generates the equivalent of an open

file statement by positioning the peripheral device indicated

by the unit number to the beginning. The file name is entered

into the FILNAM table.

15
Layout of FILNAM table

FILNAM

{

FPOINT

FILENAME

Unit no. block size

pointer to next empty entry

c. DECLAR - This generates FORTRAN DIMENSION statements. If it is

hierarchical data declaration, then it generates DIMENSION

statements and EQUIVALENCE statements for all the complex data

item names. Also the hierarchical data information is stored

in the 8- column matrix J. The meaning of these 8 columns are

as follows: J(I,1) contains the hierarchical level number

J (1, 2) contains the BCD symbol table index number

J (1, 3) contains the degree or number of subtrees

of that node

J (1, 4) contains the index no. of the parent node

J(I,5) contains the index no. of the sister node

J (1, 6) contains the next occupant of the same name

J(I,7) contains the size in characters

J(I,8) contains the starting character position

from the beginning.

The details of the J-matrix can be found in Lawson [2].

The variable names are also entered into the SYMBOL table.

Layout of SYMBOL table

SYMBOL

Type = 1 means character

Type = 2 means BITS

Type = means other

SIZE = no. of characters or bits.

SPOINT

SYMBOL in BCD

Type Size Index

to J

i

i

Pointer to next

available entry

16
d. PUTOUT - This generates an appropriate output statements including calls to NTRAN if the output is to be binary. NTRAN is a

FORTRAN callable subroutine which provides buffered input/output

routines for tape and drum. Detailed description of NTRAN can

be found in section 7.5 of the UNIVAC 1107 FORTRAN manual [3].

e. GETIN - This is the same as PUTOUT except it generates appropriate output statements

.

f. GET - This will first generate a NTRAN call to read in a record.

A boolean function containing the conditions given is next generated. On the 'true' branch the extraction of the specified

attribute code is supplied. On the 'false' branch, a GOTO statement back to the NTRAN call to read in the next record is generated .

g. GETALL - Same as GET except a loop is set up to continuing retrieving until an end of file is reached.

h. PUT - This will generate a DO Loop containing a call to a runtime routine called MOVECH. MOVECH will move a character from

the indicated source to the indicated destination.

i. LOCATE - This will generate a NTRAN call to position the

peripheral device N records from the beginning. If the device

is drum, the drum address is positioned from the beginning by

the amount N times the length of the record.

j. DELETE - (This command is to be used primarily with drum) This

statement will first call GET to determine which record meets

the conditions given. Then it calls LOCATE to position the file

to this record. The record is then zeroed. Garbage collection

17
is not yet coded,

k. DELIX - (This command is to be used primarily with drum). This

first calls LOCATE to position the file to the Nth record, and

the record is zeroed.

IV. Operation

The input to the DRL translator is the program text written in the

DRL language. The output is a FORTRAN program automatically residing on

the drum, linked-edited, and ready to be executed. This output FORTRAN

program, together with the predefined run-time action routines and block

data, will be the final executable program capable of manipulating data,

accessing the peripheral storage and performing any kind of retrieval

tasks. This present version consists of approximately 1900 lines of

FORTRAN and approximately 300 lines of UNIVAC assembly code.

The source listing of the entire DRL system is available from the

author upon request.

The author is deeply indebted to Mr. Charles T. Meadow for first

suggesting the topic and for his interest throughout the implementation.

V. References

[1] UNIVAC 1108 FORTRAN V- Programmer ' s Reference Manual UP4060, Sperry

Rand Corporation, 1966.

[2] Lawson, Harold W. , Jr., "The Use of Chain List Matrices for the

Analysis of COBOL Data Structures," presented at the ACM National

Conference, 1962.

[3] UNIVAC 1107 FORTRAN IV - Programmer's Reference Manual, UP-3569,

Sperry Rand Corporation, 1966.

O] IBM System/360 PL/1 Reference Manual, File No. S 360-29, Form No.

C 28-8201-1, IBM 1968.

[5] Hanlon, A.G. , "Content - Addressable and Associative Memory

Systems - A Survey" , IEEE Transaction on Electronic Computers

,

vol. EC-15, No. 4, August, 1966.

18
APPENDIX A — A Sample Run of DRL

In this appendix, the following three outputs are presented:

(1) DRL sample program. These DRL statements are translated into

FORTRAN codes which appear indented to the right. The data description table , symbol table , and file name table are generated as FORTRAN

assignment statements.

(2) FORTRAN compilation of the DRL generated program.

(3) Execution of the sample program. The sample program reads

in from the card reader a file of personnel records. It sets up

the data base on drum. Two retrieval commands are executed.

DROP ABC ENVIRO (p

DECLAR (0 PATROL,

X - 1 NAME,

IMPLICIT INTEGER (A-7)

CALL NTRANI 35, 10 |

2 FIRST CHARAC ( |2| , 2 MIDDLE CHARAC ( 12)

,

2 LAST CHARAC (121,

1 SALART,

2 REGUL<* INTEGE ( 1 I , 2 OVER INTEGE ( I | I DIMENSION PATROL 9)

EQUI VALENCEINAHE , PAToOLI

EQUI VALENCEIFIRST , PATROLI

EQUI VALENCEIMIOOLE, PATROL) EUUIVALENCEILAST , PATROLI E8UIUALENCEISALART, PATROL] EQUIVALENCEIREGULR, PATROL)

EQUI VALENCEIOVER , PATROLI COMM0N/MATRIX/IND,ILIM.SP.J(5O,8, C0MM0N/STABLE/STMB0L(200l,FILNAM(2nI

LOGICAL TESTRL

GO TO I CONTINUE

II* DECLAR UNS CHARAC 136)1

12« AN5 [7I«1

13* DO 600 1-1,7

|4« GETIN (5,500,PaTR0i I

15* SOO FORMAT ( 3 I A& ( AH 1 , 2 I 6 , A6 I

16" PUTOUT 16,501

,

PATROLI

17» 501 FORMAT (IX, >N»HE.i, 3IA6.A1]

18* PUTOUT (35, PATROLI

0IMENS10N ANS ( 71

ANS (7).'

DO 600 1-1,7 READ (5, 500) PATROL

5n0 FORMAT I3(A6,A1), 216, A61 WRITEI6, 5011 PATROL

, • REG"', 16, ' OVER-', 16] 601 FORMAT | IX a 'NAHE"', 3IA6.A4),

ST-1 CALL NTRAN ( 35,1, 9, CALL CHECKS (ST, » 31 GO TO H

J "RITE (6, 5]

5 FORMAT ( IX, 1 1HEN0 OF FlLEI CALL RUNERR

1 CONTINUE

Patrol, st i

600 CONTINUE

LOCATE (PATROL, 0] ANS-GET [PATROL, N

6n0 CONTINUE

NTRANf 35, 101

35,2,

CALL E.LAST EQ *LEAR' I IXGET-0

ST=1

ANS ( 1

) -0

6 ixget"ixget*1

call ntrani

call checks (st, s 71 if ( testrli 1

, 'last

GO TO 6

8 CALL SUBSTR1PATR0L, 9,

7 CONTINUE

PUTOUT (6. 502, ANSI *RITE(6, 502) FORMAT (IHO.lX, 'NiME WHERE LAST EQ LEAR = ', 7A6I

PAvROL.STI

, *LEAR» ) >GOTO

6, ANS ,

ANS

502 LOCATE (PATROL, 0) ANS"GET(PATROL,NAMF.REGULR GT 7001

FORMAT ( 1H0 , 1

X

CALL NTRANI

• NA HHERE LAST EQ LEAR

35, 10)

PATROL. ST I

I IGOTO

ANS .

I XGET-0

ST.l

ANS ( 1 1*0

9 IXGET"IXGET»1

CALL NTRANI 35,2, 9, CALL CHECKS (Si. * 101

IF ( TESTRL(3,'REGULR' ,REr.ULR,700

GO TO 9

11 CALL 5UBSTRIPATR0L, 9, 1, 36,

10 CONTINUE

PUTOUT (6,503,ANS| WR1TEI6, 503) ANS FORMAT I IHQ,|X,*NAh£ SHERE REG GT 700-', 7A6) 5n3 FORMAT ( I HO , I X

,

• N AME WHERE REG Gt 700«», 7A6I STOP STOP ANS-GETALL ( PA YROL . NAME , OVER GT 5001

1-1 IXGET-0

ST.l ANS I I )-0

12 IXGET-IXGET.,1 CALL NTRANI 35,2. 9, PATROL, ST I CALL CHECKS (ST. S 13)

IF I TESTRLI3, 'OVER >.OVfR .500 IIGOTO

GO TO 12

I 4 CALL SUBSTRIPAYROL , 9, 1, 36, ANS (!• ANS (11= ANS (11*1

13 CONTINUE

END STOP CONTINUE

IL1M - 10

J ( 1 1 J I 21 . 2 J ( 3) . 2 J ( 11

J I 51 I 9

J 1 61 > iH.3,-,5,,3

J 1 71 > HS

J I 81

J ( 2 1 1 ' 1 J ( 2 2) . *) J I 2 31 3
BEFORE CALLING DRUM BKITE DRUM *RITE CALLED

J ( J ( SYM80LI

SYMBOL! SYMBOL ( SYMBOL!

SYMBOL!

SYMBOL! SYMBOL ! SYMBOL!

SYMBOL!

SYMBOL! SYMBOL 1 SYMBOL! SYMBOL 1 SYMBOL ( SYMBOL!

SYMBOL! SYMBOL I SYMBOL [ SYMBOL!

SYMBOL! SYMBOL ( SYMBOL!

FILNAMI

FILNAMI

FILNAMI FILNAMI

SO YO END

9)

1 I

I I I 12)

131

II I 151 161

171

IB)

19) 20)

21 ) 22)

6HesgesS

1212

6HB63B3i

1221

I 12

I iHSBsSgs

12

106Hseesas

36 6H8B0BBQ

6HPAYR0L

6HBSB0BC

6HNAME iHseees]

6HFIRSY 6H8[aGS» 6HMID0LE

6HSCB6BJ

6HLAST 6H8C8G8

6HSALARY 6H88SASA

6HREGULR

6HB88A8B

6H0VER iHsesusc

6HANS 6H8C8»BD

4H0UMMY 6H8S88SE iHBBSBBS

6HBB8BBA

6HPAYR0L

6H8B<880 4HSBBSB9

DRUM KRlTE CALLED
BIT FOR,. I8C,>B[ UNIVAC HOB FORTRAN V LEVEL 22n* 0018 FSolt THIS COMPILATION "AS DONE ON 03 JON 71 AT |1:

MAIN PROGRAM

STORAGE USED (BLOCK, NAME' LENGTH)

0001 -CODE 000513

0000 .DATA 000112

0002 .BLANK 000000

0003 MATRIX 000623

0004 STABLE 000331

EXTERNAL REFERENCES (BLOCK, NftMEl

OOOS NTRAN

0006 TESTRL

0007 CHECKS

0010 RUNERR

001 1 SUBSTR

0012 NRDUS

0013 V 10 1 5 0011 NI02S

0015 lAQUS 0016 NSTOPS

STORAGE ASSIGNMENT FOR VARlABlES (BLOCK, T TpE, RELATIVE LOCATION. NAMEI

0001 000210 10L 0001 000200 ilL OnO I n0n2ll I2L 0001 OOnQln 121G 0001 000016 130G 0001 000030 137G 0001 000257 11L 0001 000136 1756

0001 000216 220G 000 1 000052 3L 0001 000061 1L 0000 000027 5F 0000 000016 5olF 0000 000037 S02F 0000 000050 503F 0001 000072 6L 0001 000120 8L 0001 000152 9L 0000 I OOOOoO ANS 0001 I 000310 FILNAM

0000 I 000007 I 0003 I 000001 ILIH 0003 I OOOOoO IND 0000 I 000012 IXGET 0003 I 000003 J 0000 I 000061 LAST 0000 00006 1 MIDDLE 0000 000061 NAME 0000 I 000061 OVER 0000 1 000061 PATROL 0000 I 000061 REGULR 0000 00006! SALART OOo3 1 000002 SP 0000 I 000011 ST 0001 1 OOOOOO STHBOL 0006 L OOOOOO TESTRL

0001 000277 1L 0001 000275 13L 0001 000005 2L 0000 000013 500F

0001 000130 7L 0000 000061 FIRST

0000 1 000010 IS

00101 l» implicit integer ia-zi 00103 2" CALL NTRANi 35, 10 1 00101 3. DIMENSION PATROL ( 9] 00105 1. 001D5 5. EouIVALENCEiNAME , F.YROLI 00106 6. EOUI VALENCElFIRST , PATR0L1

00107 7. EQuI VALENCEIMIDDLE , PATROLI

001 10 a. E0U1VALENCEILA5T , PATROLI

001 1 1 ?• EOUI VALENCEcSALART, PATROL)

001 12 10* E8UI VALENCElREGULR, PATROL)

001 13 i i« Eoul VALENCE(0VER PATROL)

00111 12. COMMON/HATRlX/IND,lLIM,sP,J(SO,B»

001 IS 13. C0BM0N/STABlE/5TMB0L(200I,FILNAM(20I

001 16 11« LOGICAL TESTRL

00117 IS* GO TO 1 00120 I6> 2 CONTINUE

00121 17. DIMENSION ANS I 71 00122 IS* 00122 19. ANS (71"' 00123 20* CO 600 1=1.7 00126 21" READ (5, 500) PATROL

00131 22. 500 FORMAT |3(A(,,A41, 216, A*) 00135 23. •RITEI6, SOU PATROL

00113 21. 501 FORMAT (IX, 'NAME.', 3IA6.A1I, • REG- 1, 16 , • ovEl 00111 25. ST.l 00115 26. CALL NTRAN , 35,1, 9, PATROL,,ST| 00116 27. CALL CHECK5 (ST, J 3] 00117 28" GO TO 4 00150 29. 3 *RITE <6 . 51 00152 30. 5 FORMAT! IX, 1 iHEHD OF FILE 1 001S3 31. CALL RUNERR

00151 32« 1 CONTINUE

00155 33. 600 CONTINUE

00157 31. CALL NTRAN( 35, 101 00160 35" IXGET.O

00161 36. ST.l 00162 37. ANS (1)»0 00163 38. 6 IXGET.IXGET. 1 00161 39. call ntrani 35,2, 9, patrol,,ST| 00165 10* CALL CHECKS 1ST, S 71 00166 11. IF ( TESTRL! 1 , "LAST '.LAST ,'LEAR'1 1 IGOTO 00170 12" GO TO 6 00171 13. 8 CALL SUBSTR (PATROL . 9, 1, 36, ANS , 00172 11. 7 CONTINUE

00173 15. •R1TEI6, 5021 ANS 00201 16* 502 FORMAT (1H0.1X, *NAME »hERE LAST EQ LEAR '1 , 7A6) 00202 17. CALL NTRANI 35, 101 00203 ie. IXGET.O

00201 19. ST=1 00205 so. ANS (11=0 00206 51. 9 IXGETal XGET.I 00207 52. call ntrani 35,2. 9, patrol ,ST) 00210 53. CALL CHECKS 1ST. S In) 0021 1 51. IF ( TESTRL ( 3

, 'REGuLR*

,

REGULR 700 1 )G0T0 00213 55. GO TO 9 00211 56. 1 1 CALL SUBSTR (PATROL , 9, 1, 36, ANS , 00215 57. 10 CONTINUE

00216 58" •R1TE16, 5031 ANS 00221 59. 503 FORMAT I IHO^ I X , *NAME A'HEPE REG GT 700=*, 7A6) 00225 60* STOP

00226 •Dl AGN 0ST1C. CONTROL CAN NEVER REACH THE NEXT STATEMENT

00226 61. 1 = 1 00227 62. 1XGET.0 00230 63" ST.l 00231 61* ANS ( 1 1*0 00232 65. 12 IXGETslxGET.I

00233 66* CALL NTRANI 3S,2i 9, PATROL ,ST| 00231 67. CALL CHECKS (ST, S 131 00235 6B. IF 1 TESTRL! 3, "OVER '.OVER .500 ) IGOTO
00237 69. 00210 70. 0021 1 ; i« 00212 72. 00213 73. 00211 71- 00215 75. 00216 76. 00217 77. 00250 78« 00251 79. 00252 80« 00253 81. 00251 62. 00255 83. 00256 81. 00257 85. 00260 86* 00261 87« 00262 88* 00263 89. 00261 90. 00265 91« 00266 92. 00267 93. 00270 91. 00271 95« 00272 96« 00273 97. 00271 98. 00275 99. 00276 UO. 00277 01. 00300 02. 00301 03. 00302 01. 00303 05« 00301 06. 00305 07. 00306 08« 00307 09. 00310 10. 0031 1 1 1« 00312 12. 00313 13. 00311 11" 00315 is. 00316 16. 00317 1 7. 00320 18. 00321 19. 00322 20. 00323 21. 00321 22. 00325 23« 00326 21. 00327 25" 00330 26* 00331 127. 00332 28* 00333 29. 00331 30. 00335 31 . 00336 32. 00337 33. 00310 31. 00311 35" 00312 36. 00313 37. 00311 38" 00315 39. 00316 10. 00317 11" 00350 12. 00351 13. 00352 11. 00353 15. 00351 16. 00355 17. 00356 18. 00357 19. 00360 50. 00361 51. 00362 52. 00363 53. 00361 51" 00365 55. 00366 56* 00367 57. 00370 58« 00371 59. 00372 60. 00373 61. 00371 62. 00375 93. 00376 01* 00377 65. 00100 66* 00101 67. 00102 68. 00103 69. 00101 70. 00105 71. 00106 72. 00107 73" 00110 71. 0011 1 75. 00112 76. 00113 77.

0011 1 78. 00115 79. 00116 80. 00117 81 . 00120 82* 00121 83«

60 To 12 CALL SU8STR(PayR0L, A n 5 III' A u 5 I CONTINUE

TINUE

Sy

SYFlL

Fl

FIFlL

MdOL I MHOLl

160LI

M80LI

IlBOLI H80LI

130LI

1B0L1

IrtOLl MBOL ( 180L1 MB0L1

HBOLI M80L'

"BOLI

1B0LI MB0L1

1B0LI HBOLl

130LI M80L ( '130L1 NAM ( NAM! NAM ( NAM (

6Hb09eee

12

&HI3Q0agS

12

106Heseeee 2

36 &H99gbBQ

6HPAYR0L

6HS88QQE

6HNAME 6HQS99U3

6HFIR5T 6H9C9G0I

6HM IODLE

6H'9CSG34 6HLAST 6HQC9GU

6HSALARY 6HUU0A4A

6MREGULR

6HQQ3AQB

6H0VER

6HQaSte,,-3C 6HANS 6H0CO«SD

6H0UHMY 6H0QW&WE

6MSaaQ0A

6HPAYR0L

6H90U«|«S END
PHASE 1 TIME PHASE 2 TIHE PHASE 3 TIME PHASE 1 TIME PHASE 5 TIME PHASE 6 TIME

END Op UNIVAC 1108 FOrTRan

I SEC.

SEC. SEC.

SEC.

i sec.

SEC.

I .DIAGNOSTIC*

TOTAL COMPILATION TIME =

NAME"PAUL NAKE-ZBGIN NEW NAME«TRUMAN E. NAME-PEACE NAME.CRVSTAL S H A N D A NAME-PRAISE GOD NAME»IMA A .

KRfS REG=lOOnOn OVERM2000Q

PRZYBYi'SKI REGo.oiOOO 0VER«I00000

TURNIpsEEO REG* 60000 OVER* 7000 HAPPINESS REGnS20000 OVER=SQ0O0O

LEAR RE6b3S0000 OVER* BAREBOnEs REGb6M0000 0VER«9600Q0

HOGG REG»*t<42SOQ 0VER»80Q000

NAME ftHERE LaST EO LEAR «>CRYST a L

NAME rtHERE REG GT 700»PAUL

SHANDA LEAR

KRCS

i»*: 10:23.791
(FORM NBS-114A (1-71) U.S. DEPT. OF COMM. BIBLIOGRAPHIC DATA

SHEET

1. PUBLICATION OR REPORT NO.

NBS-TN-5 90

2. Gov't Accession No.

3. Recipient's Accession No.

4. TITLE AND SUBTITLE

A PRELIMINARY DESIGN OF A DATA RETRIEVAL LANGUAGE TO HANDLE

A GENERALIZED DATA BASE: DRL

5. Publication Date July 1971

6. Performing Organization Cod<

7. AUTHOR(S) Elizabeth Fong

8. Performing Organization

9. PERFORMING ORGANIZATION NAME AND ADDRESS

NATIONAL BUREAU OF STANDARDS

DEPARTMENT OF COMMERCE

WASHINGTON, D.C. 20234

10. Project/Task/Work Unit No, Project 6406111

11. Contract/Grant No.

12. Sponsoring Organization Name and Address 13. Type of Report & Period

Covered

Final

14. Sponsoring Agency Code

15. SUPPLEMENTARY NOTES

16. ABSTRACT (A 200-word or less factual summary of most significant information. If document includes a significant

bibliography or literature survey, mention it here.) DRL (Data Retrieval Language) is a high-level programming language for informa^

tion retrieval. The language includes a data description language which can descril

fixed-length hierarchical data structures , and DRL includes a data retrieval statement whereby a user can retrieve data by specifying conditions on to the data value,

DRL also has an environment declaration statement in which the user can indicate

specific peripheral devices by unit number for files. The rest of the language con- sists of an operation repertory of input-output functions and other data manipulations .DRL is implemented as a preprocessor to FORTRAN V on the UNIVAC 1108. Keywords

act as triggers and are replaced by blocks of FORTRAN code.

The purpose of this project is to investigate the design of an information re- trieval language to handle a generalized data base. The DRL system consists of a se of primitives utilizing both compile-time macros and run-time subroutines. These

primitives are embedded in a high-level procedure-oriented programming language—the

"host language "--FORTRAN in this case. These primitives form a base upon which a class of languages can be defined.

17. KEY WORDS (Alphabetical order, separated by semicolons)

Data base; data retrieval; data structure; information storage and retrieval;

language extension; preprocessor; programming language,

18. AVAILABILITY STATEMENT

fx] UNLIMITED.

I | FOR OFFICIAL DISTRIBUTION. DO NOT RELEASE

TO NTIS.

19. SECURITY CLASS

(THIS REPORT)

UNCLASSIFIED

20. SECURITY CLASS

(THIS PAGE)

UNCLASSIFIED

21. NO. OF PAGE,

26

22. Price

.35

* U. S. GOVERNMENT PRINTING OFFICE : 1971 481-323/4 USCOMM-DC 66244-P
NBS TECHNICAL PUBLICATIONS

PERIODICALS NONPERlODICALS

JOURNAL OF RESEARCH reports National

Bureau of Standards research and development in physics, mathematics, chemistry, and engineering.

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. 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, $9.50; for- eign, $11.75*. • Mathematical Sciences

Studies and compilations designed mainly for the mathematician and theoretical physicist. Topics in mathematical statistics, theory of experiment design,

numerical analysis, theoretical physics and chemistry, logical design and programming of computers

and computer systems. Short numerical tables. Issued quarterly. Annual subscription: Domestic,

$5.00; foreign, $6.25*. • 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, $5.00; foreign, $6.25*.

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, re- search managers, product-development managers, and

company executives. Annual subscription: Domestic,

$3.00; foreign, $4.00*.

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

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 cooperatively 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, covering

areas of interest to the consumer. Easily understandable language and illustrations provide useful background knowledge for shopping in today's technological marketplace.

NBS Special Publication 305, Supplement 1, Publications of the NBS, 1968-1969. When ordering, include Catalog No. C13. 10:305. Price $4.50;

foreign, $5.75.

Order NBS publications from: Superintendent of Documents

Government Printing Office

Washington, D.C. 20402
U.S. DEPARTMENT OF COMMERCE

WASHINGTON, D.C. 20230

OFFICIAL BUSINESS POSTAGE AND FEES PAID

U.S. DEPARTMENT OF COMMERCE

PENALTY FOR PRIVATE USE, $300