A111D5 t,23TflS

REFEREK

NBS

PUBLICATIONS

\ '^%iilEl,TM.?I^.^°*"DS & TECH R.I.C NBS TECHNICAL NOTE 1167

/A^ All 102623985

U.S. DEPARTMENT OF COMMERCE/National Bureau of Standards

QC

100

.U5753

#1167

1982

A Computer Data Base

System for Indexing

Research Papers
NATIONAL BUREAU OF STANDARDS

The National Bureau of Standards' was established by an act of Congress on 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's technical work is per- formed by the National Measurement Laboratory, the National Engineering Laboratory, and

the Institute for Computer Sciences and Technology.

THE NATIONAL MEASUREMENT LABORATORY provides the national system of

physical and chemical and materials measurement; coordinates the system with measurement

systems of other nations and furnishes essential services leading to accurate and uniform

physical and chemical measurement throughout the Nation's scientific community, industry,

and commerce; conducts materials research leading to improved methods of measurement,

standards, and data on the properties of materials needed by industry, commerce, educational

institutions, and Government; provides advisory and research services to other Government

agencies; develops, produces, and distributes Standard Reference Materials; and provides

calibration services. The Laboratory consists of the following centers:

Absolute Physical Quantities^ — Radiation Research — Chemical Physics —

Analytical Chemistry — Materials Science

THE NATIONAL ENGINEERING LABORATORY provides technology and technical ser- vices to the public and private sectors to address nafional needs and to solve national problems; conducts research in engineering and applied science in support of these efforts; builds and maintains competence in the necessary disciplines required to carry out this research and technical service; develops engineering data and measurement capabilities;

provides engineering measurement traceability services; develops test methods and proposes

engineering standards and code changes; develops and proposes new engineering practices;

and develops and improves mechanisms to transfer results of its research to the ultimate user. The Laboratory consists of the following centers:

Applied Mathematics — Electronics and Electrical Engineering^ — Manufacturing

Engineering — Building Technology — Fire Research — Chemical Engineering^

THE INSTITUTE FOR COMPUTER SCIENCES AND TECHNOLOGY conducts

research and provides scientific and technical services to aid Federal agencies in the selection, acquisition, application, and use of computer technology to improve effectiveness and

economy in Government operations in accordance with Public Law 89-306 (40 U.S.C. 759), relevant Executive Orders, and other directives; carries out this mission by managing the Federal Information Processing Standards Program, developing Federal ADP standards

guidelines, and managing Federal participation in ADP voluntary standardization activities; provides scientific and technological advisory services and assistance to Federal agencies; and

provides the technical foundation for computer-related policies of the Federal Government.

The Institute consists of the following centers:

Programming Science and Technology — Computer Systems Engineering.

'Headquarters and Laboratories at Gaithersburg, MD, unless otherwise noted; mailing address Washington, DC 20234. 'Some divisions within the center are located at Boulder, CO 80303.
A Computer Data Base System

for Indexing Research Papers

Judith T. Calabrese

Lawrence J. Kaetzel

Robert A. Glass

George R. Smith

Center for Building Technology

National Engineering Laboratory

National Bureau of Standards

Washington, DC 20234

**^ '" oo.

U.S. DEPARTMENT OF COMMERCE, Malcolm Baldrige, Secretary

NATIONAL BUREAU OF STANDARDS. Ernest Ambler, Director

Issued October 1982
National Bureau of Standards Technical Note 1167

Natl. Bur. Stand. (U.S.), Tech. Note 1167, 102 pages (Oct. 1982)

CODEN: NBTNAE

Supersedes NBS Tech. Note 1123

U.S. GOVERNMENT PRINTING OFFICE

WASHINGTON: 1982

For Sale by the Superintendent of Documents, U.S. Government Printing Office, Wasfiington, DC 20402.

Price %'i-^o (Add 25 percent for other than U.S. mailing.)
A COMPUTER DATA BASE SYSTEM FOR INDEXING RESEARCH PAPERS

Judith T. Calabrese, Lawrence J. Kaetzel, Robert A. Glass, and George R. Smith

ABSTRACT

This report represents a significant revision to NBS Technical Note 1123

published in 1980. In that report, the Kaetzel, Glass, Smith (KGS) data base

system permitted users to index, edit, classify, and retrieve scientific

research ipaper citations. During the past 15 months, the system was modified

and enhanced. All programs are written in standard FORTRAN VII Level I programming language providing transportability among computer systems. Retrieval

time has been greatly reduced by changing from a sequential access method to

an indexed, directory look-up file structure which allows faster and more

efficient random access. The file structure is machine independent. Because

of the responsiveness of the extract mode, the one-key retrieval is unnecessary

and has been deleted from the revised system. The kejrword mode has been

replaced by the information mode which provides statistics on authors and

keywords. A file maintenance mode has been added to ensure data base integrity. The KGS system has been separated from the larger Publications Data Base

and the select data base mode has been removed. Software has been tailored to

meet KGS users' needs. Overall, the revised system is faster and uses resources

more efficiently than the original data base.

Key words: computer indexing; data base; directory look-up; information

retrieval; interactive processing; random access.

iii
TABLE OF CONTENTS

Page

ABSTRACT lii

LIST OF FIGURES vi

PREFACE vii

1

.

INTRODUCTION 1

2

.

COMPUTER SYSTEM ENVIR0N?4ENT 1

2 .

1

Hardware 1 2.2 Software 2 2.3 Data Base File Structure 2

3

.

MODES OF OPERATION 3

3 .

1

User Mode 3

3.1.1 EDIT Mode 3

3.1.2 EXTRACT Mode 4

3.1.3 INFORMATION Mode 5

3 .

2

File Maintenance Mode 5

4

.

OPERATING PROCEDURES 5

4.1 Activating the KGS Data Base 5 4.2 User Mode 6

4.2.1 EDIT Mode 6

4.2.1.1 APPEND Sub-Mode 6

4.2.1.2 DELETE Sub-Mode 6

4.2.1.3 UPDATE Sub-Mode 6

4.2.1.4 STOP Sub-Mode 7

4.2.2 EXTRACT Mode 7

4.2.2.1 Author Extract Sub-Mode 7 4.2.2.2 Keyword Extract Sub-Mode 7 4.2.2.3 All Extract Sub-Mode 8

4.2.3 Information Mode 8

4.2.4 Stop Mode 8

4 .

3

File Maintenance Mode 8

4.4 Error Reporting 8

4 .

5

SIGNOFF Procedure 8

iv
TABLE OF CONTENTS (Continued)

Page

5

.

IMPLEMENTATION CONSIDERATIONS 9

5 .

1

Minimum Hardware Resources 9

5 .2 Software Installation 9

6. CONCLUSIONS 9

Appendix A. Sample KGS Keyword Extract A-1

Appendix B. Example of Information Mode Listing B-1

Appendix C . KGS Applications Program Listings C-1
LIST OF FIGURES

Page

Figure 1. CBT Perkin-Elmer Computer System Configuration 10

Figure 2. KGS Data Base File Structure 11

Figures. KGS Master File Record Format 12

Figure 4, Keyword Dictionary Record Format

Author Dictionary Record Format 13

Figure 5. Keyword Index Record Format

Author Index Record Format • 14

Figure 6. KGS User Mode Program Modules 15

vi
PRT^FACE

The oriplnal ^GS data base system was developed in conjunction with the

Office of !^tandards 'Heve 1 opnen t in the Occupational Safety and Health

Administration fOSHA)

Pr. Robert Glass served as ''TB'^ leader of the i^S'^A project to develop new

standards for safety and hazard markings. ^r. Glass proposed establishing

an automated data base system to organize the documents related to the project.

Lawrence Kaetzel and George Smith developed the software to support the original system. Judith Galabrese revised the system design and rewrote the

programs to conform to FORTRAN vji standards.

^rs. Jonathan '^artln and Dorothy Reed served as reviewers of this paper.

vli

1

.

INTRODUCTION

NBS Technical Note 1123 published in 1980 described the Kaetzel, Glass, Smith

(KGS) data base system. Since the report was published, substantial changes

have been made to improve the system. This document describes the revised

system.

The most significant modification to the KGS system is a change from a sequential access method to an indexed, directory look-up file structure. This

change allows faster and more efficient random access of the master file. All

programs have been rewritten to accommodate this enhancement. Because of the

responsiveness of the extract mode, the one-key retrieval is unnecessary and

has been deleted from the revised system. The keyword mode has been replaced

by the information mode which provides statistics on authors as well as keywords. A file maintenance mode has been added to ensure data base integrity.

The KGS system has been separated from the larger Publications Data Base and

the select data base mode has been removed. Software has been tailored to meet

KGS users' needs. All programs are written using standard FORTRAN VII Level I programming language. This change provides greater transportability among

computer systems.

The system is designed to help users of medium and small computer systems

organize, file, and retrieve documents. A major advantage of implementing a system for personal copies of research papers is that users can now consider

all publications in their possession to form a research data base. Furthermore,

the system permits the researcher to perform new search strategies on the data

base.

This report describes the overall system, its operation, and the computer

programs. It allows a user with some familiarity with computers to use or duplicate this system. The software system described enables the user to access

the entire data base or subsets of the data base from a computer terminal in a research laboratory or office.

A Ferkin-Elmer^ Model 7/32 minicomputer was used in the development and

implementation of the system. Other minicomputer systems can be used to implement the data base system, although minor adjustments in the programs may be

necessary.

2. COMPUTER SYSTEM ENVIRONMENT

2.1 HARDWARE

The memory capacity of the Perkin-Elmer computer used is one million bytes.

Processing is performed using 32 bit word formats.

^ Reference of computer manufacturer does not constitute an endorsement by NBS.

1
The computer system hosts a variety of peripheral devices including rotating

magnetic disk, magnetic tape, cassette recorders, electrostatic printer/plotter,

and a medium speed line printer (see figure 1).

Telecommunications access methods are achieved in one of three ways: 1) commercial telephone network; 2) dedicated short-haul modems; and 3) dedicated cable

where short distances (less than 450 feet) are involved.

An asynchronous communications adapter is installed on the computer system and

provides a universal hardware communications interface. The ASCII* character

data format is used in the transmission of data between the computer system

and remote devices.

2.2 SOFTWARE

The system was developed under the "Perkin-Elmer OS/32 MT" software operating

system which permits multi-user access to the computer's hardware and software

resources.

The data base management software system is entitled the "Kaetzel, Glass, Smith

Data Base" (KGS). Software sub-systems used with the KGS data base system are:

Perkin-Elmer Multi-Terminal Manager (MTM) and the Perkin-Elmer FORTRAN VII

Level I compiler. The function served by MTM is to provide a remote software

link between the user's terminal and the production and development facilities

of the computer system.

2.3 DATA BASE FILE STRUCTURE

The KGS system uses an indexed, directory look-up file structure (see figure 2).

The data base is device independent and consists of a master file, keyword

dictionary, author dictionary, keyword index, and author index.

The master file is unsorted and contains specific information for every

publication stored. Each record corresponds to a publication. Figure 3

represents the master file record format.

The user is responsible for data representation. However, to ensure integrity

and efficient operation, it is important to establish standards for consistent

data entry. For example, a recommended format for the author name field is:

last name-comma-space-first initial-space-middle initial. The importance of

using a consistent format is reflected in the information retrieval mode.

Keyword and author dictionary files provide the mechanism for direct access retrieval of master file records. The keyword dictionary includes each unique

keyword entered in the keyword fields of the master file. The dictionary also

has pointers to the corresponding master file record (see figure 4). The

author dictionary contains the same information for author fields. Both files

* American Standard Code for Information Interchange.

2
are sorted in ascending sequence when the file maintenance mode is run. However, an unsorted overflow area is provided for additional keywords and authors.

Dictionary files are recreated using the file maintenance mode when the overflow

area is so large that retrieval time is significantly affected.

Index files are used for fast retrieval of dictionary file records. The keyword

index contains a sorted list of kejrword roots and pointers to the starting dictionary address for a particular range (see figure 5). The author index provides the same information for the author dictionary. For example, the root

of keyword "color" is "c". If the first keyword starting with the letter "c"

is located at record 17 of the dictionary file, the keyword index would be: c 17. The dictionary is read sequentially, starting with record 17, until the

keyword "color" is found. If the keyword is not within the range, the overflow

area is read sequentially.

3. MODES OF OPERATION

The KGS data base system is designed to perform a variety of tasks. However,

the system can logically be divided into two modes of operation: user mode

and file maintenance mode.

3.1 USER MODE

The supervisor program (KGSUPVR) directs the execution of the various processing

modules based on input from the user. Refer to figure 6 for software configuration. Program modules are contained within a user software library. Complete

listings of the application programs are in appendix C. Upon completion of a run mode, control is returned to the supervisor program. Error conditions during execution of a run mode also result in control returning to the supervisor

program.

3.1.1 EDIT Mode (KGSEDIT)

There are four edit modes: APPEND, DELETE, UPDATE, and STOP. All editing is

performed by referencing the master file record number. Program CONVERT is

used to right-justify and to change the record number to an integer value.

Records are numbered from one to the number of the last record on the file.

There is no maximum record number except that which is dictated by disk storage

capacity.

Dictionary files are simultaneously updated to reflect changes made to the

master file. Program KGSPTRUP performs the dictionary pointer update function.

The user is primarily responsible for data integrity. Thus, user review of

data upon input is an important aspect of the KGS system. The edit mode displays data elements on the CRT screen for validation by the user. Program

KGSDISLN displays the record in a 14 line format. The system routinely checks

field size to ensure that an input entry is not too long.
Program KGSADD provides the append function. New records are appended to the

master file. Author and keyword fields are automatically added to the dictionary files. In the append mode, each element is requested by first displaying

the element name and then a prompt^ to indicate that input is necessary. The user enters the appropriate information for the entire record. Upon completion,

the user validates the record and decides whether or not to save the

information.

The nature of data base manipulation dictates that a method be provided for

deleting unwanted records from the data base. Program KGSDEL provides this

capability. The delete mode marks a record for deletion. The record remains

on the data base until the file maintenance procedure is run. Once marked for

deletion, however, the record is inaccessible to the user. Author and keyword

pointers are deleted from the dictionary files.

KGSUP is used to modify an element or elements of a record which is already on

the master file. Changed author or keyword fields are automatically updated

on the dictionary files. Data elements are represented in a 14 line format.

Each element is referenced by its corresponding line number. The system does

not have a character string update capability. Rather, the entire data element

is replaced.

The stop command returns program control to the supervisor program.

3.1.2 EXTRACT Mode

Information retrieval and display of the KGS data base is accomplished using

the EXTRACT mode (program KGSEXTRT) . The user selects from three extract

criteria: author, keyword, and all. Information is displayed on the CRT

screen and optionally output to a 132-column medium-speed printer using program

KGSDSPLY

.

Program KGSAUTHX provides the author extract mode. Author index and dictionary

files are searched for a match with the input author name. The dictionary file

furnishes the locations of all records on the master file containing the

requested author name. The master file is accessed directly and the selected

records are output in a report format.

Keyword extracts are controlled via program KGSKEYEX. The user enters up to

six keywords to be retrieved. Within this mode the user further defines search

criteria by requesting a field or string search (see appendix A),

A field search retrieves records from the master file based on keywords entered

in the keyword field. The field search also provides a check for UNION and

INTERSECTION conditions. If UNION (OR) is selected, the retrieved record must

^ A special character displayed by the computer to indicate that an operator

command is expected.
contain at least one of the input keywords. However, if INTERSECTION (AND) is

selected, the retrieved record must contain all input keywords. Keyword index

and dictionary files are searched for a match with the input keywords and the

master file is accessed directly.

The string search (program KGSTRING) sequentially reads the master file

searching title and kejrword fields for a match with the input string. Program

STSRCH compares an input string (maximum 50 characters) with a string up to

100 characters long. When found, the record is output in report format and

the search resumes until the entire master file is read.

The ALL mode allows the user to print the entire master file. The output

report is sorted by author name. Program KGSALL sequentially reads the author

dictionary for direct access record locations on the master file. Duplicate

records will be output if a publication has more than one author.

3.1.3 INFORMATION Mode

The information mode provides a sorted summary report of keyword and author

fields (see appendix B). The information is taken from the keyword and author

dictionaries. The report includes a list of keywords and authors and the

number of occurrences for each item.

3.2 FILE MAINTENANCE MODE

The KGS data base is a dynamic structure which must be maintained. Program

KGSRENEW in the file maintenance mode removes deleted records from the master

file. Programs KGSDCNY and KGSIDX recreate keyword index and dictionary files.

Programs KGSDCNYA and KGSIDXA recreate author index and dictionary files.

Files are recreated to eliminate overflow fields and to include changes made

to the master file. The file maintenance mode is designed to run unattended

during non-peak periods.

4. OPERATING PROCEDURES

To activate and operate the KGS system, the user must have a terminal which is

compatible with the host computer.

4.1 ACTIVATING THE KGS DATA BASE

Activating the various modes of the KGS data base is accomplished via single

commands. The program loading and device assignments are performed using a Perkin-Elmer Command Substitution System (CSS) command file. For a detailed

description of CSS refer to the Perkin-Elmer "OS/32 MT Operator's Reference

Manual .

The command to activate the user mode is: KGS.

The command to activate file maintenance is: KGSRENEW.

For the user mode, this results in the program being loaded and a message

being displayed requesting the desired run mode. The KGSRENEW command loads
and executes all parts of the file maintenance mode. It does not require user

input. The command KGSHELP provides basic information on activating the data

base.

4.2 USER MODE

When the user mode is activated a message is displayed on the terminal

requesting one of four run modes: EDIT, EXTRACT, INFORMATION, or STOP.

4.2.1 EDIT Mode

The user can edit the KGS data base by typing "EDIT". The program asks the user to select append, delete, update, or stop sub-mode. All editing is done

through record numbers. The records on the master file are numbered from one

to the total number of records on the file,

4.2.1.1 APPEND Sub-Mode

The append mode is used to add new publications to the data base. The user

types "APPEND" and the program responds by requesting the author name. The

program then prompts for the remainder of the information. When all 14 lines

have been entered, the completed record is displayed at the terminal. The

user checks the input data and answers the question "SAVE 0,K.?". A "YES" answer results in the record being written to the master file. If "NO" is

typed, the text is discarded. Dictionary files are automatically updated when

a record is saved. The program asks "DO YOU WANT TO CONTINUE IN THE APPEND

Mode?" If the user wishes to enter additional publications, "YES" is entered.

If the user wishes to return to the EDIT run mode, "NO" is entered,

4.2.1.2 DELETE Sub-Mode

The DELETE mode is used to delete a publication from the master file. The

program asks for the number of the record to be deleted. The record is

retrieved and displayed at the terminal with the message "DELETE THIS RECOBID?".

The user responds "YES" or "NO", The program asks "DO YOU WANT TO CONTINUE IN

THE DELETE Mode?", The user enters the appropriate response,

4.2.1.3 UPDATE Sub-Mode

The update mode is used to change a record already on the KGS data base. The

update program asks for the number of the record to be updated and displays

the record on the terminal screen in a 14 line format. The user is asked to

"ENTER # OF LINE TO BE UPDATED OR AN * TO END," The user types the appropriate

line number and the current contents of the line are displayed. The next line

of text typed by the user replaces the old line. The program asks for the

next line to be changed.

The user types an asterisk (*) or a carriage return when all changes to the

record have been completed. The program displays the entire record and asks

"SAVE 0,K.?" The user responds "YES" or "NO", The program then asks "DO YOU

WISH TO CONTINUE IN UPDATE Mode?", The user answers "YES" or "NO".

6
4.2.1.4 STOP Sub-Mode

In response to the statement "ENTER EDIT Mode - ", the user types "STOP" or a carriage return to exit from the EDIT mode. Program control returns to the

supervisor program,

4.2.2 EXTRACT Mode

The extract mode allows the user to retrieve records from the data base

according to specified search criteria. The program asks the user to "ENTER

EXTRACT CRITERIA (AUTHOR, KEYWORD, OR ALL)".

4.2.2.1 Author Extract Sub-Mode

Through the author extract sub-mode, the user can retrieve all publications

written by a particular author. The program asks the user to "ENTER AUTHORS

NAME - (DOE, J. J.) - FORMAT MUST MATCH RECORD". The user types the name of

the author in the same format it was entered. The program asks "ALTERNATE

PRINT OPTION?". A "YES" response produces a hard-copy report in addition to

the terminal display. A "NO" response produces only the terminal output.

After the retrieved records are displayed, the program asks "DO YOU WISH TO

CONTINUE?". A "NO" response returns control to the supervisor program.

4.2.2.2 Keyvord Extract Sub-Mode

The keyword extract sub-mode allows the user to retrieve records containing

particular keywords. There are two options available within this mode: field

or string search. The program asks: "FIELD OR STRING SEARCH BY KEYWORD?".

The field search produces a report of all publications having the desired

keyword in one of the keyword fields. The input keyword must exactly match

the keyword field on the master file. On entering the field search, the user

is asked to select "UNION (OR) OR INTERSECTION (AND)" search criteria. The

program asks the user to "ENTER KEYWORDS". Up to six kejrwords are entered - one per line. The program asks "ALTERNATE PRINT OPTION?". The user answers

"YES" or "NO". The selected publications are displayed on the terminal or concurrently output to a medium-speed printer. When all publications have

been displayed, the program asks "DO YOU WISH TO CONTINUE?". A "NO" response

returns control to the supervisor program.

The keyword string search allows the user to retrieve publications containing

the input string within title or keyword fields. It is a lengthy process

because the entire master file is searched. The program asks "ALTERNATE PRINT

OPTION?". The user replies "YES" or "NO". The program asks the user to "ENTER

KEYWORDS FOR SEARCH", Up to six keywords are entered - one per line. After

all selected publications have been displayed or concurrently output to a medium-speed printer, the program asks "DO YOU WISH TO CONTINUE?". A "NO"

response returns control to the supervisor program.
4.2.2.3 All Extract Sub-Mode

To produce a listing of the entire master file, the user types "ALL" in response

to "ENTER EXTRACT CRITERIA (AUTHOR, KEYWORD, OR ALL)". The listing is sorted

by author name and is output to a file (CALtKGSPRT.DTA) for subsequent printing.

After the file has been produced, the program asks "DO YOU WISH TO CONTINUE?".

A "NO" response returns control to the supervisor program. (To produce the

hard-copy listing, the user types PRINT CAL:KGSPRT.DTA)

.

4.2.3 INFORMATION Mode

The information mode provides the user with statistics about the KGS data

base. The program asks the user to "ENTER INFORMATION DESIRED - AUTHOR, KEY,

OR BOTH".

The author information sub-mode prints a sorted list of all authors on the KGS

data base and the number of publications on file for that author. The keyword

information sub-mode prints a sorted list of all keywords and the number of

occurrences of the keyword within the data base. The both option provides

separate listings of authors and keywords. After the reports are printed,

control returns to the supervisor program,

4.2.4 STOP Mode

The user types "STOP" or a carriage return to exit from the user mode.

4.3 FILE MAINTENANCE MODE

To activate the file maintenance mode, the user types KGSRENEW. No further

user input is required. Because of memory requirements, file maintenance mode

should be run during non-peak periods,

4.4 ERROR REPORTING

Error conditions during execution of the KGS system fall into two categories:

hardware related failures and user errors.

Hardware failures usually occur when a magnetic disk file is accessed. The

system reports the condition with an appropriate message and returns control

to the supervisor program. A status code indicating the nature of the problem

is displayed with the error message. The "Perkin-Elmer FORTRAN VII Reference

Manual" contains the list of status codes.

User errors occur when the operator enters an invalid response. An appropriate

message is displayed explaining the error. Control remains within the current

mode and the user is asked to rekey the response.

4.5 "SIGNOFF" PROCEDURE

Upon completion of KGS data base operations, the operator should sign off the

computer system. This is accomplished by entering the command:

8
SIGNOFF

The computer acknowledges the command by printing the total elapsed time that

the user was on-line. To start the system over see Section 4.1.

5. IMPLEMENTATION CONSIDERATIONS

Considerations relating to implementation of the KGS data base software system

are described in the following sections. Computer system hardware and software

availability will vary among different computing systems. Such factors as memory size and disk storage are critical and require careful consideration

before implementation takes place. In situations involving Perkin-Elmer

32 bit computers, the implementation process involves little or no software

modifications and less emphasis placed on memory requirements.

5.1 MINIMUM HARDWARE RESOURCES

The amount of memory required to operate the KGS system in the user mode is

75,000 bytes. The file maintenance mode requires 247,750 bytes of memory.

Disk storage capacity necessary to operate the KGS system is determined by the

number of records in the data base. An approximate calculation to determine

disk storage is 900 times the maximum number of records to be stored. This

allows for storage of the master file, dictionaries, and indexes.

5.2 SOFTWARE INSTALLATION

Applications programs for the KGS data base will most likely require minor

modifications where a computer system other than a Perkin-Elmer 32 bit machine

is employed. Changes may be necessary to substitute external or library

subroutines.

6. CONCLUSIONS

This report provides a description of an information retrieval system. The

advantages of this revised system over the original KGS data base are:

better transportability among computer systems, reduced retrieval time, and an enhanced file structure which allows faster and more efficient random access.

Here the user has an upgraded system to aid in developing research projects.

The researcher now has increased capability to interrogate computer-stored

data bases which provide a file code describing where the document is stored

(e.g., file drawer). New search strategies encourage greater efficiency in

research efforts.

The revised KGS data base system is compatible with most minicomputer systems.

Limitations to implementing the system include a requirement for at least

300,000 bytes of core memory, a FORTRAN VII compiler, and disk capacity sufficient to support the stored files.
c/>

CO

C3

»—

gg UJ c/> <: (/> oe O- C3 >-

C9 ^ .^ O _J ea ^ ee UJ ^^ Ou

LaJ 4:

C3

LU (/>

^^ >-oe ^ e ^^ 1— ca *-» ^ LU - iO OE

GD 1—

~^ a^^

c

o

•H

4-1 COU

3

bC

•Hm

c

ou

§

4J

CD CO

!-i QJ 4J

ft6

oo

0)

[G

•H

Vj

0) (^H

o

(U

•H

P4

10
gHwJMw

CO<

PQ<OO

0)3

bO

•H

11
Author 1 (32 characters)

Author 2 (32 characters)

Author 3 (32 characters)

Publication Date (12 characters)

Publication Title (100 characters)

Publication Name (32 characters)

Reference (20 characters)

Keyword 1 (16 characters)

Keyword 2 (16 characters)

Keyword 3 (16 characters)

Keyword 4 (16 characters)

Keyword 5 (16 characters)

Keyword 6 (16 characters)

Discipline (16 characters)

Figure 3. KGS Master File Record Format

12
Keyword Dictionary Record Format

Keyword (16 characters)

1st Location on master file (4 characters)

2nd Location on master file (4 characters)

Last location on master file (4 characters)

Author Dictionary Record Format

Author name (32 characters)

1st Location on master file (4 characters)

2nd Location on master file (4 characters)

Last location on master file (4 characters)

Figure 4, Dictionary Record Formats

13
Keyword Index Record Format

Keyword Root (1 character)

Pointer to keyword dictionary (4 characters)

Author Index Record Format

Author Root (1 character)

Pointer to author dictionary (4 characters)

Figure 5. Index Record Formats

14
KGSUPVR

KGSEDIT

KGSADD

KGSUP

KGSDEL

KGSEXTRT

KGSAUTHX

KGSKEYEX

KGSALL

KGSINFO

Figure 6, KGS User Mode Program Modules

CRAM

CONVERT

kgsdisln

"kgsptrup

SEARCH

CRAM

'convert

kgsdisln

~kgsptrup

'search

CRAM

_C0NVERT

KGSDISLN

JCGSPTRUP

SEARCH

KGSDSPLY

SEARCH

KGSTRING

"STSRCH

KGSDSPLY

SEARCH

kgsdsply

'search

15

APPENDIX A

KGS

»»* FOR ADDITIONAL HELP OR INFORMATION

**» TYPE KGSHELP

KGS PUBLICATIONS DATA BASE

ENTER DESIRED RUN MODE

EDIT EXTRACT INFORMATION STOP

EXTRACT

A-1
KGS PUBLICATIONS

DATA BASE RETRIEVAL MODE

ENTER EXTRACT CRITERIA (AUTHOR, KEY, OR ALL)

KEY

FIELD OR STRING SEARCH BY KEYWORD?

FIELD

UNION (OR) OR INTERSECTION (AND)

OR

ENTER KEYWORDS

ABSOLUTE HUE

XENON FLASHTUBE

COLOUR

KEYWORD NOT IN DICTIONARY - COLOUR

ALTERNATE PRINT OPTION?

NO

KEY WORD/S SELECTED WERE: ABSOLUTE HUE

SEARCH CRITERIA USED: UNION

XENON FLASHTUBE COLOUR

AUTHOR:

AUTH0R(2)

AUTH0R(3)

FILE CODE

PUBLICATION DATE

TITLE:

PUBLICATION NAME

REFERENCE:

- - KEY WORDS - - COLOR PERCEPTION

BACKGROUND COLOR

AKITA, M. RECORD NO.

GRAHAM, C. H.

HSIA, Y.

0232

0464

MAINTAINING AN ABSOLUTE HUE IN PRESENCE OF DIFFERE

NT BACKGROUND COLORS

VISION RES.

4,539-556

COLOR CONTRAST ABSOLUTE HUE

LUMINANCE RATIO BEZOLD-BR UCKI

A-2
KEY WORD/S SELECTED WERE: ABSOLUTE HUE

SEARCH CRITERIA USED: UNION

XENON FLASHTUBE COLOUR

AUTHOR:

AUTH0R(2) : AUTH0R(3) : FILE CODE:

PUBLICATION DATE

TITLE:

PUBLICATION NAME

REFERENCE:

RECORD NO. 1 1 HENDLEY, C. D.

KULIKOWSKI, J. J.

1972

ELECTROPHYSIOLOGICAL AND PSYCHOPHYSICAL RESPONSES

TO MODULATION OF CONTRAST OF A GRATING PATTERN

PERCEPTION

1 ,341-349

- - KEY WORDS - - XENON FLASHTUBE ELECTRONICS POWER SUPPLIES

DO YOU WISH TO CONTINUE?

NO

ENTER DESIRED RUN MODE

EDIT EXTRACT INFORMATION STOP

STOP

STOP

JUDY -END OF TASK CODE= C PUTIME = 4 . 442/0. 830

»»» FOR ADDITIONAL HELP OR INFORMATION

*»« TYPE KGSHELP

«»« SIGNOF

ELAPSED TIME = 3:44 CPUTIME = 4 . 442/0 . 830

TIME OFF=12/30/81 11:50:58

A-3

APPENDIX 9

LUU

LU

Oi. Qi. IDO

O

o

'-> ^r CM OJ rj CM fVJ ID

O

X " H

CO 3

\ <r \

CVl

a:

111 u.

u.

LUCDLU cm

• UJ ..<!.. Qi 3

^ LU • DQ 2: C <! • X • « LU 2: X D U LU

a to z: Qi O X

(_) O Qi • O » » -3 . . ^ * K , _J I ...

X _l Qi M X • 3 « O Ll_ -1 X _J _l LU » _l

» .-, CO I 1— -< Qi • Qi <r _j _i q: Qi o • -J 3 3 ^ O , I 1— — LU » Z: UJ » » » 21 LU LU O LU 3 X

_! Qi • .. QiXl— >t- »X — LU XXDi332:C5 1 X

* » » _J O U5 LTl LU —' UJ O CO > O » CO -- LU LU U :z ':«: UJ X CO <I

iii V ii: LU U- Qi (J -sQIlXi.iXQif-i.iQiX Qi Qi - U CJ .ii -- -- 2: CJ CJ O O O UJ LD — -JXQiQiQiXCJUJX QiQi -a:<i<iQoo

LU LU LU LU UJ LU LU LULULULULULULU-—'•—'•—' —'—••— _1_I_IOOCj

CD CD QD 03 m CCl GO CDdlCDCDCDCDCOCOCDCD CDCQCDQDGimOiQZlCD

..... C 21

• Qi _i CD 21 3 a: = Qi > •-) » a; ^ ...*.. a ' or

• .xct:Luxxx - n ' • V(=>(=) —I" — X D_X»

Qi » » 1 UJ LU _l ^ X' ^

. I <I Qi Qi CD h- H- _' • X f— CI' -- > a: LU LU X 0") CT' uj .t. <z uj co h

o LU CD X iz —' X X CO r: 7'l u es x

X X O O O Qi Qi Qi C X X > >• >

o o o o o o o o c- c;: o o o o

Oi en en en CD CD oj CD CL' oj Cu Cli a m

(S)

QioX

IZD

<r en

LUo

X

lU

Qi

UJ Qi a: o

CD U

o

a

I-a

X

o

ro CM CM -^ CVJ CM in CM

u

CDX Qi

Q. OX

ffi \-

LD X

iii <r

tn

CK LU

LU T. . LU CiL

B 21 1- . . -) . <i • :^ •UQi^3'CDa:cj- t > . "n CD UJ ^ • —, • o UJ LU Qi a L_ •7~ LU 3? U X —. » LU 1 -) 1- • • LL . . . ^ I LU . ...

2: . . . . Q/ . . z: CD K * (Si IS) —, .(JCDLDQi -X-JX ^ ^ . e B »O<r0D2: »QiLUCJCJ U. 21 ^ • X X . _l X X <r U C H- t- g: C: g: g: > CO Qi 1=1 X 1 ^ <cr o o CO ^ ^ » o o 3 » ^ ^ cn f- !_ OX»'-»X'.X^» * » O X Qi IS) <S) 3 CO CO <r » Qi Qi X > 1 3 CO LU L'J LLi ^ ^ ^ ^ !:•— cncna:c3X<rxx X X CO Qi LU Qi QC LU •— —• LUOt— !-'_)LUCkiOLU_J_: _) r^j pi LU LU a:vz:z:i-x—'Xlulu LU LU —• LU _J CO UJ UJ Qi t—

1

(-i-XXC0COC0_JUJ_JXt-r- >---

t—

^

U.J Di K

Qil-a:<r'-'COQQUj_i_j -J _l _l Q. C3 LU (=i ft O CO co CO ( 1 UJ 71 2: 1- -- V Qi Qi Qi cr K .-p.-' "1 rc <z CDCJ««VV_J_J_1_I _i _i _i _i 2: z: X X X X XXQiQiQiQiQi<I<I<I<X<rO ^x «f g: lU L'J *cna<ra:<L<ra:<r<i<E<i a: <i CE <r a: CE a: <r <r a: <I<T<I<I<X<ra:m£DGQCDCDCi3 CG Qj en CD CD

B-1
Ui

UJ

UJ

q:

(_) O

o

Qi Z U — H UJ > to C^ X UJ o

U 1- _l F U U —

UJ z <r cti u c 1-1 F 2: o

_l O UJ _l X 0:: CQ a 1- UJ z; 'j-! r- U (3 <£. a "-' Q. Q. LD ?

ZUJZ<E ZHQi Qi auujtn offiuj F HZ — Qi uSq. to p z Q. ft i:: F -- CE ct; c: — Zj :j a. z UJ >c/)cnz:> '- ^ r Pi CO «

CJ i^>----a-^cj _i a z: o o x d H Z UJ o r-t -' o I a > o __ 0^ to a o UJ - z

z X <r > to to to to oo > o <r GCi u u t—i e^ (i: Q/ ^g If) 30. _i_i_i 3cnuj UJ a: A UJ ujxck^<rQ!:Q^<x<roQ!:<xuji- oFoQQi<r<ruuQia:_iZ'-' ^

OZQiUJtOtOtOtOtO —• C^ GQ U U U CJ CJ u a u u

S) Q UUJCDQiUJUJUJUJt3tOl-l- 1

1 ^ l-H *—1 "-H ^-'. •—

^ »—H t—* *-^ ^^ oitD_i_i'-'»-'UjoQ ox I-'-'00Z)3LDCDF U5U3 ti^ zzzzztoauuja_jFf-H-h- !-• L_ t_ f_ („ Qih-h-l-HI-Hh-t- — UJCk: a: Q jv o <r a: cr <T <rr <r g: c: c:

(VI UJ cn3_i—uoooujiiix \ ujxxxxxxxxozcQQiocQQizrrz:^: «.— 7~ t: 2~ r -^ i^ <r o_ioo_i_i^uuujujQi> o CDCDCDCDCDCDLDtJD—l'-''-' <r X Ul o o o c c CT' o ::• o o _jQ:M0Dzzooo<ro3=) 3 o q: H-,,-H-.,-.e-.—.•-.«.-.in_ii-i-Qi_JcidCii£i;c- C-- a-. c: a: a: _iauj—— — —'——'-i-i-i-i _l o o ci/Q!:a:c^Q::Q^(^Q!:33<r <i <r UJ X X X X i: Z^'. -!- "_ J,. 'S. <ECQCQCQCQCQCQOQCQCQOQCQCDOD

GQ

GQ GQ m flf) CQ CQ Q) QQ QQ QQ CQ QQ (_J u u u o u u u o jji CJ u u u

too to

Q/ LU i^>- UJ UJ Q^

3

U

o

UJ

to

GQ

<rF

<E

Ul

-^ TT fVI ro — ro c^j t>j

(M CM 00 r>- ro (M ro (vj M CM

F

U

Ul

Q.

UJ to X z

3 0. <E

-J q: Qi O O F Gki to to to X

CO GO GQ (-) <i <r a <r

<rX

u

u o

to >- •- •- F F F

Q£ F

O Q£

_l O

O F

U to

I—

u a

to u o <!•-—

Hi- h- o to to

Qi 3 =} X o o

o o u

<E <r <r

u

UJ

u.

u.

Ul

to

Ul

tZJ

(=> u F a

UJ '-' <r X

u_ z F u

F F <r Ul UJ U U O CO (J

<r <E <L <r <r

Q£ X

o u

Ul -- Qi

(o > <r

to <E <r UJ F _1 X to U > Ul UJ

Ul to z: CO c^

U. Z <E

U. O _l _J

UU tH '-' <E <E <E z X 2: z:

IjJ I—« ^ Q_ l-H »—

(J CJ -- _1 z z

a a a: a: a <r

en

GO

X

CD

UJ

Q.O

U

to UJ ^F

O C^ Z

_l 3 UJ

<r F Qi iz —• oi <r O CD UJ Q. Z Z Q. Q. <x <r <r <r

to

<r UJ -• q: CD _i o a z

_i z: 3

o •-< to _ u c

—I _i to

_i a: a: —• >- z

—

CJ Qi CD p J-: > G z

> g: F _• -<

LL' ^ L,'.. CJ' CO

"^

~! C~; i=. If

CJ _.' .r. z u

UJ <z

<r Q£

Q. Gl

CL a.

2: z ^ _ .. ^ _ F F F F >>-(=) C i- liJ '--^ — CJ U

Qi q: Qi to to CO 3 3 r' r.-- : . t <:r <r <r a: a: <r cc a a: <r G a: c- cli g:j

B-2
APPENDIX C

C

C

C PROGRAM KGSUPVR

C

C WRITTEN BY JUDITH CALABRESE - 19 OCTOBER 1981

C

C DRIVES THE KGS DATA BASE RETRIEVAL SYSTEM

C

C

C

C HEADER

C WRITE (6 ,9000 ,ERR=8000)

C

C ENTER MODE OF OPERATION

C50 WRITE (6 ,9010

,

ERRrSOOO)

READ (6 ,9020 , ERRrSOOO) IRESP

C IF (IRESP. EQ. 'EDIT' ) GO TO 100

IF ( IRESP. EQ. ' EXTR • ) GO TO 200

IF (IRESP. EQ. ' INFO' ) GO TO 300

IF (IRESP. EQ. • STOP ' ) GO TO 9999

IF ( IRESP. EQ. ' • ) GO TO 9999

GO TO 8010

C

C EDIT MODE

C100 CALL KGSEDIT (ISTAT)

IF (ISTAT. NE.O) GO TO 9999

GO TO 50

CC EXTRACT MODE

C200 CALL KGSEXTRT (ISTAT)

IF (ISTAT. NE.O) GO TO 9999

GO TO 50

C

C INFORMATION MODE

C300 CALL KGSINFO (ISTAT)

IF (ISTAT. NE.O) GO TO 9999

GO TO 50

CC STOP

C9999 STOP

C

CC ERROR REPORTING AND FORMATTING

C8000 WRITE (6 , 8005 , ERR = 9999)

8005 FORMAT (/ 1 X ,' COMMAND DEVICE ERROR')

GO TO 9999

8010 WRITE (6,8015 ,ERR=8000)

8015 FORMAT (/ 1 X ,' IN VALID RESPONSE - PLEASE ENTER AGAIN'/)

C-1
GO TO 50

C

C

C

C

9000

9010

9020

I/O FORMATTING

FORMAT (//////////10X, 'K

'D

GS PUBLICATIONS ',

ATA B A S E'//10X,

FORMAT (/////20X, 'ENTER DESIRED RUN MODE'///,

lOX.'EDIT EXTRACT INFORMATION STOP'//)

FORMAT (A4)

END

C-2
cc

c

c

c

c

c

c

c

cc

c

cc

cc

c

cc

cc

cc

cc

c

c

c

c

c

c

c

c

c

c

c

c

c

c

c

c

c100

SUBROUTINE KGSEDIT ( ISTAT

)

WRITTEN BY JUDITH CALABRESE - 17 SEP 81

PROVIDES 3 FUNCTIONS FOR THE KGS PUBLICATIONS DATA BASE SYSTEM

ADD - ALLOWS THE USER TO ENTER NEW RECORDS.

DELETE - ALLOWS THE USER TO REMOVE EXISTING RECORDS

FROM THE KGS DATA BASE.

NOTE: THIS FUNCTION ACTUALLY MARKS RECORDS

FOR DELETION RATHER THAN PHYSICALLY

REMOVING THE RECORD.

UPDATE - ALLOWS THE USER TO UPDATE EXISTING RECORDS.

IN ALL CASES THE KGS DICTIONARY IS REVISED.

***** LOGICAL UNIT ASSIGNMENT *****

LU6 - COMMAND DEVICE

THE FOLLOWING LOGICAL UNITS ARE

OPENED AND CLOSED WITHIN SUBROUTINES

LU1 - KGS DATA BASE

LU2 - KGS AUTHOR INDEX

LU4 - KGS AUTHOR DICTIONARY

LU7 - KGS KEYWORD INDEX

LU8 - KGS KEYWORD DICTIONARY

C

C

200

HEADER

WRITE (6 ,9020 ,ERR = 8000)

USER ENTERS MODE OF OPERATION

WRITE (6,9000,ERR=8000)

READ (6,9010 ,ERR=8000) IRESP

IF (IRESP. EQ. 'APPE' ) GO TO 200

IF (IRESP. EQ. 'DELE' ) GO TO 300

IF (IRESP. EQ. 'UPDA') GO TO 400

IF (IRESP. EQ. 'STOP' ) GO TO 9999

IF (IRESP. EQ.' ') GO TO 9999

GO TO 8020

APPEND

CALL KGSADD(ISTAT)

IF (ISTAT. NE.O) GO TO 9999

C-3
cc

c300

c

c

cMOO

c

c

c9999

C

C

C

8000

8005

8020

8025

C

c

c9000

9010

9020

GO TO 100

DELETE

CALL KGSDEL(ISTAT)

IF (ISTAT.NE.O) GO TO 9999

GO TO 100

UPDATE

CALL KGSUP(ISTAT)

IF (ISTAT.NE.O) GO TO 9999

GO TO 100

RETURN

RETURN

ERROR REPORTING AND FORMATTING

WRITE (6 ,8005

ERR=9999)

FORMAT (/1X, 'COMMAND DEVICE ERROR'/)

GO TO 9999

WRITE (6,8025 ,ERR=8000)

FORMAT (/1X,

INVALID RESPONSE - PLEASE ENTER AGAIN'/)

GO TO 100

I/O FORMATTING

STOP'//////)

FORMAT (/////20X, 'ENTER EDIT MODE - '//5X,

'APPEND DELETE UPDATE

FORMAT (A4)

FORMAT (//////////////20X, 'K GS PUBLICATION S',//1X,

- lOX.'D ATA BASE EDIT MOD E'////)

END

C-4
c

c

c

c

c

c

cc

c

c

c

c

cc

c

c

cc

cc

cc

c

c

c

c

cc

K G S A D D

SUBROUTINE KGSADD(ISTAT)

WRITTEN BY JUDITH CALABRESE - 25 SEP 81

PROVIDES THE APPEND MODE OF THE KGS RETRIEVAL SYSTEM

SUBROUTINE CALLED FROM KGSEDIT

«***# LOGICAL UNIT ASSIGNMENT *****

LU1 - KGS AUTHOR INDEX FILE

LU2 - KGS AUTHOR DICTIONARY FILE

LU5 - KGS DATA BASE

LU6 - COMMAND DEVICE

LU7 - KGS KEYWORD INDEX FILE

LU8 - KGS KEYWORD DICTIONARY FILE

KGS DATA BASE DATA ELEMENTS

CHARACTER*32,AUTHOR(3)

CHARACTER*12,PUBDAT

CHARACTER*100,TITLE

CHARACTER*32,PUBNAM

CHARACTER*20,REFER

CHARACTER*! 6, KEYWRD( 6)

CHARACTER*16,DISCPN

CHARACTER*4 .BUFFER

CHARACTER*78,TITLE1

CHARACTER*35 ,TITLE2

CHARACTER*! ,AUTIDX(30)

CHARACTER*! ,WRDIDX(30)

CHARACTER*2, SPACES

CHARACTER*! .ASTRIX

INTEGER*2 AUTPTR(30),WRDPTR(30),AUTHCT

INTEGER*2 WRDCT

,

IREC , KREC

INTEGER*2 ILINE,ITYPE

INITIALIZE VALUES

SPACES='

ASTRIXr'*'

AUTHCTrO

WRDCTrO

C-5
5

C

C

C

10

C

C

C

C

Cc

c

c

cc

c

c20

30

40

C

C

C

c100

OPEN KGS INDEX FILES - AUTHOR & KEYWORD

OPEN (1 ,IOSTAT = ISTAT,ERR = 8010,FILE='KGSIDXA.DTA' ,RECL = 5,

SHARE='SR0')

OPEN (7,I0STAT=ISTAT,ERR=80 10,FILE='KGSIDX.DTA' ,RECL=5,

SHAREr'SRO')

BUILD INDEX ARRAYS

FOR DICTIONARY SEARCH

DO 2 1=1 ,30

READ (1 ,9180,IOSTATrISTAT,END = 3) AUTIDX ( I )

, AUTPTR ( I)

AUTHCT=AUTHCT+1

CONTINUE

DO 5 1=1 ,30

READ (7,9180 ,IOSTAT = ISTAT,END=10) WRDIDX ( I ) , WRDPTR ( I

WRDCT=WRDCT+1

CONTINUE

CLOSE INDEXES

CLOSE (1)

CLOSE (7)

OPEN KGS DATA BASE

OPEN (5,IOSTAT=ISTAT,ERR=80 10,FILE='KGS' ,RECL=372,

SHARE='EWO' , ACCESS =• DIRECT '

FIND END OF FILE

INQUIRE (5 ,SIZE = IREC) ***** INPUT MODE *****

SET INPUT FIELD = SPACES

DO 30 1=1 ,3

AUTHOR(I)= ' CONTINUE

PUBDATr'

TITLE1='

TITLE2='

PUBNAM='

REFER='

DO 40 1 = 1 ,6

KEYWRD(I)='

CONTINUE

DISCPN='

AUTHORS

ILINE=1

C-6
c120

C140

CC

C200

C

C

C

C

C

C

C

350

C

C

c400

WRITE (6 ,9000

,

ERR = 8000)

READ (6,9010, ERR = 8000) AUTHOR ( 1 ), BUFF ER

IF (AUTH0R(1).EQ.SPACES.0R.AUTH0R(1).EQ.ASTRIX)

IF (BUFFER. NE. SPACES) GO TO 8020

ILINE=2

WRITE (6,9020 ,ERR=8000)

READ (6 ,9010 ,ERR = 8000) AUTHOR ( 2 ), BUFF ER

IF (AUTH0R(2) .EQ. SPACES) GO TO 200

IF (AUTH0R(2) .EQ.ASTRIX) GO TO 7000

IF (BUFFER. NE. SPACES) GO TO 8020

ILINE=3

WRITE (6,9030

,

ERR=8000)

READ (6,9010

,

ERR=8000) AUTHOR ( 3 ), BUFF ER

IF (AUTH0R(3) .EQ. SPACES) GO TO 200

IF (AUTH0R(3) .EQ.ASTRIX)

IF (BUFFER. NE. SPACES) GO

PUBLICATION DATE

GO TO 7000

GO

TO

TO 7000

8020

ILINE=4

WRITE (6 ,9040 ,ERR = 8000)

READ (6 ,9050 ,ERR = 8000) PUBDAT , BUFFER

IF (PUBDAT. EQ.ASTRIX) GO TO 7000

IF (BUFFER. NE. SPACES) GO TO 8020

TITLE

WRITE (6 ,9060

,

ERR = 8000)

READ (6,9070

,

ERR=8000) TITLE1

IF (TITLE1 .EQ.ASTRIX) GO TO 7000

WRITE (6,9065 ,ERR=8000)

READ (6,9075 ,ERR = 8000) TITLE2 , BUFF ER

IF (TITLE2.EQ. SPACES) GO TO 350

REMOVE EXTRA SPACES FROM TITLE FIELD

CALL CRAM(TITLE1 ,TITLE2)

CREATE 100 CHARACTER TITLE FIELD

TITLEd :78) = TITLE1 ( 1 : ) TITLE(79 : )=TITLE2( 1 :

)

PUBLICATION NAME

ILINE=5

WRITE (6 ,9080,ERR = 8000)

READ (6,9010 ,ERR = 8000) PUBNAM , BUFFER

IF (PUBNAM. EQ.ASTRIX) GO TO 7000

IF (BUFFER. NE. SPACES) GO TO 8020

REFERENCE

C-7
500

650

C

C

C

700

C

C

C

c

c1000

c

c

c2000

ILINE=6

WRITE (6,9090,ERR=8000)

READ (6,9100,ERR=8000) REFER, BUFFER

IF (REFER. EQ.ASTRIX) GO TO 7000

IF (BUFFER. NE. SPACES) GO TO 8020

KEY WORDS

WRITE (6,91 10,ERR=8000)

DO 650 1 = 1 ,6

READ (6,9120,ERR=8000) KEYWRD( I.BUFFER

IF (KEYWRD(I) .EQ.ASTRIX) GO TO 7000

IF (KEYWRD(I) .EQ. SPACES) GO TO 700

IF (BUFFER. EQ. SPACES) GO TO 650

WRITE (6,91M0,ERR=8000) KEYWRD(I)

CONTINUE

DISCIPLINE

ILINE=7

WRITE (6,9130,ERR=8000)

READ (6,9120,ERR=8000) DISCPN , BUFFER

IF (DISCPN. EQ.ASTRIX) GO TO 7000

IF (BUFFER. NE. SPACES) GO TO 8020

DISPLAY RECORD

KREC=IREC+1

CALL KGSDISLN (AUTHOR,PUBDAT,TITLE,PUBNAM,

REFER,KEYWRD,DISCPN,KREC)

SAVE RECORD?

WRITE (6,9150,ERR=8000)

READ (6,9160 ,ERR=8000) IRESP

IF (IRESP. EQ. 'YES GO JO 2000

IF (IRESP. EQ. 'NO

ILINErl

GO TO 8030

')

') GO TO 7000

WRITE RECORD TO KGS DATA BASE

IREC=IREC+1

WRITE (5,9170, IOSTAT=ISTAT

ERRr80 40

REC=IREC ) (AUTHOR (I) ,1=1 ,3) ,PUBDAT,TITLE,PUBNAM,

REFER, (KEYWRD( J) ,J=1 ,6) , DISCPN

tf ««»«

ITYPErl

CALL KGSPTRUP

UPDATE KGS DICTIONARY FILES *****

( AUTHOR, KEYWRD,IR EC, AUTIDX,WRDIDX,

AUTPTR,WRDPTR,AUTHCT,WRDCT,ITYPE)

C-8
c

c

c7000

c

c

c9999

C

C

C

C

C

8000

8005

8010

8015

8020

8025

8030

8035

8040

8045

C

c

cc

c9000

9010

9020

9030

9040

9050

9060

9065

9070

9075

9080

9090

9100

9110

IF (ITYPE.EQ.9) GO TO 9999

CONTINUE

WRITE (6 ,9210

,

ERR=8000)

READ (6 ,9160 ,ERR=8000) IRESP

IF (IRESP. EQ. 'YES ') GO TO 20

ILINE=2

IF (IRESP. NE. 'NO •) GO TO 8030

ISTAT=0

RETURN

CLOSE (5)

RETURN

ERROR REPORTING AND FORMATTING

WRITE (6 ,8005

,

ERR=9999)

FORMAT (/1X, 'COMMAND DEVICE ERROR'/)

ISTATrl

GO TO 9999

WRITE (6 ,8015 ,ERR = 8000) ISTAT

FORMAT (/1X, 'ERROR ON OPENING FILE - lOSTAT

GO TO 9999

WRITE (6 ,8025 ,ERR=8000)

FORMAT (/1X,'LINE TOO LONG - PLEASE ENTER AGAIN'/)

GO TO ( 100 , 120 , 140 ,200 ,400 ,500 ,700) ,ILINE

WRITE (6,8035 ,ERR=8000)

FORMAT (/1X, 'PLEASE RESPOND YES OR NO'/)

GO TO ( 1000,7000) ,ILINE

WRITE (6 ,8045 ,ERR=8000) ISTAT

FORMAT (/1X, 'ERROR ON WRITING FILE - lOSTAT = GO TO 9999

• ,14/)

14/)

I/O FORMATTING

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

AUTHOR (DOE

TO END'/)

(/1X, J) '/ , IX ' ENTER FIRST

'OR A BLANK LINE

(A32,A4)

(/1X, 'ENTER SECOND AUTHOR IF APPROPRIATE'/)

(/1X, 'ENTER THIRD AUTHOR IF APPROPRIATE'/)

(/1X, 'ENTER PUBLICATION DATE'/)

(A12,A4)

(/1X, 'ENTER FIRST LINE OF TITLE')

(IX, 'ENTER SECOND LINE OF TITLE')

(A78)

(A35,A4)

(/1X, 'ENTER PUBLICATION NAME'/)

(/1X, 'ENTER REFERENCE'/)

(A20 ,A4)

(/1X, 'ENTER UP TO 6 KEYWORDS - ONE KEYWORD PER LINE'/)

C-9
9120 FORMAT (A16,A4)

9130 FORMAT (/1X, 'ENTER DISCIPLINE')

9inO FORMAT (/IX.'TOO LONG!!! - KEYWORD TRUNCATED TO ',A16)

9150 FORMAT (IX, 'SAVE O.K.?')

9160 FORMAT (A4)

9170 FORMAT (3A32,A12,A100,A32,A20,6A16,A16)

9180 FORMAT (A1,I4)

9210 FORMAT (IX, 'DO YOU WANT TO CONTINUE IN THE APPEND MODE?')

END

C-10
c

c

cc

c

c

c

cc

c

c

c

cc

c

c

cc

c

c

cc

c

c

c

c

c

cc

K G S U P

SUBROUTINE KGSUP (ISTAT)

WRITTEN BY JUDITH CALABRESE - 13 OCTOBER 1981

PROVIDES THE UPDATE MODE OF THE KGS RETRIEVAL SYSTEM

SUBROUTINE CALLED FROM KGSEDIT

***** LOGICAL UNIT ASSIGNMENTS *****

LU1 - KGS AUTHOR INDEX FILE

LU2 - KGS AUTHOR DICTIONARY FILE

LU5 - KGS DATA BASE

LU6 - COMMAND DEVICE

LU7 - KGS KEYWORD INDEX FILE

LU8 - KGS KEYWORD DICTIONARY FILE

KGS DATA BASE DATA ELEMENTS

CHARACTER*32,AUTHOR(3)

CHARACTER*12,PUBDAT

CHARACTER*100, TITLE

CHARACTER*32,PUBNAM

CHARACTER*20 .REFER

CHARACTER*16,KEYWRD(6)

CHARACTER*16,DISCPN

CHARACTER*32,HAUTHR(3)

CHARACTER*! 6, HLDKEY (6)

CHARACTER*32,DAUTHR(3)

CHARACTER»16,DISKEY(6)

CHARACTER*4, BUFFER

CHARACTER*78,TITLE1

CHARACTER*35 ,TITLE2

CHARACTER*1 ,AUTIDX(30)

CHARACTER*1 ,WRDIDX(30)

CHARACTER*2, SPACES

CHARACTER*! .ASTRIX

CHARACTER*4,IRESP

INTEGER*2 AUTPTR(30) ,WRDPTR(30) .AUTHCT , WRDCT

C-11
XWTEGER*2 IREC,ILINE,ITYPE,ENDREC

INITIALIZE VALUES

SPACESr' ' ASTRIX='*'

AUTHCT=0

WRDCTrO

5

C

C

C

10

c

cc

c

c

c

c

c

c

c20

OPEN KGS INDEX FILES - AUTHOR & KEYWORD

OPEN ( 1 , IOSTATrISTAT,ERR = 80 10,FILE='KGSIDXA.DTA ' ,RECL = 5

SHAREr'SRO')

OPEN (7,IOSTAT=ISTAT,ERR=8 10,FILE='KGSIDX.DTA ' ,RECL=5,

SHARE='SRO')

BUILD INDEX ARRAYS

FOR DICTIONARY SEARCH

DO 2 1=1 ,30

READ ( 1 ,9000,IOSTAT = ISTAT,END = 3) A UTIDX ( I ) , AUTPTR ( I

AUTHCT=AUTHCT+1

CONTINUE

DO 5 1=1 , 30

READ (7 ,9000 ,I0STAT=ISTAT,END=10) WRDIDX ( I ), WRDPTR ( I

WRDCT=WRDCT+1

CONTINUE

CLOSE INDEXES

CLOSE (1)

CLOSE (7)

OPEN KGS DATA BASE

OPEN (5 , I0STAT = ISTAT,ERR = 80 10,FILE='KGS ' ,RECL = 372,

SHARE='ERW' ,ACCESS=' DIRECT '

INQUIRE (5,SIZE=ENDREC)

«)()(«« UPDATE MODE ««««»

USER ENTERS RECORD # TO BE UPDATED

WRITE (6,9010,ERR=8000)

READ (6,9020,ERR=8000) IRESP

IF (IRESP. EQ.ASTRIX) GO TO 9999

IF (IRESP. EQ. SPACES) GO TO 9999

CONVERT RECORD # TO INTEGER VALUE

CALL CONVERT (IRESP, IREC)

CHECK FOR RECORD PAST END-OF-FILE

C-12
30

35

C

C

CC

70

80

C

C

C

40

C

C

c50

C

C

C

C

C

100

IF (IREC.GT.ENDREC) GO TO 8060

READ KGS DATA BASE RECORD

READ (5,9030,IOSTAT=ISTAT,ERR=8020,REC=IREC)

(AUTHOR(I) ,1=1 ,3) .PUBDAT.TITLE.PUBNAM,

REFER, (KEYWRD(J)

,

J=1 ,6) .DISCPN

DO 30 1=1,3

IF(AUTHOR(I) .EQ. 'DELEDELEDELEDELEDELEDELEDELEDELE' )G0 TO 8070

DAUTHR(I)=AUTHOR(I)

CONTINUE

DO 35 1 = 1 ,6

DISKEY(I)=KEYWRD(I)

CONTINUE

INITIALIZE AUTHOR AND KEYWORD FIELDS TO SPACES

DO 70 1=1 ,3

HAUTHR(I)=SPACES

CONTINUE

DO 80 1 = 1 ,6

HLDKEY(I)=SPACES

CONTINUE

DISPLAY RECORD

CALL KGSDISLN(DAUTHR,PUBDAT,TITLE,PUBNAM,

REFER,DISKEY,DISCPN,IREC)

ENTER LINE # TO BE UPDATED

WRITE (6,9040,ERR=8000)

READ (6,9020,ERR=8000) IRESP

IF (IRESP. EQ.ASTRIX) GO TO 2000

IF (IRESP. EQ. SPACES) GO TO 2000

CALL CONVERT ( IRESP , ILINE ) CHECK FOR VALID LINE #

IF (ILINE. LT. 1 .OR. ILINE. GT. 14) GO TO 8030

UPDATE BASED ON LINE SELECTION

GO TO (100,200,300,400,500,600,700,800,

800,80 0,800,800,800, 1400) , ILINE

UPDATE FIRST AUTHOR FIELD

WRITE (6,9050,ERR=8000) AUTHOR(I)

READ (6,9060,ERR=8000) HA UTHR ( 1 ), BUFFER

IF (BUFFER. NE. SPACES) GO TO 8040

C-13
cc

c200

C

C

C

300

c

c

c400

c

c

c500

C

520

C

550

C

C

C

600

C

C

C

700

DAUTHRd )=HAUTHR(1 ) GO TO 40

UPDATE SECOND AUTHOR FIELD

WRITE (6,9070,ERR=8000) AUTH0R(2)

READ (6,9060,ERR=8000) HAUTHR ( 2 ), BUFFER

IF (BUFFER. NE. SPACES) GO TO 8040

DAUTHR(2)=HAUTHR(2)

GO TO 40

UPDATE THIRD AUTHOR FIELD

WRITE (6,9080 ,ERR=8000) AUTH0R(3)

READ (6,9060,ERR = 8000) HA UTHR ( 3 ) , BUFFER

IF (BUFFER. NE. SPACES) GO TO 8040

DAUTHR(3)=HAUTHR(3)

GO TO 40

UPDATE PUBLICATION DATE

WRITE (6 ,9090ERR = 8000) PUBDAT

READ (6,9100,ERR=8000) PUBDAT

BUFFER

IF (BUFFER. NE. SPACES) GO TO 8040

GO TO 40

UPDATE TITLE FIELD

TITLE1 (1 :65)=TITLE(1 : 65

TITLE2(1:35)=TITLE(66:100)

WRITE (6 ,91 10 ,ERR = 8000) TITLE 1 , TITLE2

READ (6,9120 ,ERR = 8000) TITLE1

READ (6,9130,ERR=8000) TITLE2 , BUFFER

IF (TITLE2.EQ. SPACES) GO TO 550

REMOVE EXTRA SPACES FROM TITLE FIELD

CALL CRAM ( TITLE 1 , TITLE2

CREATE 100 CHARACTER TITLE FIELD

TITLEd :78)=TITLE1 (1 : ) TITLE(79 : )=TITLE2(1 :

GO TO 40

UPDATE PUBLICATION NAME

WRITE (6 ,9140ERR=8000) PUBNAM

READ (6 ,9060 ,ERR=8000) PUBNAM , BUFFER

IF (BUFFER. NE. SPACES) GO TO 8040

GO TO 40

UPDATE REFERENCE FIELD

WRITE (6 ,9150,ERR=8000) REFER

READ (6 ,9160,ERR = 8000) REFER, BUFFER

IF (BUFFER. NE. SPACES) GO TO 8040

GO TO 40

C-14
cc

c800

820

C

C

C

1400

C

C

C

C

C

2000

C

C

C

C

C

C

C

2100

2140

C

2160

C

C

C

UPDATE KEYWORD FIELDS

I=ILINE-7

WRITE (6,9170,ERR=8000) KEYWRD(I)

READ (6,9180,ERR=8000) HLDKEY ( I ), BUFFER

DISKEY(I)=HLDKEY(I)

IF (BUFFER. NE. SPACES) GO TO 8040

GO TO 40

UPDATE DISCIPLINE FIELD

WRITE (6,9190,ERR=8000) DISCPN

READ (6,9180,ERR=8000) DISCPN , BUFFER

IF (BUFFER. NE. SPACES) GO TO 8040

GO TO 40

SAVE UPDATED RECORD?

CALL KGSDISLN ( DA UTHR , PUBDAT , TITLE , PUBNAM

,

REFER,DISKEY,DISCPN,IREC)

WRITE (6,9200,ERR=8000)

READ (6,9020,ERR=8000) IRESP

IF (IRESP. EQ. 'YES •) GO TO 2100

IF ( IRESP. EQ. 'NO ') GO TO 7000

ILINErl

GO TO 8050

UPDATE DICTIONARY FILES

SETUP ARRAYS

DO 2140 1=1 ,

3

IF( HA UTHR(I).EQ. SPACES. AND. DA UTHR(I) . NE . SPA C ES ) AUTHOR ( I

)

=SPACES

CONTINUE

DO 2160 1=1,6

IF(HLDKEY(I) . EQ. SPAC ES . AND . DISKEY ( I ) . NE . SPAC ES ) KEYWRD ( I

)

=SPACES

CONTINUE

DELETE OLD AUTHORS AND KEYWORDS

ITYPE=2

CALL KGSPTRUP ( AUTHOR , KEYWRD

,

IREC , AUTIDX , WRDIDX

,

AUTPTR,WRDPTR,AUTHCT,WRDCT,ITYPE)

IF (ITYPE.EQ.9) GO TO 9999

ADD NEW AUTHORS TO DICTIONARY

ITYPErl

C-15
c

c

c

c

c7000

c

c

c9999

C

C

C

C

C

8000

8005

8010

8015

8020

8025

8030

8035

8040

8045

8050

8055

8060

8065

CALL KGSPTRUP ( HA UTHR , HLDKEY , IR EC , AUTIDX , WRDIDX

AUTPTR,WRDPTR,AUTHCT,WRDCT,ITYPE)

IF (ITYPE.EQ.9) GO TO 9999

REWRITE UPDATED RECORD

WRITE (5,9030,IOSTAT=ISTAT,ERR=80 20,REC=IREC)

( DA UTHR(I), 1=1, 3), PUB DAT, TITLE, PUB NAM,

REFER, (DISKEY(J)

J=1 ,6) ,DISCPN

CONTINUE

WRITE (6,9210, ERR=8000)

READ (6,9020,ERR=8000) IRESP

IF (IRESP. EQ. 'YES ') GO TO 20

ILINE=2

IF (IRESP. NE. 'NO ') GO TO 8050

ISTATrO

CLOSEOUT

CLOSE (5)

RETURN

ERROR REPORTING AND FORMATTING

WRITE ( FORMAT

ISTATrl

GO TO 9

WRITE ( FORMAT

GO TO 9

WRITE ( FORMAT

GO TO 9

WRITE ( FORMAT

GO TO 5

WRITE ( FORMAT

GO TO ( WRITE ( FORMAT

GO TO ( WRITE ( FORMAT

6,8005,ERR=9999)

(/1X, 'COMMAND DEVICE ERROR'/)

999

6,801

(/1X,

999

6,802

(/1X,

999

6,803

(/1X,

IX,

6,804

(/1X,

100,2

820,8

6,805

(/1X,

2000,

6,806

(/1X,

IX,

5,ERR=8000) ISTAT

'ERROR ON OPENING FILE lOSTAT = ' ,14/)

5,ERR=8000) ISTAT

'ERROR ON READING FILE - lOSTAT = ',14/)

5,ERR=8000)

'LINE NUMBER IS OUT OF

•PLEASE ENTER AGAIN'/)

RANGE /,

5,ERR=8000)

'LINE TOO LONG!!! - PLEASE ENTER AGAIN'/)

00,300,40 0,520,600,700,820,

20,820,820 ,820, 1400), ILINE

5,ERR=8000)

'PLEASE RESPOND YES OR NO'/)

7000) .ILINE

5,ERR=8000) ENDREC

'RECORD ENTERED IS PAST END OF FILE'/,

'LAST RECORD // IS ' ,14)

C~16
8070

8075

C

CC

C

C9000

9010

9020

9030

9040

9060

9070

9080

9090

9100

9110

9120

9130

9140

9160

9170

9180

9190

9200

9210

GO TO 7000

WRITE (6,8075 ,ERR=8000)

FORMAT (/1X, 'RECORD HAS

GO TO 7000

I/O FORMATTING

BEEN DELETED'/)

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

9050 FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

9150 FORMAT

FORMAT

FORMAT

FORMAT

FORMAT(

FORMAT

FORMAT

END

(A1 , I (/1X,

(A4)

(3A32

(/1X

IX

(/1X

IX

(A32

(/1X

IX

(/1X

IX

(/1X

IX

(A12

(/1X

IX

(A78

(A35

(/1X

IX

(/1X

IX

(A20

(/1X

(A16

/1X,

(/1X

(/1X

4)

'ENTER

,A12,A

'ENTER

'OR AN

'OLD F

'ENTER

A4)

'OLD S

'ENTER

'OLD T

'ENTER

'OLD P 'ENTER

A4)

'OLD T

'ENTER

if OF RECORD TO BE UPDATED'/)

100,A32,A20,6A16,A16)

# OF LINE TO BE UPDATED'/,

» TO END'/)

IRST AUTHOR IS ' ,A32/,

NEW FIRST AUTHOR'/)

ECOND AUTHOR IS ' ,A32/,

NEW SECOND AUTHOR'/)

HIRD AUTHOR IS ' ,A32/

,

NEW THIRD AUTHOR'/)

UBLICATION DATE IS ',A12/,

NEW PUBLICATION DATE'/)

ITLE IS ' ,/1X,A78/, 1X,A35/,

NEW TITLE'/)

A4)

'OLD PUBLICATION NAME IS ',A32/,

'ENTER NEW PUBLICATION NAME'/)

'OLD REFERENCE IS ' ,A20/,

'ENTER NEW REFERENCE'/)

A4)

'OLD KEYWORD IS ' , A 1 6 / , 1 X ,

' ENTE R NEW KEYWORD'/)

A4)

OLD DISCIPLINE IS ' , A 1 6 / , 1 X ,

' ENTE R NEW DISCIPLINE'/)

'SAVE O.K.? '/)

'DO YOU WANT TO CONTINUE IN UPDATE MODE?'/)

C-17
50

100

Cc

CRAM

SUBROUTINE CRAM ( TITLE 1 , TITLE2

WRITTEN BY JUDITH CALABRESE - 25 SEPTEMBER 1981

THIS SUBROUTINE REMOVES EXTRA SPACES FROM FIRST LINE OF THE

TITLE FIELD.

IT ALSO JOINS THE SECOND LINE TO THE FIRST.

ARGUMENTS

TITLE1 - FIRST LINE OF TITLE FIELD (78 CHARACTERS).

TITLE2 - SECOND LINE OF TITLE (35 CHARACTERS).

CHARACTER*78,TITLE1

CHARACTER*35,TITLE2

CHARACTER*2, SPACES

CHARACTER*2,H0LD

INITIALIZE VALUES

SPACESr' ' IBYTErO

REMOVE SPACES FROM FIRST LINE

DO 100 1=1 ,77

IBYTE=IBYTE+1

LAST=IBYTE+1

HOLDd :2)=TITLE1 (IBYTE:LAST)

IF (HOLD. EQ. SPACES) GO TO 50

ICTRrO

GO TO 100

J=IBYTE+1

TITLE 1 (IBYTE: ) = TITLE1 (J : ) IBYTE=IBYTE-1

LAST=LAST-1

ICTR=ICTR+1

CONTINUE

CALCULATE # OF TRAILING SPACES ON FIRST LINE

C-18
c200

C

C

C

C

C

300

C

C

C

9999

C

C

C

C

C

8000

8005

8010

8015

IFILL=78-(ICTR-1 ) IF (IFILL.GT.78) GO

IFILL2=IFILL+1

IBYTErO

TO 300

ADD SECOND LINE TO FIRST

DO 200 1=1 ,35

IBYTE=IBYTE+1

HOLDd : 1 )=TITLE2(IBYTE:IBYTE)

TITLE1 (IFILL:IFILL) = H0LD(1 : 1 ) J=IBYTE+1

TITLE2(IBYTE: )=TITLE2(J:

)

IFILL=IFILL+1

IFILL2=IFILL2+1

IF (IFILL.GT.78) GO TO 300

IBYTE=IBYTE-1

CONTINUE

CHECK FOR LINE TOO LONG

HOLDd :2) = TITLE2(23:24)

IF (HOLD. NE. SPACES) GO TO 8010

RETURN

RETURN

ERROR REPORTING & FORMATTING

WRITE (6,8005,ERR=9999)

FORMAT (IX, 'COMMAND DEVICE ERROR')

GO TO 9999

WRITE (6,8015,ERR = 8000) TITLE 1 , TITLE2

FORMAT (/1X, 'TITLE TOO LONG - TRUNCATED

GO TO 9999

END

TO'/, 1X,A78/, 1X,A22/)

C~19
K G S D E L

SUBROUTINE KGSDEL ( ISTAT

WRITTEN BY JUDITH CALABRESE - 9 OCTOBER 1981

ALLOWS THE USER TO DELETE RECORDS FROM

THE KGS DATA BASE

NOTE: RECORDS ARE MARKED FOR DELETION.

THIS SUBROUTINE DOES NOT RESEQUENCE THE DATA BASE

THIS SUBROUTINE IS CALLED FROM KGSEDIT

***** LOGICAL UNIT ASSIGNMENTS *****

LU1 - KGS AUTHOR INDEX FILE

LU2 - KGS AUTHOR DICTIONARY FILE

LU5 - KGS DATA BASE

LU6 - COMMAND DEVICE

LU7 - KGS KEYWORD INDEX FILE

LU8 - KGS KEYWORD DICTIONARY FILE

KGS DATA BASE DATA ELEMENTS

CHARACTER* 32, AUTH0R(3)

CHARACTER*12,PUBDAT

CHARACTER*100 .TITLE

CHARACTER*32,PUBNAM

CHARACTER*20, REFER

CHARACTER*16,KEYWRD(6)

CHARACTER*16,DISCPN

CHARACTER*!, A UTIDX(30)

CHARACTER*! ,WRDIDX(30)

CHARACTER*4 ,IRESP

INTEGER*2 AUTPTR(30),WRDPTR(30) , AUTHCT , WRDCT

INTEGER*2 I REC , ITYPE , ENDREC

INITIALIZE VALUES

AUTHCT=0

WRDCT=0

C-20
OPEN KGS INDEX FILES - AUTHOR & KEYWORD

5

C

C

C

10

C

C

C

C

C

C

C

cc

cc20

C

C

C

c

c

c

c

c

c

OPEN (1 ,IOSTAT = ISTAT,ERR=80 10,FILE='KGSIDXA.DTA' ,RECLr5,

SHAREr'SRO')

OPEN (7,IOSTAT=ISTAT,ERR=8010,FILE='KGSIDX.DTA' ,RECL=5,

SHAREr'SRO')

BUILD INDEX ARRAYS

FOR DICTIONARY SEARCH

DO 2 1=1 ,30

READ (1 ,9000,IOSTAT=ISTAT,END=3) AUTIDX( I )

, AUTPTR ( I

)

AUTHCT=AUTHCT+1

CONTINUE

DO 5 1=1 ,30

READ (7,9000,IOSTAT=ISTAT,END=10) WRDIDXC I )

, WRDPTR ( I

)

WRDCT=WRDCT+1

CONTINUE

CLOSE INDEXES

CLOSE (1)

CLOSE (7)

OPEN KGS DATA BASE

OPEN (5,IOSTAT=ISTAT,ERR=8010,FILE='KGS» ,RECL=372,

SHARE='ERW' , ACCESS =' DIRECT '

)

INQUIRE (5,SIZE=ENDREC)

«»»»« DELETE MODE «««»«

ACCEPT RECORD NUMBER FROM USER

WRITE (6,9010,ERR=8000)

READ (6,9020,ERR=8000) IRESP

CONVERT RECORD NUMBER TO INTEGER VALUE

CALL CONVERT (IRESP, IREC)

CHECK FOR RECORD PAST END-OF-FILE

IF (IREC.GT.ENDREC) GO TO 8050

READ KGS DATA BASE RECORD

READ (5,9030,IOSTAT=ISTAT,ERR=8020,REC=IREC)

(AUTHOR (I) ,1=1 ,3) ,PUBDAT,TITLE,PUBNAM,

REFER,(KEYWRD(J) ,J=1 ,6) ,DISCPN

IF(AUTH0R(1 ) .EQ. 'DELEDELEDELEDELEDELEDELEDELEDELE' )G0 TO 8040

DISPLAY RECORD

C-21
100

c

cc7000

C

c

c

cc9999

C

C

C

C

C

8000

8005

8010

8015

8020

8025

8030

CALL KGSDISLN ( AUTHOR , PUBDAT , TITLE , PUBNAM

REFER.KEYWRD.DISCPN.IREC)

DELETE THIS RECORD?

WRITE (6,9040ERR=8000)

READ (6,9020,ERR=8000) IRESP

IF (IRESP. NE. 'YES ') GO TO 7000

UPDATE KGS DICTIONARY FILES

ITYPE=2

CALL KGSPTRUP ( AUTHOR , KEYWRD

IREC , AUTIDX , WRDIDX , AUTPTR,WRDPTR,AUTHCT,WRDCT,ITYPE)

IF (ITYPE.EQ.9) GO TO 9999

REWRITE DELETED RECORD

DO 100 1=1 ,

AUTHOR ( I )= 'DELE DELE DELE DELE DELE DELE DELE DELE'

CONTINUE

WRITE (5, 9030, IOSTATrISTAT,ERR = 80 30,REC = IREC)

(A UT HO R(I), 1=1, 3), PUB DAT, TITLE, PUB NAM,

REFER, (KEYWRD(J) ,J=1 ,6) , DISC PN

CONTINUE

WRITE (6,9050,ERR=8000)

READ (6,9020,ERR=8000) IRESP

IF (IRESP. EQ. 'YES ') GO TO 20

IF ( IRESP. NE. 'NO ') GO TO 8060

ISTATrO

RETURN

CLOSE (5)

RETURN

ERROR REPORTING AND FORMATTING

WRITE (6 ,8005 ,ERR = 9999)

FORMAT (/1X, 'COMMAND DEVICE ERROR'/)

ISTAT=1

GO TO 9999

WRITE (6,8015 ,ERR=8000) ISTAT

FORMAT (/1X, 'ERROR ON OPENING FILE - lOSTAT

GO TO 9999

WRITE (6,8025 ,ERR = 8000) ISTAT

FORMAT (/1X, 'ERROR ON READING FILE - lOSTAT

GO TO 9999

WRITE (6,8035 ,ERR=8000) ISTAT

' ,14/)

' ,14/)

C-22
80

80

80

80

80

80

80

C

CC

CC

90

90

90

90

90

90

35 FORMAT (/1X, 'ERROR ON WRITING FILE - lOSTAT = ',14/)

GO TO 9999

40 WRITE (6 ,8045 ,ERR=8000)

45 FORMAT (/1X, 'RECORD HAS ALREADY BEEN DELETED'/)

GO TO 7000

50 WRITE (6,8055 ,ERR=8000) ENDREC

55 FORMAT (/1X, 'RECORD ENTERED IS PAST END-OF-F ILE ' / , IX, 'LAST RECORD NUMBER IS ',14/)

GO TO 7000

60 WRITE (6,8065 ,ERR=8000)

65 FORMAT (/1X, 'PLEASE RESPOND YES OR NO'/)

GO TO 7000

I/O FORMATTING

00

10

20

30

40

50

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

END

(A1 ,14)

(/1X, 'ENTER # OF RECORD TO BE DELETED'/)

(A4)

(3A32,A12,A100,A32,A20,6A16,A16)

(/1X, 'DELETE THIS RECORD?'/)

(/1X,'D0 YOU WANT TO CONTINUE IN DELETE MODE?'/)

C-23
20

C

C

C

40

50

C

C

C

CONVERT

SUBROUTINE CONVERT ( ASC I I , INTGER

WRITTEN BY JUDITH CALABRESE - 13 OCTOBER 1981

CONVERTS ASCII VALUE TO INTEGER

AFTER RIGHT JUSTIFYING FIELD

CHARACTER*^, ASCII

CHARACTER*^, FIELD

CHARACTER*1 .HLDCHR

INTEGER»2 INTGER

FIELDrASCII

J = 1 RIGHT JUSTIFY ASCII FIELD

DO 20 1 = 4, 1 ,-1

J=J + 1 HLDCHRd : 1 )=ASCII(I:I)

if (hldchr. ne. ' ') go to 40

fields' ' fieldcj : )=ascii(1 : ) continue

convert field to integer

decode (field, 50) intger

FORMAT (14)

RETURN

RETURN

END

C-24
KGSDISLN

SUBROUTINE KGSDISLN ( AUTHOR , PUBDAT , TITLE , PUBNAM

,

REFER,KEYWRD,DISCPN,IREC)

WRITTEN BY JUDITH CALABRESE - 25 SEPTEMBER 1981

DISPLAYS KGS RECORD WITH LINE # FOR

ADD

DELETE

UPDATE

MODES.

CHARACTER*32,AUTHOR(3)

CHARACTER*12 .PUBDAT

CHARACTER»100 .TITLE

CHARACTER*32. PUBNAM

CHARACTER*20 .REFER

CHARACTER*16 .KEYWRD(6)

CHARACTER*16 .DISCPN

CHARACTER*50,TITLE1(2)

INTEGER*2 IREC

SPLIT TITLE FIELD

TITLE1(1)(1:50)=TITLE(1:50)

TITLE1(2)(1;50)=TITLE(51:)

WRITE

WRITE

WRITE

WRITE

WRITE

WRITE

WRITE

WRITE

WRITE

(6

(6

(6

(6

(6

(6

(6

(6

(6

9000

9010

9020

9030

9035

9040

9050

9060

9070

ERR=8000)

ERR=8000)

ERR=8000)

ERR=8000)

ERR=8000)

ERR=8000)

ERR=8000)

ERR=8000)

ERR=8000)

IREC

AUTHORC 1

)

AUTH0R(2)

AUTH0R(3)

PUBDAT

(TITLE1 (I)

PUBNAM

REFER

1=1 ,2)

C-25
c

c

c9999

C

C

C

C

C

8000

8005

C

C

C

C

c9000

9010

9020

9030

9035

9040

9050

9060

9070

9080

9090

9100

91 10

9120

9130

9140

C

C

WRITE

WRITE

WRITE

WRITE

WRITE

WRITE

WRITE

(6

(6

(6

(6

(6

(6

(6

9080

9090

9100

91 10

9120

9130

9140

RETURN

ERR=8000)

ERR=8000)

ERRr8000)

ERR=8000)

ERR=8000)

ERR=8000)

ERR=8000)

KEYWRDd ) KEYWRD(2)

KEYWRD(3)

KEYWRD(4)

KEYWRD(5)

KEYWRD(6)

DISCPN

RETURN

ERROR REPORTING AND FORMATTING

WRITE (6,8005,ERR=9999)

FORMAT (/1X, 'COMMAND DEVICE

GO TO 9999

I/O FORMATTING

ERROR'/)

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

FORMAT

END

(/1X,

(IX,'

(IX

(IX

(IX

(IX

1 IX !a

(IX

(IX

(IX

(IX

(IX

(IX

(IX

(IX

(IX

(/I)(,

I «tt«««»«»»« RECORD # ' ,14 t ««««««««»» t

LINE 1 - ',A32)

LINE 2 - ' ,A32)

LINE 3 - ' ,A32)

LINE 4 - ' ,A12)

LINE 5 - ' ,A50/,

50)

LINE 6 - ' ,A32)

LINE 7 - ' ,A20) ***** KEYWORDS

LINE 8 - ' ,A16)

LINE 9 - ' ,A16)

LINE 10 - ' ,A16)

LINE 11 - ' ,A16)

LINE 12 - ' ,A16)

LINE 13 - ' ,A16)

'LINE 14 - • ,A16/)

««««« I

C-26
c

c

c

cc

C KGSPTRUP

c

c

c

c SUBROUTINE KGSPTRUP(AUTHOR,KEYWRD, IREC ,AUTIDX,WRDIDX,

AUTPTR,WRDPTR,AUTHCT,WRDCT,ITYPE)

C

C WRITTEN BY JUDITH CALABRESE - 7 OCTOBER 1981

C

C

C UPDATES POINTERS ON KGS DICTIONARY FILES

C

C »»«»« LOGICAL UNIT ASSIGNMENTS *****

C

C LU2 - KGS AUTHOR DICTIONARY FILE

C LU8 - KGS KEYWORD DICTIONARY FILE

C LU6 - COMMAND DEVICE

C

C ARGUMENTS PASSED

C

C AUTHOR - READ FROM KGS DATA BASE

C KEYWRD - READ FROM KGS DATA BASE

C IREC - RECORD NUMBER ON KGS DATA BASE

C AUTIDX - AUTHOR INDEX (POINTS TO DICTIONARY FILE)

C WRDIDX - KEYWORD INDEX (POINTS TO DICTIONARY FILE)

C AUTHCT - COUNT OF CELLS ON AUTHOR INDEX

C WRDCT - COUNT OF CELLS ON KEYWORD INDEX

C ITYPE - 1 = APPEND MODE

C 2 = DELETE MODE

C 9 = RETURN CODE ERROR

C

C

c CHARACTER*32,AUTHOR(3)

CHARACTER*! 6, KEYWRD(6)

C

CHARACTER*! ,AUTIDX(30)

CHARACTER*! ,WRDIDX(30)

C

CHARACTER* I.HLDCHR

CHARACTER*2, SPACES

C

CHARACTER*32,AUTHDC

CHARACTER*! 6, WRDDCN

C

INTEGER*2 AUTPTR( 30 ) .WRDPTR ( 30 )

, ICELL , REGNO ( 60

)

INTEGER*2 KREC, WRDCT, AUTHCT, IREC, lOVFLW, ITYPE

C

C INITIALIZE VALUES

C

C-27
SPACES=' ' C

c

C ««*** AUTHOR *****

C

C

C OPEN AUTHOR DICTIONARY

C

OPEN (2,IOSTAT=ISTAT,ERR=8010,FILE='KGSAUTH.DTA' ,RECL=232,

SHAREr'ERW ,ACCESS='DIRECT')

C

C FIND START OF OVERFLOW RECORDS IN DICTIONARY

C

READ (2,9000,IOSTAT=ISTAT,REC=1) lOVFLW

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.3I.OR.ISTAT.EQ.32) THEN

I0VFLW=1

WRITE (2,9000,I0STAT=ISTAT,ERR=8040,REC=1) lOVFLW

END IF

C

C SEARCH INDEX FOR POINTER TO DICTIONARY

C

DO 700 1=1 ,3

IF (AUTHOR(I).EQ. SPACES) GO TO 700

HLDCHR(1:)=AUTH0R(I)(1 :1)

CALL SEARCH (AUTIDX.AUTHCT.HLDCHR.ICELL)

IF (ICELL.EQ.O) GO TO 200

KREC=AUTPTR(ICELL)

C

C FIND AUTHOR IN DICTIONARY

C

100 READ (2,9010,IOSTAT=ISTAT,REC=KREC) AUTHDC , (RECNO( J) , J=1 ,50)

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.3I.OR.ISTAT.EQ.32) GO TO 300

IF (ISTAT.NE.O) GO TO 8020

KREC=KREC+1

IF ( AUTHDC. LT. AUTHOR (I)) GO TO 100

IF ( AUTHDC. EQ. AUTHOR (I). AND. ITYPE.EQ.1) GO TO 400

IF (AUTHDC. EQ.AUTHOR(I). AND. ITYPE.EQ. 2) GO TO 500

C

C SEARCH OVERFLOW FOR MATCH

C

200 KREC=I0VFLW+1

220 READ (2,9010,IOSTAT=ISTAT,REC=KREC) AUTHDC , (RECNO( J) , J=1 ,50)

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.3I.OR.ISTAT.EQ.32) GO TO 300

IF (ISTAT.NE.O) GO TO 8020

KREC=KREC+1

IF (AUTHDC.NE.AUTHOR(I)) GO TO 220

IF ( AUTHDC. EQ. AUTHOR (I). AND. ITYPE.EQ.1) GO TO 400

IF (AUTHDC. EQ.AUTHOR(I). AND. ITYPE.EQ. 2) GO TO 500

C

C AUTHOR NOT IN DICTIONARY

C

300 RECN0(1)=IREC

DO 350 J =2, 50

C-28
RECNO(J)=0

350 CONTINUE

KREC=KREC+1

GO TO 600

C

C ADD RECORD NUMBER TO AUTHOR IN DICTIONARY

C

400 DO 450 J = 1 ,50

IF (RECNO(J).NE.O) GO TO 450

RECNO(J)=IREC

GO TO 600

450 CONTINUE

ICELL=I

GO TO 8030

C

C DELETE RECORD NUMBER FROM DICTIONARY

C

500 DO 550 J=1,50

IF (RECNO(J).EQ.O) GO TO 600

IF (RECNO(J).NE.IREC) GO TO 550

DO 520 K=J,50

RECN0(K)=RECN0(K+1)

IF (RECNO(K).EQ.O) GO TO 600

520 CONTINUE

550 CONTINUE

C

'

C REWRITE AUTHOR DICTIONARY RECORD

C

600 KREC=KREC-1

WRITE(2,9010,IOSTAT=ISTAT,ERR=8040,REC=KREC)

AUTH0R(I),(RECN0(J),J=1,50)

C

700 CONTINUE

C

C »»»*» KEYWRD *****

C

C

C OPEN KEYWRD DICTIONARY

C

OPEN (8,IOSTAT=ISTAT,ERR=8010,FILE='KGSKEY.DTA' ,RECL=256,

SHARE='ERW' ,ACCESS='DIRECT')

C

C FIND START OF OVERFLOW RECORDS IN DICTIONARY

C

READ (8,9000,IOSTAT=ISTAT,REC=1) lOVFLW

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.31.0R.ISTAT.EQ.32) THEN

lOVFLWrl

WRITE (8,9000,IOSTAT=ISTAT,ERR=8040,REC=1) lOVFLW

END IF

C

C SEARCH INDEX FOR POINTER TO DICTIONARY

C

DO 1700 1=1,6

IF (KEYWRD(I).EQ. SPACES) GO TO 1700

HLDCHR (1 : ) =KEYWRD( I ) ( 1 : 1

)

C-29
CALL SEARCH (WRDIDX.WRDCT.HLDCHR, ICELL)

IF (ICELL. EQ.O) GO TO 1200

KREC=WRDPTR( ICELL)

C

C FIND KEYWRD IN DICTIONARY

C

1100 READ (8,9020,IOSTAT=ISTAT,REC=KREC) WRDDCN, (RECNO(J) , J=1 ,60)

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.31.0R.ISTAT.EQ.32) GO TO 1300

IF (ISTAT.NE.O) GO TO 8020

KREC=KREC+1

IF (WRDDCN.LT.KEYWRD(I)) GO TO 1100

IF (WRDDCN. EQ.KEYWRD(I). AND. ITYPE.EQ.1) GO TO 1400

IF (WRDDCN. EQ.KEYWRD(I). AND. ITYPE.EQ. 2) GO TO 1500

C

C SEARCH OVERFLOW FOR MATCH

C

1200 KREC=I0VFLW+1

1220 READ (8,9020,IOSTAT=ISTAT,REC=KREC) WRDDCN, (RECNO( J) , J=1 ,60)

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.31.0R.ISTAT.EQ.32) GO TO 1300

IF (ISTAT.NE.O) GO TO 8020

KREC=KREC+1

IF (WRDDCN.NE.KEYWRD(I)) GO TO 1220

IF (WRDDCN. EQ.KEYWRD(I). AND. ITYPE.EQ.1) GO TO 1400

IF (WRDDCN. EQ.KEYWRD(I). AND. ITYPE.EQ. 2) GO TO 1500

C

C KEYWRD NOT IN DICTIONARY

C

1300 RECN0(1)=IREC

DO 1350 J=2,60

RECNO(J)=0

1350 CONTINUE

KREC=KREC+1

GO TO 1600

^~

C

C ADD RECORD NUMBER TO KEYWRD IN DICTIONARY

C

1400 DO 1450 J=1 ,60

IF (RECNO(J).NE.O) GO TO 1450

RECNO(J)=IREC

GO TO 1600

1450 CONTINUE

ICELLrl

GO TO 8030

C

C DELETE RECORD NUMBER FROM DICTIONARY

C

1500 DO 1560 J=1 ,60

IF (RECNO(J).EQ.O) GO TO 1600

IF (RECNO(J).NE.IREC) GO TO 1560

DO 1520 K=J,60

RECN0(K)=RECN0(K+1)

IF (RECNO(K).EQ.O) GO TO 1600

1520 CONTINUE

1560 CONTINUE

C-30

I

1

I
c

C REWRITE KEYWRD DICTIONARY RECORD

C

1600 KREC=KREC-1

WRITE (8 , 9020 , IOSTAT=ISTAT , ERR=8040 , REC=KREC)

KEYWRD(I) ,(RECN0(J) ,J=1 ,60)

C

1700 CONTINUE

C

C

C RETURN

C

C

9999 CLOSE (2)

CLOSE (8)

RETURN

C

C ERROR REPORTING AND FORMATTING

C

8000 WRITE (6,8005, ERR=9999)

8005 FORMAT (/ IX , 'COMMAND DEVICE ERROR'/)

ITYPE=9

GO TO 9999

8010 WRITE (6,8015,ERR=8000) ISTAT

8015 FORMAT (/1X, 'ERROR ON OPENING FILE - lOSTAT = ',IM/)

ITYPE=9

GO TO 9999

8020 WRITE (6,8025,ERR=8000) ISTAT

8025 FORMAT (/1X, 'ERROR ON READING FILE - lOSTAT = ',14/)

ITYPE=9

GO TO 9999

8030 WRITE (6,8035,ERR=8000) AUTHOR(ICELL)

8035 FORMAT (/1X, 'DICTIONARY OVERFLOW ON AUTHOR - ' ,A32/)

ITYPE=9

GO TO 9999

8040 WRITE (6,8045,ERR=8000) ISTAT

8045 FORMAT (/1X, 'ERROR ON WRITING FILE - lOSTAT = ',14/)

ITYPE=9

GO TO 9999

C

C I/O FORMATTING

C

9000 FORMAT (14)

9010 FORMAT (A32,50I4)

9020 FORMAT (A16,60I4)

END

C-31
SUBROUTINE KGSEXTRT(ISTAT)

C

C WRITTEN BY JUDITH CALABRESE - 21 JULY 1981

C

C MAIN PROGRAM OF THE KGS EXTRACT MODE.

C

C PROVIDES FOR RETRIEVAL OF KGS DATA BASE RECORDS

C BASED ON THE FOLLOWING PARAMETERS:

C

C AUTHOR

C KEYWORDS (1 TO 6)

C

C

C LOGICAL UNIT ASSIGNMENTS

C

C LU6-C0MMAND DEVICE

C

C

C WRITE MAIN HEADING

C

WRITE (6,9000,ERR=8000)

C

C ACCEPT PARAMETERS FROM USER

C

100 WRITE (6,9010,ERR=8000)

READ (6,9020,ERR=8000) IPARAM

IF ( IPARAM. EQ.'AUTH') GO TO 200

IF ( IPARAM. EQ. 'KEY ' ) GO TO 300

IF ( IPARAM. EQ. 'ALL • ) GO TO 400

IF ( IPARAM. EQ.' ' ) GO TO 9999

GO TO 8010

C

C AUTHOR EXTRACT

C ~-- 200 CALL KGSAUTHX(ISTAT)

IF (ISTAT.NE.O) GO TO 9999

GO TO 500

C

C KEY EXTRACT

C

300 CALL KGSKEYEX(ISTAT)

IF (ISTAT.NE.O) GO TO 9999

GO TO 500

C

C ALL EXTRACT

C

400 CALL KGSALL(ISTAT)

IF (ISTAT.NE.O) GO TO 9999 |

GO TO 500 "i C

C CONTINUE

C

500 WRITE (6,9030,ERR=8000)

READ (6,9020,ERR=8000) IRESP

IF ( IRESP. EQ. 'YES ') GO TO 100

C-32

I
IF (IRESP.EQ.'NO • ) GO TO 9999

GO TO 8020

C

C CLOSEOUT

C

9999 RETURN

C

C ERROR REPORTING AND FORMATTING

C

8000 WRITE (6,8005,ERR=9999)

8005 FORMAT (/1X, 'COMMAND DEVICE ERROR'/)

GO TO 9999

8010 WRITE (6,8015,ERR=9999)

8015 FORMAT (/1X, ' INVALID RESPONSE - PLEASE ENTER AGAIN'/)

GO TO 100

8020 WRITE (6,8025,ERR=8000)

8025 FORMAT (/1X, 'PLEASE RESPOND YES OR NO'/)

GO TO 500

C

I/O FORMATTING

C

9000 FORMAT (//////////////20X, 'K GS PUBLICATION S',//1X,

- lOX.'D ATA BASE RETRIEVAL MOD E'////)

9010 FORMAT (/1X, 'ENTER EXTRACT CRITERIA (AUTHOR, KEY, OR ALL)'/)

9020 FORMAT (AM)

9030 FORMAT (/1X,'D0 YOU WISH TO CONTINUE?'/)

END

C-33
c

c

cc

C KGSAUTHX

C

C

C

SUBROUTINE KGSAUTHX(ISTAT)

C

C WRITTEN BY JUDITH CALABRESE - 31 AUGUST 1981

C

C SUBROUTINE CALLED BY KGSEXTRT.

C

C SEARCHES THE AUTHOR FIELDS FOR A MATCH

C WITH A USER-SUPPLIED AUTHOR NAME.

C

C * LOGICAL UNIT ASSIGNMENTS * C

C LU1-KGSINDEX AUTHOR DATA FILE

C LU2-KGSAUTH.DTA (KGS AUTHOR DICTIONARY FILE)

C LU3-PRINT DEVICE

C LU4-KGS DATA BASE

C LU6-C0MMAND DEVICE

C

CHARACTER*32,INAUTH

CHARACTER»32,DCNNAM

CHARACTER*16,INKEY(6)

CHARACTER*1 ,INDEX(30)

CHARACTER* l.HLDCHR

C

C DATA ELEMENTS READ FROM KGS DATA BASE RECORD

C

CHARACTER«32 .AUTHOR ( 3

CHARACTER* 1 2, PUBDAT

CHARACTER* 100, TITLE

CHARACTER*32,PUBNAM

CHARACTER*20, REFER

CHARACTER*16,KEYWRD(6)

CHARACTER* 1 6, DISCPN

C

INTEGER IDATE(3)

INTEGER*2 RECNO(50) ,POINTR(30) .ISTAT.ILINE

INTEGER*2 ICELL.IOVFLW, IPRTSW.IPRTCT.IDXCT

INTEGER*2 I0VFL1 .IPAGE.KREC

C

C INITIALIZE VALUES

C

IDXCTrO

ISUBrO

IPRTSWrO

IPRTCT=0

IPAGE=1

IANDOR=0

C

C DATE ROUTINE

C-34
CALL DATE (IDATE)

C

C ACCEPT AUTHOR NAME FROM USER

C

WRITE (6,9000,ERR=8000)

READ (6,9010,ERR=8000) INAUTH

IF ( INAUTH. EQ.' • ) GO TO 9999

HLDCHRrlNAUTH

C

C BUILD INDEX ARRAY FROM INDEX FILE

C

OPEN (1 ,I0STAT=ISTAT,ERR-r8010,FILE='KGSIDXA.DTA' ,RECL=5,

SHAREr'SRO')

DO 100 1=1,30

READ (1, 9020, I0STAT=ISTAT,ERR=8020,END= 150) INDEX(I) ,POINTR(I)

IDXCT=IDXCT+1

100 CONTINUE

150 CLOSE (1,IOSTAT=ISTAT,ERR=8030)

C

C OPEN DICTIONARY

C

OPEN (2,I0STAT=ISTAT,ERR=8010,FILE='KGSAUTH.DTA' ,RECL=232,

SHARE='SRO' ,ACCESS=' DIRECT')

C

C FIND START OF OVERFLOW RECORDS ON DICTIONARY

C

READ (2,9030,IOSTAT=ISTAT,REC=1) lOVFLW

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.31.0R.ISTAT.EQ.32) GO TO 8060

IF (ISTAT.NE.O) GO TO 8020

C

C BINARY SEARCH OF INDEX

C

CALL SEARCH (INDEX, IDXCT,HLDCHR,ICELL)

IRECrPOINTRdCELL)

IF (ICELL.GT.O) GO TO 200

GO TO 220

C

C FIND AUTHOR IN DICTIONARY

C

200 READ (2,9040,IOSTAT=ISTAT,REC=IREC)

DCNNAM,(RECNO(I),I=1,50)

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.31.0R.ISTAT.EQ.32) GO TO 8040

IF (ISTAT.NE.O) GO TO 8020

IREC=IREC+1

IF (DCNNAM.LT. INAUTH) GO TO 200

IF (DCNNAM.EQ. INAUTH) GO TO 300

C

C SEARCH DICTIONARY OVERFLOW FOR AUTHOR

C

220 lOVFLIsIOVFLW

250 READ (2,9040,IOSTAT=ISTAT,REC=IOVFL1)

DCNNAM,(RECNO(I) ,1=1 ,50)

C CHECK FOR END-OF-FILE CONDITION

C-35
IF (ISTAT.EQ.3I.OR.ISTAT.EQ.32) GO TO 8040

IF (ISTAT.NE.O) GO TO 8020

I0VFL1=I0VFL1+1

IF (DCNNAM.EQ.INAUTH) GO TO 300

GO TO 250

C

C CLOSE AUTHOR DICTIONARY

C OPEN KGS DATA BASE

C

300 CLOSE (2,IOSTAT=ISTAT,ERR=8030)

OPEN (5,IOSTAT=ISTAT,ERR=8010,FILE='KGS' ,RECL=372,SHARE='SRO'

ACCESSr'DIRECT')

C

C

C ALTERNATE PRINT OPTION

C

C HARD COPY OUTPUT - IPRTSW=1

C OUTPUT ONLY ON TERMINAL - IPRTSW=0

C

350 WRITE (6,9050,ERR=8000)

READ (6,9060,ERR=8000) IRESP

IF (IRESP. EQ. 'NO ') GO TO 400

IF (IRESP. NE. 'YES ') GO TO 8050

OPEN (3,IOSTAT=ISTAT,ERR=8010,FILE='PR2: ')

IPRTSW=1

C

C RETRIEVE RECORDS FROM KGS DATA BASE

C

400 DO 450 1=1,50

IF (RECNO(I).EQ.O) GO TO 500

READ(5,9070,IOSTAT=ISTAT,ERR=8020.REC=RECNO(I))(AUTHOR(J),J=1,3),

- PUBDAT, TITLE, PUBNAM, REFER, (KEYWRD(K),K=1, 6), DISCPN

C

C DISPLAY RECORD

C

KRECrRECNOd)

CALL KGSDSPLY(INKEY,INAUTH,IDATE,KREC,

lANDOR , IPRTSW , IPAGE , IPRTCT

- AUTHOR , PUBDAT , TITLE , PUBNAM , REFER , KEYWRD , DISCPN

450 CONTINUE

C CLOSEOUT

C

500 CLOSE (5,IOSTAT=ISTAT,ERR=8030)

CLOSE (3,IOSTAT=ISTAT,ERR=8030)

ISTATrO

C

C RETURN

C

9999 RETURN

C

C ERROR REPORTING AND FORMATTING

C

8000 WRITE (6,8005,ERR=9999)

8005 FORMAT (/ IX, 'COMMAND DEVICE ERROR'/)

GO TO 9999

C-36
8010 WRITE (6,8015,ERR=8000) ISTAT

8015 FORMAT (/1X, 'ERROR ON OPENING FILE - lOSTAT = ',14/)

PAUSE

GO TO 9999

8020 WRITE (6,8025,ERR=8000) ISTAT

8025 FORMAT (/1X, 'ERROR ON READING FILE - lOSTAT = ',14/)

PAUSE

GO TO 9999

8030 WRITE (6,8035,ERR=8000) ISTAT

8035 FORMAT (/1X, 'ERROR ON CLOSING FILE - lOSTAT r ',14/)

PAUSE

GO TO 9999

8040 WRITE (6,8045,ERR=8000) INAUTH

8045 FORMAT (/1X, 'AUTHOR NAME NOT IN DICTIONARY - ' ,A32/)

GO TO 500

8050 WRITE (6,8055,ERR=8000)

8055 FORMAT (/1X, 'PLEASE RESPOND YES OR NO'/)

GO TO 350

8060 WRITE (6,8065,ERR=8000)

8065 FORMAT (/IX.'NO NAMES IN AUTHOR DICTIONARY'/)

GO TO 500

C

C I/O FORMATTING

C

9000 FORMAT (/ IX, 'ENTER AUTHORS NAME - (DOE, J. J.) ', '- FORMAT MUST MATCH RECORD'/)

9010 FORMAT (A32)

9020 FORMAT (A1,I4)

9030 FORMAT (14)

9040 FORMAT (A32,50I4)

9050 FORMAT (/1X, 'ALTERNATE PRINT OPTION?'/)

9060 FORMAT (A4)

9070 FORMAT (3A32,A12,A100,A32,A20 ,6A16,A16)

END

C-37
cc

c

c

C KGSKEYEX

C

C

C

SUBROUTINE KGSKEYEX (ISTAT)

C

C WRITTEN BY JUDITH CAUBRESE - 12 AUGUST 1981

C

C SUBROUTINE CALLED BY KGSEXTRT.

C

C PROVIDES THE KEYWORD RETRIEVAL FUNCTION.

C

C « FIELD * C

C A FIELD SEARCH SEARCHES THE KGSDCTNY FILE FOR THE

C DIRECT ADDRESS OF ALL KGS RECORDS CONTAINING THE

C ENTERED KEYWORDS. ONLY THE KEYWORD FIELD OF THE

C DATA BASE IS SEARCHED.

C THIS MODE ALSO PROVIDES UNION(OR)/INTERSECTION(AND)

C CAPABILITY FOR RECORD RETRIEVAL.

C

C » STRING » C

C A STRING SEARCH SEARCHES THE TITLE FIELD OF ALL

C RECORDS ON THE KGS DATA BASE FOR A MATCH WITH

C ENTERED KEYWORDS. THE KGS DATA BASE IS READ

C SEQUENTIALLY.

C

C » LOGICAL UNIT ASSIGNMENTS » C

C LU1 -KGS INDEX DATA FILE

C LU2-KGSKEY.DTA (KGS DICTIONARY FILE)

C LU3-PRINT DEVICE

C LU4-TEMP0RARY SCRATCH FILE

C LU5-KGS DATA BASE

C LU6-C0MMAND DEVICE

C

C

C

CHARACTER* 1 6, INKEY(6)

CHARACTER»16,DCNKEY

CHARACTER»32,INAUTH

CHARACTER* 1,INDEX( 30)

CHARACTER»1,HLDCHR(6)

CHARACTER* I.IDUMMY

C

C DATA ELEMENTS READ FROM KGS DATA BASE RECORD

C

CHARACTER»32, AUTHOR (3)

CHARACTER»12,PUBDAT

CHARACTER* 100, TITLE

CHARACTER*32,PUBNAM

C-38
CHARACTER*20, REFER

CHARACTER* 1 6 , KEYWRD( 6

)

CHARACTER*! 6, DISCPN

C

INTEGER IDATE(3)

INTEGER*2 RECNO(60) ,P0INTR(30) ,ISTAT,ILINE,INKYCT

INTEGER*2 IC ELL , ISUB , 10 VFLW , IPRTSW , IPRTCT , IDXCT

INTEGER*2 ITIMES,ISCRCT,I0VFL1 .lERRCT

INTEGER*2 IPAGE.ISCREC.IERRSW

C

C

C INITIALIZE VALUES

C

INKYCT=0

IDXCTrO

ISUBrO

ITIMESrO

ISCRCTrO

IPRTSWrO

IPRTCTrO

lERRCTrO

lANDORrO

IPAGErl

INAUTHr'

lERRSWrO

DO 10 1=1,6

INKEY(I)='

10 CONTINUE

C

C DATE ROUTINE

C

CALL DATE(IDATE)

C

C INPUT PARAMETERS

C FOR FIELD OR STRING SEARCH

C

100 WRITE (6,9000,ERR=8000)

READ (6,9010,ERR=8000) IRESP

IF ( IRESP. EQ.' ') GO TO 7000

IF (IRESP. EQ.'FIELM GO TO 500

ILINErl

IF (IRESP. NE.'STRI') GO TO 8020

C

C

C «»«»« STRING SEARCH »»»»»

C

C

CALL KGSTRING (ISTAT,IDATE)

GO TO 9999

CC ***** FIELD SEARCH *****

C

C

C UNION OR INTERSECTION

C PARAMETERS ENTERED BY USER

C

C-39
C INTERSECTION - IANDOR=0

C UNION - lANDORrI

C

C

500 WRITE (6,9020,ERR=8000)

READ (6,9010,ERR=8000) IRESP

IF ( IRESP. EQ.' •) GO TO 7000

IF (IRESP. EQ.'UNIOM THEN

IAND0R=1

ELSE IF ( IRESP. EQ. 'OR ') THEN

lANDORrI

ELSE IF ( IRESP. EQ.'INTE') THEN

IANDOR=0

ELSE IF (IRESP. EQ. 'AND ') THEN

lANDORrO

ELSE

ILINE=2

GO TO 8020

ENDIF

C

C ACCEPT KEY WORDS FROM USER

C

WRITE (6,9100,ERR=8000)

DO 520 1=1,6

READ (6,9030,ERR=8000) INKEY(I)

IF (INKEY(I).EQ.' ' ) GO TO 540

HLDCHR(I)=INKEY(I)

INKYCTrINKYCT+1

520 CONTINUE

540 IF (INKYCT.EQ.O) GO TO 7000

C

C

C BUILD INDEX ARRAY FROM INDEX FILE

C

OPEN (1 ,I0STAT=ISTAT,ERR=8010,FILE='KGSIDX.DTA' ,RECL=5,

- SHAREr'SRO')

DO 560 1=1,30

READ (1,9040,IOSTAT=ISTAT,ERR=8060,END=580) INDEX(I) ,POINTR(I)

IDXCT=IDXCT+1

560 CONTINUE

580 CLOSE (1 ,IOSTAT=ISTAT,ERR=8030)

C

C OPEN DICTIONARY AND SCRATCH FILES

C

OPEN (2,I0STAT=ISTAT,ERR=8010,FILE='KGSKEY.DTA' ,RECL=256,

- SHARE='SRO',ACCESS='DIRECT')

OPEN (4,IOSTAT=ISTAT,ERR=8010,RECL=5,SHARE='ERW'

- STATUS=' SCRATCH')

C

C FIND START OF OVERFLOW RECORDS ON DICTIONARY

C

READ (2,9120,I0STAT=ISTAT,REC=1) lOVFLW

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.31 .OR.ISTAT.EQ.32) GO TO 8100

IF (ISTAT.NE.O) GO TO 8060

C-40
C BINARY SEARCH OF INDEX

C

600 ISUB=ISUB+1

IF (ISUB.GT.INKYCT) GO TO 900

IDUMMY=HLDCHR(ISUB)

CALL SEARCH (INDEX, IDXCT, IDUMMY, ICELL)

IRECrPOINTRdCELL)

IF (ICELL. GT.O) GO TO 700

IERRCT=IERRCT+1

GO TO 7^0

C

C FIND KEYWORD ON DICTIONARY

C

700 READ (2,9050,IOSTAT=ISTAT,REC=IREC)

- DONKEY, (RECNO(I), 1=1, 60)

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.31 .OR.ISTAT.EQ.32) GO TO 8070

IF (ISTAT.NE.O) GO TO 8060

IREC=IREC+1

IF (DCNKEY.LT.INKEY(ISUB)) GO TO 700

IF (DCNKEY.EQ.INKEY(ISUB)) GO TO 800

C

c

C SEARCH OVERFLOW FOR KEYWORD

C

740 lOVFLIrlOVFLW

750 READ (2,9050,IOSTAT=ISTAT,REC=IOVFL1) DONKEY,

- (RECN0(I),I=1,60)

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.31 .OR.ISTAT.EQ.32) GO TO 8070

IF (ISTAT.NE.O) GO TO 8040

I0VFL1=I0VFL1 + 1 IF (DCNKEY.EQ.INKEY(ISUB)) GO TO 800

GO TO 750

C

C CREATE SCRATCH FILE OF RECORD NUMBERS

C

c

C WRITE FIRST RECORD

C

800 IF (ISCRCT.NE.O) GO TO 830

ITIMESrI

DO 820 1=1 ,60

IF (RECNO(I).EQ.O) GO TO 825

WRITE (4,9060,IOSTAT=ISTAT,ERR=8080) RECNO(I) .ITIMES

ISCRCT=ISCRCT+1

820 CONTINUE

825 REWIND 4

GO TO 600

C

C WRITE ADDITIONAL RECORD NUMBERS

C TO SCRATCH FILE

C

830 DO 860 1=1,60

IF (RECNO(I).EQ.O) GO TO 870

840 READ (4,9060,IOSTAT=ISTAT,ERR=8060,END=850) ISCREC, ITIMES

C-41
IF (RECNO(I).NE.ISCREC) GO TO 840

BACKSPACE 4

ITIMES=ITIMES+1

WRITE (4,9060,IOSTAT=ISTAT,ERR=8000) ISCREC.ITIMES

REWIND 4

GO TO 860

850 ITIMES=1

WRITE (4,9060,IOSTAT=ISTAT,ERR=8000) RECNO(I) .ITIMES

ISCRCT=ISCRCT+1

REWIND 4

860 CONTINUE

870 REWIND 4

GO TO 600

C

C CLOSE DICTIONARY FILE

C OPEN KGS DATA BASE

C REWIND SCRATCH FILE

C

900 CLOSE (2,I0STAT=ISTAT,ERR=8050)

OPEN (5,IOSTAT=ISTAT,ERR=8010,FILE=»KGS' ,RECL=372,SHARE='SRO'

- ACCESSr' DIRECT')

REWIND 4

C

C *•*** RECORD RETRIEVAL FROM KGS DATA BASE »»*»»

C

C

C ALTERNATE PRINT OPTION

C

C HARD COPY OUTPUT - IPRTSW=1

C OUTPUT ONLY ON TERMINAL - IPRTSW=0

C

WRITE (6,9070,ERR=8000)

READ (6,9010,ERR=8000) IRESP

IF ( IRESP. EQ. 'NO ') GO TO 1000

IF ( IRESP. NE. 'YES ') GO TO 8050

OPEN (3,IOSTAT=ISTAT,ERR=8010,FILE='PR2: ')

IPRTSWrl

C

C UNION (OR)

C

1000 IF (lANDOR.EQ.O) GO TO 1200

1020 READ (4,9060,IOSTAT=ISTAT,ERR=8060,END=7000) ISCREC, ITIMES

READ(5 , 9080 , IOSTAT=ISTAT , ERR=8060 , RECrlSCREC

- (AUTH0R(I),I=1,3),

- PUBDAT, TITLE, PUBNAM, REFER, (KEYWRD(J),J=1, 6), DISCPN

C

C DISPLAY RECORD

C

CALL KGSDSPLY ( INKEY , INAUTH , IDATE , ISCREC

lANDOR , IPRTSW , IPAGE , IPRTCT

- AUTHOR , PUBDAT , TITLE , PUBNAM , REFER , KEYWRD , DISCPN

C

GO TO 1020

C

C INTERSECTION (AND)

C

C-42

I
1200 IF (lERRCT.NE.O) INKYCT=INKYCT-IERRCT

1220 READ (4,9060,IOSTAT=ISTAT,ERR=8060,END=1250) ISCREC, ITIMES

IF ( ITIMES. NE.INKYCT) GO TO 1220

READ(5 , 9080 , IOSTAT=ISTAT , ERRr8060 , REC=ISCREC)

- (AUTH0R(I),I=1,3),

- PUBDAT, TITLE, PUBNAM, REFER, (KEYWRD(J),J=1, 6), DISCPN

lERRSWrl

C

C DISPLAY RECORD

C

CALL KGSDSPLY ( INKEY , INAUTH , IDATE , ISCREC

,

lANDOR , IPRTSW , IPAGE , IPRTCT

,

- AUTHOR , PUBDAT , TITLE , PUBNAM .REFER , KEYWRD , DISCPN

)

GO TO 1220

1250 IF (lERRSW.EQ.O) GO TO 8090

C

C CLOSEOUT

C

7000 CLOSE (4,IOSTAT=ISTAT,ERR=8030)

CLOSE (5,IOSTAT=ISTAT,ERR=8030)

CLOSE (3,IOSTAT=ISTAT,ERR=8030)

ISTAT=0

C

C RETURN

C

9999 RETURN

C

C ««*»* ERROR REPORTING AND FORMATTING *****

C

8000 WRITE (6,8005,ERR=9999)

8005 FORMAT (/1X, 'COMMAND DEVICE ERROR'/)

ISTAT=1

PAUSE

GO TO 9999

8010 WRITE (6,8015,ERR=8000) ISTAT

8015 FORMAT (/1X, 'ERROR ON OPENING FILE - lOSTAT = ',14/)

ISTATrl

PAUSE

GO TO 9999

8020 WRITE (6,8025,ERR=8000)

8025 FORMAT (/1X, 'INVALID RESPONSE - PLEASE ENTER AGAIN'/)

GO TO (100,500),ILINE

8030 WRITE (6,8035,ERR=8000) ISTAT

8035 FORMAT (/1X, 'ERROR ON CLOSING FILE - lOSTAT = ',14/)

ISTAT=1

PAUSE

GO TO 9999

8040 WRITE (6,8045,ERR=8000) INKEY(ISUB)

8045 FORMAT (/1X, 'KEYWORD NOT IN DICTIONARY - ',A16/)

REWIND 2

GO TO 600

8050 WRITE (6,8055,ERR=8000)

8055 FORMAT (/1X, 'PLEASE RESPOND YES OR NO'/)

GO TO 900

8060 WRITE (6,8065,ERR=8000) ISTAT

8065 FORMAT (/1X, 'ERROR ON READING FILE - ISTAT = ',14)

C-43
8070

8075

8080

8085

8090

8095

8100

8105

C

C

C

C

9000

9010

9020

9030

9040

9050

9060

9070

9080

9100

9120

PAUSE

ISTATrl

GO TO 9999

WRITE (6,8075,ERR=8000) INKEY(ISUB)

FORMAT (/1X, 'KEYWORD NOT IN DICTIONARY - ' ,A16)

IERRCT=IERRCT+1

GO TO 600

WRITE (6,8085,ERR=8000) ISTAT

FORMAT (/1X, 'ERROR ON WRITING FILE - lOSTAT = ',14/)

ISTATrl

PAUSE

GO TO 9999

WRITE (6,8095,ERR=8000)

FORMAT (/1X,'*** NO FILES ON DATA BASE',

' CONTAINING ALL SELECTED KEYWORDS *«»'/)

GO TO 7000

WRITE (6,8105,ERR=8000)

FORMAT (/IX.'NO RECORDS IN DICTIONARY'/)

GO TO 7000

««»«»XJ(««« I/O FORMATTING ««%«««««%«

FORMAT (/ IX, 'FIELD OR STRING SEARCH BY KEYWORD?')

FORMAT (A4)

FORMAT (/1X, 'UNION (OR) OR INTERSECTION (AND)')

FORMAT (A16)

FORMAT (A1,I4)

FORMAT (A16,60I4)

FORMAT (14,11)

FORMAT (/1X, 'ALTERNATE PRINT OPTION?')

FORMAT (3A32,A12,A100,A32,A20,6A16,A16)

FORMAT (/ IX, 'ENTER KEYWORDS')

FORMAT (14)

END

C-44
c

c

c

c

C KGSTRING

C

C

C

SUBROUTINE KGSTRING (ISTAT, IDATE)

C

C

C

C

C LOGICAL UNIT ASSIGNMENTS

C

C LU3-PRINT DEVICE

C LU5-KGS DATA BASE

C LU6-C0MMAD DEVICE

C

C

CHARACTER*32,INAUTH

CHARACTER*16,INKEY(6)

CHARACTER»16,INSTRG

CHARACTER*16, FIELD

C

C DATA ELEMENTS READ FROM KGS DATA BASE RECORD

C

CHARACTER*32, AUTHOR (3)

CHARACTER*12,PUBDAT

CHARACTER* 100, TITLE

CHARACTER*32,PUBNAM

CHARACTER*20, REFER

CHARACTER* 1 6 , KEYWRDC 6

)

CHARACTER*! 6, DISCPN

C

INTEGER*2 INKYCT , IPRTSW , IPAGE , IPRTCT , IREC

C INTEGER IDATE(3) ^- C

C INITIALIZE VALUES

C

INAUTH='

INKYCTrO

IREC=0

IAND0R=2

IPRTSWrO

IPAGE=1

IPRTCTrO

ISTYP='

C

C ALTERNATE PRINT OPTION

C

C HARD COPY OUTPUT - IPRTSW=1

C OUTPUT ONLY ON TERMINAL - IPRTSWrQ

C

30 WRITE (6,9030,ERR=8000)

READ (6,9040,ERR=8000) IRESP

C-45
IF (IRESP.EQ.'NO ' ) GO TO 40

IF (IRESP.NE.'YES ' ) GO TO 8030

OPEN (3,IOSTAT=ISTAT,ERR=8010,FILE='PR2: •)

IPRTSWrl

C

C ACCEPT INPUT KEYS FROM USER

C

C

40 WRITE (6,9000,ERR=8000)

DO 50 1=1,6

READ (6,9010,ERR=8000)INKEY(I)

IF (INKEY(I).EQ.' ') GO TO 80

INKYCT=INKYCT+1

50 CONTINUE

80 IF (INKYCT.EQ.O) GO TO 900

C

C OPEN KGS DATA BASE

C

OPEN (5 , lOSTATrlSTAT , ERR=80 1 , FILE= ' KGS ' , RECL=372 , SHARE= ' SRO '

C

C READ DATA BASE RECORDS

C

200 READ (5.9020,IOSTAT=ISTAT.ERR=8020,END=900)(AUTHOR(I),I=1,3),

- PUBDAT,TITLE,PUBNAM,REFER,(KEYWRD(J) ,J=1 ,6) .DISCPN

IREC=IREC+1

C

C

C CHECK FOR DELETED RECORD

C

IF ( AUTHOR (l).EQ.'DELEDELEDELEDELEDELEDELEDELEDELE') GO TO 200

C

C

C

C

C

C PERFORM STRING SEARCH

C ON TITLE FIELD

C

DO 400 I=1,INKYCT

INSTRGrlNKEYd)

CALL STSRCH (TITLE, INSTRG, MATCH)

IF (MATCH. EQ.1) GO TO 800

400 CONTINUE

C

C PERFORM STRING SEARCH

C ON KEY WORD FIELDS ON KGS DATA BASE

C

DO 600 I=1,INKYCT

INSTRGrlNKEYd)

DO 650 J=1,6

FIELD=KEYWRD(J)

CALL STSRCH (FIELD, INSTRG, MATCH)

IF (MATCH. EQ.1) GO TO 800

650 CONTINUE

600 CONTINUE

C

C-46
C N MATCH

C

GO TO 200

C

C

C MATCH -

C DISPLAY RECORD

C

800 CALL KGSDSPLY (INKEY.INAUTH.IDATE.IREC,

lANDOR , IPRTSW , IPAGE , IPRTCT

,

- AUTHOR , PUBDAT , TITLE , PUBNAM , REFER , KEYWRD , DISCPN

)

MATCHrO

GO TO 200

C

C CLOSEOUT

C

900 CLOSE (5,IOSTAT=ISTAT,ERR=8030)

CLOSE (3,IOSTAT=ISTAT,ERR=8030)

ISTATrO

C

C RETURN

C

9999 RETURN

C

C ERROR REPORTING AND FORMATTING

C

8000 WRITE (6,8005,ERR=9999)

8005 FORMAT (/1X, 'COMMAND DEVICE ERROR'/)

ISTATrl

GO TO 9999

8010 WRITE (6,8015,ERR=8000) ISTAT

8015 FORMAT (/1X, 'ERROR ON OPENING FILE - lOSTAT = ',14/)

GO TO 9999

8020 WRITE (6,8025,ERR=8000) ISTAT

8025 FORMAT (IX, 'ERROR ON READING FILE - lOSTAT = ',14)

GO TO 9999

8030 WRITE (6,8035,ERR=8000)

8035 FORMAT (/1X, 'PLEASE RESPOND YES OR NO'/)

GO TO 30

C

C I/O FORMATTING

C

9000 FORMAT (/ IX, 'ENTER KEY WORDS FOR SEARCH'/)

9010 FORMAT (A16)

9020 FORMAT (3A32,A12,A100,A32,A20,6A16,A16)

9030 FORMAT (/ IX, 'ALTERNATE PRINT OPTION?'/)

9040 FORMAT (A4)

END

C-47
c

c

C S T S R C H

C

C

C

C

SUBROUTINE STSRCH (FIELD, INSTRG, MATCH)

C WRITTEN BY JUDITH CALABRESE - 22 SEPTEMBER 1981

C

C

C PERFORMS STRING SEARCH ON FIELD UP TO 100 CHARACTERS LONG

C USING AN INPUT STRING UP TO 50 CHARACTERS LONG FOR COMPARISON,

C

C FIELD - FIELD TO BE SEARCHED

C INSTRG - INPUT STRING SEARCHING FOR

C MATCH - 1 = MATCH

C = NOMATCH

C

c CHARACTER*100,FIELD

CHARACTER*50, INSTRG

CHARACTER*50.HLDSTR

CHARACTER*1,HLDCAR(2)

CHARACTER*2,H0LD(2)

C

C INITIALIZE VALUES

C

LENGTH=0

MATCHrO

C

C CALCULATE LENGTH OF INPUT STRING

C

^-

DO 20 1=1,50

J=I+1

HLDCAR ( 1 ) ( 1 : ) =INSTRG( I : I

HLDCAR(2)(1 :)=INSTRG(J:J)

IF (HLDCAR(l).EQ.' ' .AND.HLDCAR(2) .EQ. '

' ) GO TO 40

LENGTH=LENGTH+1

20 CONTINUE

C

C LOAD PORTION OF FIELD INTO HOLD AREA

C

40 DO 100 1=1,100

LAST=I+ ( LENGTH- 1)

HLDSTR(1:)=FIELD(I:LAST)

IF (HLDSTR.EQ. INSTRG) GO TO 200

IF (HLDSTR.EQ.' ' ) GO TO 9999

C

C

C COMPARE INPUT STRING TO HOLD AREA

C

ICTR=0

C-48

il
DO 60 J =1, LENGTH

K=J+1

H0LD(1)(1:)=HLDSTR(J:K)

H0LD(2)(1:)=INSTRG(J:K)

C

IF (H0LD(1).NE.H0LD(2)) GO TO 60

ICTR=ICTR+1

60 CONTINUE

IF (ICTR.EQ. LENGTH) GO TO 200

100 CONTINUE

GO TO 9999

C

C MATCH

C

200 MATCHrl

C

C RETURN

C

9999 RETURN

END

C~49
c

c

c

c

C ALL

C

C

C

C

SUBROUTINE KGSALL(ISTAT)

C

C WRITTEN BY JUDITH CALABRESE - 3 SEP 81

C

C PRODUCES LISTING OF ALL RECORDS ON KGS DATA BASE

C SORTED BY AUTHOR - DUPLICATE RECORDS (WITH MULTIPLE

C AUTHORS) WILL APPEAR.

C

C RECORDS IN DICTIONARY OVERFLOW WILL NOT BE SORTED.

C

C * LOGICAL UNIT ASSIGNMENT » C

C LU2-KGS AUTHOR DICTIONARY

C LU3-PRINT DEVICE

C LU5-KGS DATA BASE

C LU6-C0MMAND DEVICE

C

CHARACTER»32,DCNNAM

CHARACTER»16,INKEY(6)

C

C DATA ELEMENTS READ FROM KGS DATA BASE RECORD

C

CHARACTER*32,AUTHOR(3)

CHARACTER*! 2, PUBDAT

CHARACTER*100, TITLE

CHARACTER»32,PUBNAM

CHARACTER*20, REFER

CHARACTER* 1 6, KEYWRDC 6)

CHARACTER*! 6, DISCPN

C

INTEGER IDATE(3)

INTEGER*2 RECN0(50) ,IREC,IPRTSW,IPAGE,IPRTCT,KREC

C

C

C INITIALIZE VALUES

C

IRECrl

IPRTSW=1

IPAGErO

IPRTCTrO

C

C DATE ROUTINE

C

CALL DATE (IDATE)

C

C OPEN AUTHOR DICTIONARY

C OPEN KGS DATA BASE

C-50
C OPEN PRINT FILE

C

OPEN (5,IOSTAT=ISTAT,ERR=8010,FILE='KGS' ,RECL=372,

SHARE='SRO' .ACCESSr'DIRECT')

OPEN (2,IOSTAT=ISTAT,ERR=8010,FILE='KGSAUTH.DTA'

,

RECL=232,SHARE='SRO' ,ACCESS= 'DIRECT'

)

OPEN (3,IOSTAT=ISTAT,ERR=8010,FILE='CAL:KGSPRT.DTA'

,

RECL=132,SHARE='EWO' ,STATUS= 'RENEW

)

C

C READ AUTHOR DICTIONARY

C TO DETERMINE START OF

C OVERFLOW RECORDS

C

READ (2,9000,IOSTAT=ISTAT,ERR=8020) lOVFLW

IREC=IREC+1

C

C READ AUTHOR DICTIONARY

C

100 READ (2,9010,IOSTAT=ISTAT,REC=IREC)

DCNNAM,(RECNO(I),I=1,50)

IREC=IREC+1

IPRTCTrO

IPAGE=IPAGE+1

C

C CHECK FOR END-OF-FILE

C

IF (ISTAT.EQ.3I.OR.ISTAT.EQ.32) GO TO 500

IF (ISTAT.NE.O) GO TO 8020

C

C RETRIEVE RECORDS FROM KGS DATA BASE

C

DO 200 1=1,50

IF (RECNO(I).EQ.O) GO TO 100

READ (5 , 9020 , lOSTATrlSTAT , ERR=8020 , REC=RECNO ( I )

)

(AUTH0R(J),J=1,3),

- PUBDAT, TITLE , PUBNAM , REFER , (KEYWRD(K) ,K=1 , 6) , DISCPN

C

C

C PRINT OUT RECORD

C

KRECrRECNOd)

CALL KGSDSPLY (INKEY.DCNNAM.IDATE.KREC

,

lANDOR , IPRTSW , IPAGE , IPRTCT

,

- AUTHOR , PUBDAT , TITLE , PUBNAM , REFER , KEYWRD, DISCPN

)

C

200 CONTINUE

C

GO TO 100

cC CLOSEOUT

C

500 CLOSE (2,IOSTAT=ISTAT,ERR=8030)

CLOSE (3,IOSTAT=ISTAT,ERR=8030)

CLOSE (5,IOSTAT=ISTAT,ERR=8030)

ISTATrO

WRITE (6,9030,ERR=8000)

C-51
c

C RETURN

C

9999 RETURN

C

C ERROR REPORTING AND FORMATTING

C

8000 WRITE (6,8005,ERR=9999)

8005 FORMAT (/1X, 'COMMAND DEVICE ERROR'/)

ISTAT=1

PAUSE

GO TO 9999

8010 WRITE (6,8015,ERR=8000) ISTAT

8015 FORMAT (/1X, 'ERROR ON OPENING FILE - lOSTAT = ',14)

PAUSE

GO TO 9999

8020 WRITE (6,8025,ERR=8000) ISTAT

8025 FORMAT (/1X, 'ERROR ON READING FILE - lOSTAT = ',14)

PAUSE

GO TO 9999

8030 WRITE (6,8035,ERR=8000) ISTAT

8035 FORMAT (/1X, 'ERROR ON CLOSING FILE - lOSTAT = ',14)

PAUSE

GO TO 9999

C

C I/O FORMATTING

C

9000 FORMAT (14)

9010 FORMAT (A32,50I4)

9020 FORMAT (3A32 , A12 ,A100 ,A32 ,A20 , 6A16 ,A16)

9030 FORMAT (/1X, '***** PRINT FILE - KGSPRT.DTA ««»»*'/)

END

I

C~52
KGSDSPLY

SUBROUTINE KGSDSPLY ( INKEY , INAUTH , IDATE , IREC

lANDOR , IPRTSW , IPAGE , IPRTCT

- AUTHOR , PUBDAT, TITLE ,-PUBNAM , REFER , KEYWRD.DISCPN)

WRITTEN BY JUDITH CALABRESE - 20 AUGUST 1981

DISPLAYS KGS RECORD ON CRT AND OPTIONALLY PRINTS HARD COPY

ARGUMENTS PASSED

INKEY - ARRAY OF KEYWORDS INPUT BY USER (A16 FORMAT)

INAUTH - AUTHOR'S NAME INPUT BY USER

IDATE - TODAY'S DATE

IREC - RECORD NUMBER ON KGS DATA BASE

lANDOR - SWITCH SIGNIFYING UNION OR INTERSECTION

OrlNTERSECTION

1=UNI0N

2=STRING SEARCH

IPRTSW - SWITCH INDICATING OPTIONAL PRINT

1=HARD COPY

IPAGE - PAGE COUNTER

IPRTCT - RECORD COUNTER

**« KGS DATA BASE FIELDS *»*

AUTHOR

PUBDAT

TITLE

PUBNAM

REFER

KEYWRD

DISCPN

LOGICAL UNIT ASSIGNMENTS

LU3-PRINTER (OPTIONAL)

LU6-C0MMAND DEVICE

CHARACTER*32, INAUTH

CHARACTER*! 6, INKEY(6)

CHARACTER*12,IEXTRT

CHARACTER*50,TITLE1(2)

DATA ELEMENTS FROM KGS RECORD

C-53
CHARACTER*32,AUTHOR(3)

CHARACTER*! 2, PUBDAT

CHARACTER* 100, TITLE

CHARACTER*32,PUBNAM

CHARACTER*20, REFER

CHARACTER*! 6, KEYWRD(6)

CHARACTER*16,DISCPN

INTEGER*2 IREC , IPRTSW , IPAGE , IPRTCT

INTEGER IDATE(3)

INITIALIZE VALUES

IF (lANDOR.EQ.O) IEXTRT=' INTERSECTION'

IF (IAND0R.EQ.1) IEXTRT=' UNION ' IF (IAND0R.EQ.2) IEXTRT= 'STRING SRCH'

SET CARRIAGE CONTROL

TO PAGE EJECT

CALL CARCON (3,1)

DIVIDE TITLE FIELD

TITLE1(1)(1:)=TITLE(1:50)

TITLE1(2)(1:)=TITLE(51:100)

CHECK PRINT SWITCH FOR OPTIONAL HARD COPY

IF (IPRTSW.NE.1) GO TO 200

HEADINGS OUTPUT TO PRINTER

IF (IPRTCT. GT.O) GO TO 50

WRITE (3,9000,ERR=8000) IDATE(2) ,IDATE(3) ,IDATE(1

WRITE (3,9010,ERR=8000)

IF (INAUTH.NE.' ') THEN

WRITE (3,9020,ERR=8000) INAUTH, IPAGE

ELSE

WRITE (3,9030,ERR=8000) (INKEY(I) ,1=1 ,3) ,IPAGE,

(INKEY(J),J=4,6)

WRITE (3,9040,ERR=8000) lEXTRT

END IF

WRITE (3,9010,ERR=8000)

C

c50

RECORDS OUTPUT 'ro PRINTER

WRITE (3,9050, ERR=8000) AUTHOR (1), IREC

WRITE (3,9060,ERR=8000) AUTHOR (2)

WRITE (3.9070,ERR=8000) AUTHOR (3)

WRITE (3,9140,ERR=8000) DISCPN

WRITE (3,9080,ERR=8000) PUBDAT

WRITE (3,9090,ERR=8000) (TITLE1(I),I=1,2)

WRITE (3,9110,ERR=8000) PUBNAM, REFER

WRITE (3,9120,ERR=8000) (KEYWRD(I),I=1,3)

C-54
WRITE (3,9130,ERR=8000) (KEYWRD(I) ,1=4,6)

WRITE (3,9010,ERR=8000)

C

C RECORDS OUTPUT TO CRT

C

200 WRITE (6,9010,ERR=8000)

IF (INAUTH.NE.' •) THEN

WRITE (6,9020,ERR=8000) INAUTH,IPAGE

ELSE

WRITE (6,9030,ERR=8000) (INKEY(I) ,1=1 ,3) .IPAGE,

(INKEY(J),J=4,6)

WRITE (6,9040, ERR=8000) lEXTRT

END IF

WRITE (6,9010,ERR=8000)

WRITE (6,9160,ERR=8000) AUTH0R( 1 )

, IREC

WRITE (6,9060,ERR=8000) AUTH0R(2)

WRITE (6,9070, ERR=8000) AUTH0R(3)

WRITE (6,9140,ERR=8000) DISCPN

WRITE (6,9080,ERR=8000) PUBDAT

WRITE (6,9090,ERR=8000) (TITLE1 (I) ,1=1 ,2)

WRITE (6,9170,ERR=8000) PUBNAM

WRITE (6,9180, ERR=8000) REFER

WRITE (6,9120,ERR=8000) (KEYWRD(I) ,1=1 , 3)

WRITE (6,9130, ERR=8000) (KEYWRD(I) ,1=4,6)

WRITE (6,9010,ERR=8000)

C

C INCREMENT AND SET COUNTERS

C

IPRTCT=IPRTCT+1

IF (IPRTCT.NE.3) GO TO 9999

IPRTCT=0

IPAGE=IPAGE+1

C

C CLOSEOUT

C

9999 RETURN

C

C ERROR REPORTING AND FORMATTING

C

8000 WRITE (6,8005,ERR=9999)

8005 FORMAT (IX, 'COMMAND DEVICE ERROR')

GO TO 9999

C

I/O FORMATTING

C

9000 FORMAT ( 1H1 , 1X///20X, 'K GS PUBLICATIONS', IX,

-'DATABASE RETRIEVA L' ,8X , 12, ' /' ,12, ' /

' , 12)

9010 FORMAT (IX,' ',1X,

_• •,1X, _ • V)

9020 FORMAT (IX, 'AUTHOR EXTRACTED WAS: ' ,A32, IX, 'PAGE ',14)

9030 FORMAT (IX, 'KEY WORD/S SELECTED WERE: ' , 3(A16 ,2X) ,5X, - 'PAGE ',I4,/28X,3(A16,2X))

9040 FORMAT (IX, 'SEARCH CRITERIA USED: ',A12)

9050 FORMAT (IX, 'AUTHOR: ',A32, - 10X, 'RECORD NO. ' ,14)

C-55
9060 FORMAT (1X,'AUTH0R(2): '.A32)

9070 FORMAT (1X,'AUTH0R(3): •,A32)

9080 FORMAT (IX, 'PUBLICATION DATE: •,A12)

9090 FORMAT (IX, 'TITLE: •,A50/,22X,A50)

9110 FORMAT (IX, 'PUBLICATION NAME:

- 'REFERENCE: ',A20)

•,A32.2X,

9120 FORMAT (IX,'- - KEY WORDS - - ',3(A16,4X))

9130 FORMAT (20X,3(Al6,i;X))

9140 FORMAT (IX, 'FILE CODE: ',A16)

9160 FORMAT (IX, 'AUTHOR:

- 5X, 'RECORD NO. ' ,14)

'.A32,

9170 FORMAT (IX, 'PUBLICATION NAME: •.A32)

9180 FORMAT (IX, 'REFERENCE: ',A20)

END

C-56
c

c

c

c

C SEARCH

C

C

C

C

SUBROUTINE SEARCH(INDEX, ICTIDX, IDUMMY, I)

C

C WRITTEN BY JUDITH CALABRESE - 23 JULY 1981

C

C PERFORMS BINARY SEARCH OF INDEX ARRAY

C

CHARACTER*1 ,INDEX(30)

CHARACTER* 1

, IDUMMY

INTEGER*2 I , HI ,L0, MID, ICTIDX

C

C INITIALIZE VALUES

C

IF ( ICTIDX. LE.O) GO TO 9999

HIrlCTIDX

L0=1

C

C CALCULATE MID POINT

C

10 MID=(HI+L0)/2

C

C SEARCH

C

IF ( IDUMMY. EQ.INDEX( MID)) GO TO 50

IF (IDUMMY. GT.INDEX(MID)) LO=MID

IF ( IDUMMY. LT.INDEX(MID)) HI=MID

C

C CHECK FOR LAST 2 RECORDS

C

IF ((HI-LO).EQ.I) GO TO 30

GO TO 10

C

C FINAL SEARCH

C

30 MIDrHI

IF ( IDUMMY. EQ.INDEX(MID)) GO TO 50

MID=LO

IF ( IDUMMY. EQ.INDEX(MID)) GO TO 50

C

C NOT ON INDEX

C

GO TO 8000

C

C CLOSEOUT

C

50 IzMID

9999 RETURN

^ C-57
c Error reporting

c8000 WRITE (6,8005,ERRr9999) IDUMMY

8005 FORMAT (IX, 'INPUT KEY NOT ON INDEX

1=0

GO TO 9999

END

- '.AD

C-58
SUBROUTINE KGSINFO (ISTAT)

C

C WRITTEN BY JUDITH CALABRESE - 27 OCTOBER 1981

C

C PROVIDES INFORMATION ON KEYWORDS AND AUTHORS

C FROM KGS DICTIONARIES.

C

C LISTS NAME AND NUMBER OF TIMES A KEYWORD OR

C AUTHOR NAME APPEARS IN THE KGS DATA BASE.

C

C LOGICAL UNITS

C

C LU1 - KGSAUTH.DTA (KGS AUTHOR DICTIONARY)

C LU2 - KGSKEY.DTA (KGS KEYWORD DICTIONARY)

C LU3 - PRINTER

C LU6 - COMMAND DEVICE

C

c CHARACTER*32, AUTHOR (2)

CHARACTER*16,KEYWRD(2)

C

INTEGER IDATE(3)

INTEGER*2 KEYREC ( 60 ), lOVFLW , IC0UNT1 , IC0UNT2 , IREC 1

, IREC2

INTEGER*2 IBOTH.ILINE.IENDSW

C

C

C INITIALIZE VALUES

C

IBOTHrO

lENDSWrO

C

C OPEN PRINT DEVICE

C

OPEN (3,IOSTAT=ISTAT,ERR=8020,FILE='PR2: ') C

C DATE ROUTINE

C

CALL DATE (IDATE)

C

C USER ENTERS MODE

C

WRITE (6,9000,ERR=8000)

20 WRITE (6,9010,ERR=8000)

READ (6,9020,ERR=8000) IRESP

IF ( IRESP. EQ.' ') GO TO 900

IF (IRESP. EQ. 'KEY ' ) GO TO 500

IF (IRESP. EQ.'AUTH') GO TO 100

IF ( IRESP. EQ. 'BOTH') THEN

IB0TH=1

GO TO 100

END IF

cc

c

c

GO TO 8010

***** AUTHOR MODE

OPEN AUTHOR DICTIONARY

*****

C-59
c100 OPEN (1 ,IOSTAT=ISTAT,ERR=8020,FILE='KGSAUTH.DTA' ,RECL=232,

SHARE='SRO' ,ACCESS='DIRECT')

C

C FIND START OF OVERFLOW RECORDS

C

READ (1 ,9030,IOSTAT=ISTAT,ERR=8030,REC=1) lOVFLW

IREC1=2

C

C WRITE REPORT HEADERS

C

110 WRITE (3,9040,ERR=8000) IDATE(2) ,IDATE(3) ,IDATE( 1

WRITE (3,9050,ERR=8000)

WRITE (3,9060,ERR=8000)

ILINErO

C

C READ FIRST AND MOTH RECORD ON AUTHOR DICTIONARY

C (40TH RECORD IS READ FOR 2-COLUMN PRINT)

C

120 READ (1 ,9080,IOSTAT=ISTAT,REC=IREC1) AUTHOR(I),

(KEYREC(I),I=1,50)

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.31 .OR.ISTAT.EQ.32) GO TO 400

IF (ISTAT.NE.O) GO TO 8030

IREC1=IREC1+1

ICOUNTIrO

DO 140 1=1 ,50

IF (KEYREC(I).EQ.O) GO TO 160

ICOUNTIrICOUNTI+1

140 CONTINUE

C

C

160 IF (IENDSW.EQ.1) GO TO 200 ^^

IREC2=IREC1+39

READ (1 ,9080,IOSTAT=ISTAT,REC=IREC2) AUTH0R(2),

(KEYREC(I),I=1,50)

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.31 .OR.ISTAT.EQ.32) THEN

lENDSWrl

GO TO 200

END IF

IF (ISTAT.NE.O) GO TO 8030

ICOUNT2=0

DO 180 1=1,50

IF (KEYREC(I).EQ.O) GO TO 200

IC0UNT2=IC0UNT2+1

180 CONTINUE

C

C WRITE OUT INFORMATION

C

200 IF (IENDSW.EQ.1) THEN

WRITE (3,9070,ERR=8000) AUTHOR( 1 ) ,IC0UNT1

ELSE IF (lENDSW.EQ.O) THEN

WRITE (3,9070,ERR=8000) AUTH0R( 1 ) .ICOUNTI ,AUTH0R(2) ,IC0UNT2

END IF

ILINE=ILINE+1

C-60
IF (ILINE.EQ.40) THEN

IREC1=IREC1+40

GO TO 110

END IF

GO TO 120

C

C CLOSE AUTHOR DICTIONARY

C

400 CLOSE (1)

IF (IBOTH.EQ.O) GO TO 900

C

c

C ***** KEYWORD MODE *****

C

C

C OPEN KEYWRD DICTIONARY

C

500 OPEN (2,IOSTAT=ISTAT,ERR=8020,FILE='KGSKEY.DTA' ,RECL=256,

SHAREr'SRO' ,ACCESS='DIRECT')

C

C FIND START OF OVERFLOW RECORDS

C

READ (2,9030,IOSTAT=ISTAT,ERR=8030,REC=1) lOVFLW

IREC1=2

lENDSWrO

C

C WRITE REPORT HEADERS

C

510 WRITE (3,9090,ERR=8000) IDATE(2) ,IDATE(3) ,IDATE(1

)

WRITE (3,9100,ERR=8000)

WRITE (3,9060,ERR=8000)

ILINE=0

C

C READ FIRST AND 40TH RECORD ON KEYWRD DICTIONARY

C (40TH RECORD IS READ FOR 2-COLUMN PRINT)

C

520 READ (2,9120,IOSTAT=ISTAT,REC=IREC1) KEYWRD(I),

(KEYREC(I),I=1,60)

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.31.0R.ISTAT.EQ.32) GO TO 800

IF (ISTAT.NE.O) GO TO 8030

IREC1=IREC1+1

ICOUNT1=0

DO 540 1=1,60

IF (KEYREC(I).EQ.O) GO TO 560

IC0UNT1=IC0UNT1+1

540 CONTINUE

C

C

560 IF (IENDSW.EQ.1) GO TO 600

IREC2rIREC1+39

READ (2,9120,IOSTAT=ISTAT,REC=IREC2) KEYWRD(2),

(KEYREC(I),I=1,60)

C CHECK FOR END-OF-FILE CONDITION

IF (ISTAT.EQ.31 .OR.ISTAT.EQ.32) THEN

lENDSWrl

C-61
GO TO 600

END IF

IF (ISTAT.NE.O) GO TO 8030

IC0UNT2=0

DO 580 1=1,60

IF (KEYREC(I).EQ.O) GO TO 600

IC0UNT2rIC0UNT2+1

580 CONTINUE

C

C WRITE OUT INFORMATION

C

600 IF (IENDSW.EQ.1) THEN

WRITE (3,9110,ERR=8000) KEYWRD( 1 ) .ICOUNTI

ELSE IF (lENDSW.EQ.O) THEN

WRITE (3,9110,ERR=8000) KEYWRD( 1 ) .ICOUNTI ,KEYWRD(2) ,IC0UNT2

END IF

ILINE=ILINE+1

IF (ILINE.EQ.40) THEN

IREC1=IREC1+40

GO TO 510

END IF

GO TO 520

C

C CLOSE KEYWRD DICTIONARY

C

800 CLOSE (2)

C

C

C CLOSEOUT

C

900 CLOSE (3)

ISTATrO

C

C RETURN

C

9999 RETURN

C

C ERROR REPORTING AND FORMATTING

C

8000 WRITE (6,8005,ERR=8000)

8005 FORMAT (/1X, 'COMMAND DEVICE ERROR'/)

ISTATrl

GO TO 9999

8010 WRITE (6,8015,ERR=8000)

8015 FORMAT (/1X, ' INVALID RESPONSE - PLEASE ENTER AGAIN'/)

GO TO 20

8020 WRITE (6,8025,ERR=8000) ISTAT

8025 FORMAT (/1X, 'ERROR ON OPENING FILE - lOSTAT =',I4/)

GO TO 9999

8030 WRITE (6,8035,ERR=8000) ISTAT

8035 FORMAT (/1X, 'ERROR ON READING FILE - lOSTAT = ',14/)

GO TO 9999

C

C I/O FORMATTING

C

9000 FORMAT (//////10X, 'K GS INFORMATION MOD E'///)

C-62
9010- FORMAT (/10X, 'ENTER INFORMATION DESIRED' ,//15X, 'AUTHOR' ,5X,

'KEY', 5X, 'BOTH'//)

9020 FORMAT (A4)

9030 FORMAT (14)

9040 FORMAT (1H1////// , 10X , 'KGS PUBLICATIONS DATA BASE',5X,

'AUTHOR LIST', 10X, 12,'/', 12,'/', 12//)

^u50 FORMAT ( 10X, 'AUTHOR ', 15X, 'OCCURRENCES' ,25X , 'AUTHOR ', 16X,

'OCCURRENCES')

9060 FORMAT (IX,' ' , _ t t

• »//)

9070 FORMAT (1X,A32,1X,I4,20X,A32,1X,I4)

9080 FORMAT (A32,50I4)

9090 FORMAT (1H1//////,10X,'KGS PUBLICATIONS DATA BASE',5X,

'KEYWORD LIST', 10X, 12,'/' ,12,'/', 12//)

9100 FORMAT (10X, 'KEYWORD', 20X, 'OCCURRENCES', 15X, 'KEYWORD', 20X,

'OCCURRENCES')

9110 FORMAT (5X,A16,17X,I4,18X,A16,15X,I4)

9120 FORMAT (A16,60I4)

END

C-63
C PROGRAM KGSRENEW

C

C WRITTEN BY JUDITH CALABRESE - 21 OCTOBER 1981

C

C REMOVES DELETED RECORDS FROM THE KGS DATA BASE

C

C LOGICAL UNIT ASSIGNMENTS

C

C LU1 - KGS DATA BASE (READ ONLY)

C LU2 - KGSTEMP - OUTPUT FILE (WRITE ONLY)

C LU6 - COMMAND DEVICE

C

C KGS DATA ITEMS

C

CHARACTER*32, AUTHOR (3)

CHARACTER*12,PUBDAT

CHARACTER*100, TITLE

CHARACTER*32,PUBNAM

CHARACTER*20, REFER

CHARACTER* 1 6, KEYWRD(6)

CHARACTER* 1 6, DISCPN

C

INTEGER*2 INCT.OUTCT

C

C INITIALIZE VALUES

C

INCTrO

OUTCTrO

C

C OPEN FILES

OPEN (1 ,IOSTAT=ISTAT,ERR=8010,FILE='KGS' ,RECL=372,SHARE='SRO')

C

OPEN (2,IOSTAT=ISTAT,ERR=8010,FILE='KGSTEMP' ,RECL=372,

SHARE= ' EWO ', STATUSr ' RENEW'

C

C READ KGS RECORDS

C

100 READ (1,9000,IOSTAT=ISTAT,ERR=8020,END=500)

(AUTHOR ( I )

, 1=1 , 3 )

. PUBDAT , TITLE , PUBNAM , REFER

(KEYWRD(J) ,J=1 ,6) , DISCPN

INCT=INCT+1

C

C CHECK FOR DELETED RECORDS

C

IF ( AUTHOR (l).EQ.'DELEDELEDELEDELEDELEDELEDELEDELE') GO TO 100

C

C WRITE OUT GOOD RECORD

C

WRITE (2,9000,IOSTAT=ISTAT,ERR=8030)

(AUTHOR (I), 1=1, 3), PUBDAT, TITLE, PUBNAM, REFER,

(KEYWRD(J) ,J=1 ,6) , DISCPN

0UTCT=0UTCT+1

GO TO 100

C

C CLOSEOUT

C-64
500 WRITE (6,9010,ERR=8000) INCT.OUTCT

CLOSE (1)

CLOSE (2)

9999 STOP

C

C ERROR REPORTING AND FORMATTING

C

8000 WRITE (6,8005,ERR=9999)

8005 FORMAT (/1X, 'COMMAND DEVICE ERROR'/)

GO TO 9999

8010 WRITE (6,8015,ERR=8000) ISTAT

8015 FORMAT (/1X, 'ERROR ON OPENING FILE - lOSTAT = ',14/)

GO TO 9999

8020 WRITE (6,8025,ERR=8000) ISTAT

8025 FORMAT (/1X, 'ERROR ON READING FILE - lOSTAT = ',14/)

GO TO 9999

8030 WRITE (6,8035,ERR=8000) ISTAT

8035 FORMAT (/1X, 'ERROR ON WRITING FILE - lOSTAT = ',14/)

GO TO 9999

C

C I/O FORMATTING

C

9000 FORMAT (3A32 ,A12,A100,A32,A20 ,6A16,A16)

9010 FORMAT (/1X, 'INPUT RECORDS = ' ,14, /1X, 'OUTPUT RECORDS =',I4/)

END

C-65
$BATCH

C PROGRAM KGSDCNY

C

C WRITTEN BY JUDITH CALABRESE - 20 OCTOBER 1981

C

C MAIN PROGRAM OF THE KGS DICTIONARY MODE.

C

C CALLS SUBROUTINES TO CREATE KEYWORD AND AUTHOR DICTIONARIES

C AND INDEXES.

C

C LOGICAL UNIT ASSIGNMENTS

C

C LU3 - PRINT DEVICE

C LU6 - COMMAND DEVICE

C

C

C

C HEADER

C

WRITE (6,9000,ERR=8000)

C

C OPEN PRINT FILE

C

OPEN (3,IOSTAT=ISTAT,ERR=8020,FILE='PR2: ')

C

C CREATE DICTIONARIES

C AND INDEXES

C

CALL KGSDCKEY

CALL KGSDCAUT

C

C CLOSEOUT

C

9999 STOP

C

C ERROR REPORTING AND FORMATTING

C

8000 WRITE (6,8005,ERR=9999)

8005 FORMAT (/1X, 'COMMAND DEVICE ERROR'/)

GO TO 9999

8020 WRITE (6,8025,ERR=8000) ISTAT

8025 FORMAT (/1X, 'ERROR ON OPENING FILE - lOSTAT = ',14/)

GO TO 9999

C

C I/O FORMATTING

C

9000 FORMAT (/10X,

10X,

10X,

10X,

10X,

KGS DICTIONARY MODE'//,

THIS ROUTINE CREATES BOTH THE AUTHOR AND'/,

KEYWORD DICTIONARIES AND INDEXES'/,

IT IS A LENGTHY PROCESS AND SHOULD BE'/

RUN OVERNIGHT'//)

END

C

C

C

C

C-66
KGSDCKEY

C

C

C

C

SUBROUTINE KGSDCKEY

C

C WRITTEN BY JUDITH CALABRESE 14 JULY 1981

C

C CREATES A SORTED DICTIONARY OF KEYWORDS FOR THE KGS DATA BASE.

C

C >»» LOGICAL UNIT ASSIGNMENT «<«

C

C LU1 - KGS DATA BASE (READ ONLY)

C LU2 - KGSKEY.DTA OUTPUT KEYFILE

C LU3 - PRINT FOR LIST OF KEYS

C LU6 - COMMAND DEVICE

C

C

CHARACTER* 1 6 , KEYNAM ( 800

)

CHARACTER»16,INAME(6)

CHARACTER* 16, SPACES

INTEGER*2 KEYREC ( 800 , 60 ), HOLDCT , IREC

C

C INITIALIZE VALUES

C

SPACES='

DO 20 1=1,800

KEYNAM(I)=SPACES

DO 10 J=1,60

KEYREC(I,J)=0

10 CONTINUE

20 CONTINUE

ICT=0

IRECrO

C

C BUILD ARRAY OF FIRST KEYWORDS ON FILE

C

OPENd ,IOSTAT=ISTAT,ERR=8010,FILE='KGS' ,RECL=372,SHARE='SRO')

100 READ (1,9000,IOSTAT=ISTAT,ERR=8020) (INAME(I) ,1=1 ,6)

IREC=IREC+1

DO 120 1=1,6

IF (INAME(I).EQ. SPACES) GO TO 120

KEYNAM(I)=INAME(I)

KEYREC(I,1)=IREC

ICT=ICT+1

120 CONTINUE

IF (ICT.EQ.O) GO TO 100

C

C SORT FIRST KEYWORDS

C

IF (ICT.EQ.1) GO TO 200

ICT2=ICT-1

140 IFLAG=0

DO 160 I=1,ICT2

IF (KEYNAM(I).LE.KEYNAM(I+1)) GO TO 160

C-67
IFLAG=1

INAME(1)=KEYNAM(I)

KEYNAM ( I ) =KEYN AM ( 1+ 1)

KEYNAM(I+1)=INAME(1)

160 CONTINUE

IF (IFLAG.EQ.1) GO TO 140

C

C READ KEYS AND SORT INTO KEY ARRAY

C

200 READ (1 ,9000,IOSTAT=:ISTAT,ERR=8020,END=300)(INAME(I),I=1,6)

IREC=IREC+1

DO 280 1=1,6

IF (INAME(I).EQ. SPACES) GO TO 280

DO 260 J=1,ICT

IF (KEYNAM(J).NE.INAME(I)) GO TO 220

C

C INPUT KEY ALREADY ON ARRAY

C

DO 210 K=1,60

IF (KEYREC(J,K).NE.O) GO TO 210

KEYREC(J,K)=IREC

GO TO 280

210 CONTINUE

C

C ADD INPUT KEY TO ARRAY - SORT

C

220 IF (KEYNAM(J).LT.INAME(I)) GO TO 260

H0LDCT=ICT+1

240 KEYNAM(H0LDCT)=KEYNAM(H0LDCT-1

DO 250 K=1,60

KEYREC(H0LDCT,K)=KEYREC(H0LDCT-1,K)

250 CONTINUE

H0LDCT=H0LDCT-1

IF (HOLDCT.GT.J) GO TO 240 ^^

KEYNAM(J)=INAME(I)

KEYREC(J,1)=IREC

DO 258 K=2,60

IF (KEYREC(J,K).EQ.O) GO TO 270

KEYREC(J,K)=0

258 CONTINUE

GO TO 270

260 CONTINUE

C

C APPEND INPUT KEY TO ARRAY

C

KEYNAM( ICT+1 ) =INAME(I

KEYREC(ICT+1,1)=IREC

270 ICT=ICT+1

280 CONTINUE

C

GO TO 200

C

C WRITE ARRAY TO KGSKEY.DTA

C

300 CLOSE (1 ,IOSTAT=ISTAT,ERR=8040)

OPEN ( 2 , IOSTAT=ISTAT , ERR=80 1 , FILE= ' KGSKEY . DTA ' , RECL=256

C-68
\

420

C

C

C

9999

C

C

C

8000

8005

8010

8015

8020

8025

8040

8045

C

C

C

9000

9060

9080

9100

9120

C

C

C

C

C

C

C

C

C

C

C

C

C

C

C

C

C

C

STATUS =

I RENEW, SHAREs'ERW)

I0VFCT=ICT+1

WRITE (2,9120,ERR=8000) lOVFCT

DO 420 1=1, ICT

WRITE (2,9060,ERR=8000) KEYNAM(I) ,(KEYREC(I, J) ,J = 1 ,60)

WRITE (3,9080,ERR=8000) KEYNAM(I)

CONTINUE

CLOSEDUT

CALL KGSINDEX (0)

WRITE (6,9100,ERR=8000) ICT

RETURN

ERROR REPORTING AND FORMATING

WRITE (6,8005,ERR=9999)

FORMAT (IX, 'COMMAND DEVICE ERROR')

GO TO 9999

WRITE (6,8015,ERR=8000)ISTAT

FORMAT (IX, 'ERROR ON OPENING FILE - lOSTAT

GO TO 9999

WRITE (6,8025,ERR=8000) ISTAT

FORMAT (IX, 'ERROR ON READING FILE - lOSTAT

GO TO 9999

WRITE (6,8045,ERR=8000) ISTAT

FORMAT (IX, 'ERROR ON CLOSING FILE - lOSTAT

GO TO 9999

I/O FORMATING

FORMAT (260X,6A16,16X)

FORMAT (A16,60I4)

FORMAT (1X,A16)

FORMAT (IX, 'KEYWORDS IN DICTIONARY = ',18)

FORMAT (14)

END

',14)

M4)

. I .14)

KGSDCAUT

SUBROUTINE KGSDCAUT

WRITTEN BY JUDITH CALABRESE 14 JULY 1981

CREATES A SORTED DICTIONARY OF AUTHORS ON THE KGS DATA BASE.

>»» LOGICAL UNIT ASSIGNMENT <««

LU1 - KGS DATA BASE (READ ONLY)

LU2 - KGSAUTH.DTA OUTPUT AUTHOR FILE

C-69
C LU3 - PRINT FOR LIST OF AUTHORS

C LU6 - COMMAND DEVICE

C

C

CHARACTER*32, AUTHOR (1000)

CHARACTER*32 , INAUTH ( 3

CHARACTER*32, SPACES

INTEGER»2 KEYREC( 1000,50) .HOLDCT, IREC

C

C INITIALIZE VALUES

C

SPACESr'

DO 20 1=1,1000

AUTHOR(I)=SPACES

DO 10 J=1,50

KEYREC(I,J)=0

10 CONTINUE

20 CONTINUE

ICT=0

IRECrO

C

C BUILD ARRAY OF FIRST KEYWORDS ON FILE

C

OPENd ,IOSTAT=ISTAT,ERR=8010,FILE='KGS' ,RECL=372,SHARE='SRO')

100 READ (1,9000, IOSTAT=ISTAT,ERR=8020) (INAUTH(I) ,1=1 , 3)

IREC=IREC+1

DO 120 1=1,3

IF (INAUTH(I).EQ. SPACES) GO TO 120

AUTHOR(I)=INAUTH(I)

KEYREC(I,1)=IREC

ICT=ICT+1

120 CONTINUE

IF (ICT.EQ.O) GO TO 100

C ^.

C SORT FIRST KEYWORDS

C

IF (ICT.EQ.1) GO TO 200

ICT2=ICT-1

140 IFLAG=0

DO 160 I=1,ICT2

IF (AUTH0R(I).LE.AUTH0R(I+1)) GO TO 160

IFLAG=1

INAUTH(1)=AUTH0R(I)

AUTH0R(I)=AUTH0R(I+1)

AUTH0R(I+1)=INAUTH(1)

160 CONTINUE

IF (IFLAG.EQ.1) GO TO 140

C

C READ KEYS AND SORT INTO KEY ARRAY

C

200 READ (1,9000,IOSTAT=ISTAT,ERR=8020,END=300)(INAUTH(I),I=1,3)

IREC=IREC+1

DO 280 1=1,3

IF (INAUTH(I).EQ. SPACES) GO TO 280

IF ( INAUTH ( I ).EQ.'DELEDELEDELEDELEDELEDELEDELEDELE') GO TO 280

DO 260 J=1,ICT

C-70
IF (AUTHOR(J).NE.INAUTH(I)) GO TO 220

C

C INPUT KEY ALREADY ON ARRAY

C

DO 210 K=1,50

IF (KEYREC(J,K).NE.O) GO TO 210

KEYREC(J,K)=IREC

GO TO 280

210 CONTINUE

C

C ADD INPUT KEY TO ARRAY - SORT

C

220 IF (AUTHOR(J).LT.INAUTH(I)) GO TO 260

H0LDCT=ICT+1

240 AUTHOR (H0LDCT)=AUTH0R(H0LDCT-1

)

DO 250 K=1,50

KEYREC(H0LDCT,K)=KEYREC(H0LDCT-1,K)

250 CONTINUE

H0LDCT=H0LDCT-1

IF (HOLDCT.GT.J) GO TO 240

AUTHOR(J)=INAUTH(I)

KEYREC(J,1)=IREC

DO 258 K=2,50

IF (KEYREC(J,K).EQ.O) GO TO 270

KEYREC(J,K)=0

258 CONTINUE

GO TO 270

260 CONTINUE

C

C APPEND INPUT KEY TO ARRAY

C

AUTHOR ( ICT+ 1

) = INAUTH ( I

)

KEYREC(ICT+1,1)=IREC

270 ICT=ICT+1

280 CONTINUE

C

GO TO 200

C

C WRITE ARRAY TO KGSAUTH.DTA

C

300 CLOSE (1,IOSTAT=ISTAT,ERR=8040)

OPEN ( 2 , lOSTATrlSTAT , ERR=80 1 , FILE= ' KGSAUTH . DTA ' , RECL=232

- STATUS: ' RENEW ,SHARE='ERW')

I0VFCT=ICT+1

WRITE (2,9120,ERR=8000) lOVFCT

WRITE (3,9130,ERR=8000)

DO 420 1 = 1, ICT

WRITE (2,9060,ERR=8000) AUTHOR(I) , (KEYRECCI, J) , J=1 ,50)

WRITE (3,9080,ERR=8000) AUTHOR(I)

420 CONTINUE

C

C CLOSEOUT

C

CLOSE(3,IOSTATrISTAT,ERR=8040)

CALL KGSINDEX (1)

WRITE (6,9100,ERR=8000) ICT

C-71
9999

C

C

C

8000

8005

8010

8015

8020

8025

8040

8045

C

C

c9000

9060

9080

9100

9120

9130

C

C

C

C

C

C

C

C

C

C

C

c

c

c

c

c

c

c

c

cc

c

c

RETURN

ERROR REPORTING AND FORMATING

WRITE (6,8005,ERR=9999)

FORMAT (IX, 'COMMAND DEVICE ERROR')

GO TO 9999

WRITE (6,8015,ERR=8000)ISTAT

FORMAT (IX, 'ERROR ON OPENING FILE - lOSTAT

GO TO 9999

WRITE (6,8025,ERR=8000) ISTAT

FORMAT (IX, 'ERROR ON READING FILE - lOSTAT

GO TO 9999

WRITE (6,8045,ERR=8000) ISTAT

FORMAT (IX, 'ERROR ON CLOSING FILE - lOSTAT

GO TO 9999

I/O FORMATING

FORMAT (3A32,276X)

FORMAT (A32,50I4)

FORMAT (1X,A32)

FORMAT (IX, 'AUTHORS IN DICTIONARY = ',18)

FORMAT (14)

FORMAT (1H1//1X)

END

',14)

•,I4)

M4)

KGSINDEX

SUBROUTINE KGSINDEX (IFILE)

WRITTEN BY JUDITH CALABRESE - 15 JULY 81

CREATES THE INDEX USED TO ACCESS THE KGS DICTIONARY

»>>> LOGICAL UNIT ASSIGNMENTS <«<<

LU2 - KGSAUTH.DTA (OPENED IN MAIN)

LU4 - KGSIDXA.DTA

LU6 - COMMAND DEVICE

CHARACTER* 1, LETTER

CHARACTER*2,LETTER2

INTEGER REGNO

INITIALIZE VALUES

C-72
RtCN0 = 1 REWIND 2

C

C OPEN INDEX FILE

C IFILE = - OPEN KEYWORD INDEX

C IFILE = 1 - OPEN AUTHOR INDEX

C

IF (IFILE. EQ.O)

-OPEN ( 4 , IOSTAT=ISTAT , ERR=80 1 ,FILE= ' KGSIDX . DTA ' , RECL=5

,

- STATUS='RENEW' .SHAREr'ERW')

C

IF (IFILE. EQ.1)

-OPEN ( 4 , lOSTATrlSTAT , ERR=80 1 , FILE= ' KGSIDXA . DTA ' , RECL=5

,

- STATUS='RENEW' ,SHARE='ERW')

C

C READ IN OVERFLOW POINTER FROM DICTIONARY

C

IF (IFILE. EQ.O) READ (2 ,9000 , ERRrSOGG) LETTER1

IF (IFILE. EQ.1) READ (2 ,9010 , ERR=8GGG) LETTER1

C

C READ IN FIRST KEY FROM DICTIONARY

C

IF (IFILE. EQ.O) READ (2,9000 ,IOSTAT=ISTAT,ERR=8G20) LETTER1

IF (IFILE. EQ.1) READ (2 ,9010 , I0STAT=ISTAT,ERR=8G20) LETTER1

RECN0=RECN0+1

WRITE (4,9020,IOSTAT=ISTAT,ERR=8G40) LETTER 1 , REGNO

C

C READ REMAINING KEYS AND COMPARE

C

10 IF (IFILE. EQ.O)

-READ (2,9000,IOSTAT=ISTAT,ERR=802G,END=9999) LETTER2

IF (IFILE. EQ.1)

-READ (2,901G,IOSTAT=ISTAT,ERR=802G,END=9999) LETTER2

RECN0=RECN0+1

IF (LETTER1.EQ.LETTER2) GO TO 10

WRITE (4,902G,IOSTAT=ISTAT,ERR=8040) LETTER2, REGNO

LETTER 1=LETTER2

GO TO 10

9999 RETURN

C

C»»> ERROR REPORTING & FORMATING «<«

C

8000 WRITE (6,8005,ERR=9999)

8005 FORMAT (IX, 'COMMAND DEVICE ERROR')

GO TO 9999

8010 WRITE (6,8015,ERR=8000) ISTAT

8015 FORMAT (IX, 'ERROR ON OPENING FILE - ISTAT = ',14)

GO TO 9999

8020 WRITE (6,8025,ERR=8000) ISTAT

8025 FORMAT (IX, 'ERROR ON READING FILE - ISTAT = ',14)

GO TO 9999

8040 WRITE (6,8045,ERR=8000) ISTAT

8045 FORMAT (IX, 'ERROR ON WRITING FILE - ISTAT = ',14)

GO TO 9999

C

C »>>> I/O FORMATTING «<«

C~73
9000 FORMAT (A1,240X)

9010 FORMAT (A1,231X)

9020 FORMAT (A1,I4)

END

$BEND

REFERENCES

MANUAL

OS/32 MT Operator's Reference Manual

MTM Terminal User's Reference Manual

FORTRAN VII Level 1 Reference Manual

FORTRAN VII Level 1 User's Guide

REFERENCE NUMBER

29-574

B29-591

48-017R00

S29-657R04

C-74
NBS-n4A (REV. 2-8C) U.S. DEPT. OF COMM. BIBLIOGRAPHIC DATA

SHEET (See instructions)

1. PUBLICATION OR

REPORT NO,

NBS TN-1167

2. Performing Organ. Report No 3. Publication Date

4. TITLE AND SUBTITLE

A Computer Data Base System for Indexing Research Papers

5. AUTHOR(S)

Judith T. Talabrese, T^wrence J. Kaetzel, Pobert A. Glass, Heorge R. Smith

6. PERFORMING ORGANIZATION (If joint or other thc3n NBS. see instructions)

NATIONAL BUREAU OF STANDARDS

DEPARTMENT OF COMMERCE

WASHINGTON, D.C. 20234

7. Contract/Grant No.

8. Type of Report & Period Covered

Final

9. SPONSORING ORGANIZATION NAME AND COMPLETE ADDRESS (Street. City. State, ZIP)

Same as Item 6.

10. SUPPLEMENTARY NOTES

Supersedes NBS Technical Note 1123

I I Document describes a computer program; SF-185, FlPS Software Summary, is attached.

11. ABSTRACT (A 200-word or less factual sunnnnary of most si gnificant information. If document includes a significant

bibHograp^^y or literature survey, mention it here)

This report represents a significant revision to NBS Technical Note 1123

published in 1980. In that report, the Kaetzel, Glass, Smith (KGS) data base

system permitted users to index, edit, classify, and retrieve scientific

research paper citations. During the past 15 months, the system was modified

and enhanced. All programs are written in standard FORTRAN VII Level I programming language providing transportability among computer systems. Retrieval

time has been greatly reduced by changing from a sequential access method to

an indexed, directory look-up file structure which allows faster and more efficient random access. The file structure is machine independent. Because

of the responsiveness of the extract mode, the one-key retrieval is unnecessary

and has been deleted from the revised system. The keyword mode has been

replaced by the information mode which provides statistics on authors and

keywords. A file maintenance mode has been added to ensure data base integrity. The KGS system has been separated from the larger Publications Data Base

and the select data base mode has been removed. Software has been tailored to

meet KGS users' needs. Overall, the revised system is faster and uses resources more efficiently than the original data base.

12. KEY WORDS fS/x to twelve entries; alphabetical order; capitalize only proper names; and separate key words by semicolons)

computer indexing; data base; directory look-up; information

retrieval; interactive processing; random access.

13. AVAILABILITY

[TT] Unlimited For Official Distribution. Do Not Release to NTIS

fx] Order From Superintendent of Documents, U.S. Government Printing Office, Washington, D.C. 20402. [^ Order From National Technical Information Service (NTIS), Springfield, VA. 22161

14. NO. OF

PRINTED PAGES

102

15. Price

$5.50

USCOMM-DC 6043-P80

<1U.S.. GOVERNMENT PRINTING OFFICE: 19 8 2-360-997/2284





\

NBS TECHNICAL PUBLICATIONS

PERIODICALS

JOURNAL OF RESEARCH—The Journal of Research of the National Bureau of Standards reports NBS research and develop- ment in those disciplines of the physical and engineering sciences in which the Bureau is active. These include physics, chemistry,

engineering, mathematics, and computer sciences. Papers cover a broad range of subjects, with major emphasis on measurement

methodology and the basic technology underlying standardization. Also included from time to time are survey articles on topics

closely related to the Bureau's technical and scientific programs. As a special service to subscribers each issue contains complete

citations to all recent Bureau publications in both NBS and non- NBS media. Issued six times a year. Annual subscription: domestic

$18; foreign $22.50. Single copy, $4.25 domestic; $5.35 foreign.

NONPERIODICALS

Monographs—Major contributions to the technical literature on

various subjects related to the Bureau's scientific and technical activities. Handbooks—Recommended codes of engineering and industrial practice (including safety codes) developed in cooperation with in- terested industries, professional organizations, and regulatory

bodies. Special Publications—Include proceedings of conferences sponsored by NBS, NBS annual reports, and other special publications

appropriate to this grouping such as wall charts, pocket cards, and

bibliographies. Applied Mathematics Series—Mathematical tables, manuals, and

studies of special interest to physicists, engineers, chemists,

biologists, mathematicians, computer programmers, and others engaged in scientific and technical work.

National Standard Reference Data Series—Provides quantitative data on the physical and chemical properties of materials, compiled from the world's literature and critically evaluated. Developed under a worldwide program coordinated by NBS under

the authoritv of the National Standard Data Act (Public Law

90-396).

NOTE: The principal publication outlet for the foregoing data is the Journal of Physical and Chemical Reference Data (JPCRD)

published quarterly for NBS by the American Chemical Society

(ACS) and the American Institute of Physics (AIP). Subscriptions,

reprints, and supplements available from ACS, I 155 Sixteenth St., NW, Washington, DC 20056.

Building Science Series—Disseminates technical information developed at the Bureau on building materials, components,

systems, and whole structures. The series presents research results,

test methods, and performance criteria related to the structural and

environmental functions and the durability and safety characteristics of building elements and systems.

Technical Notes—Studies or reports which are complete in themselves but restrictive in their treatment of a subject. Analogous to monographs but not so comprehensive in scope or definitive in treatment of the subject area. Often serve as a vehicle for final reports of work performed at NBS under the sponsorship of other government agencies.

Voluntary Product Standards—Developed under procedures

published by the Department of Commerce in Part 10, Title 15, of

the Code of Federal Regulations. The standards establish nationally recognized requirements for products, and provide all concerned interests with a basis for common understanding of the

characteristics of the products. NBS administers this program as a supplement to the activities of the private sector standardizing

organizations. Consumer Information Series—Practical information, based on NBS research and experience, covering areas of interest to the con- sumer. Easily understandable language and illustrations provide

useful background knowledge for shopping in today's technological marketplace. Order the above NBS publications from: Supenniendent of Documents. Government Printing Office. Washington. DC 20402. Order the following NBS publications—FIPS and NBSIR's—from

the National Technical Information Services. Springfield. VA 22161

.

Federal Information Processing Standards Publications (FIPS

PUB)—Publications in this series collectively constitute the Federal Information Processing Standards Register. The Register

serves as the official source of information in the Federal Govern- ment regarding standards issued by NBS pursuant to the Federal Property and Administrative Services Act of 1949 as amended,

Public Law 89-306 (79 Stat. 1127), and as implemented by Executive Order 11717(38 FR 12315, dated May 11, 1973) and Part 6

of Title 15 CFR (Code of Federal Regulations).

NBS Interagency Reports (NBSIR)—A special series of interim or

final reports on work performed by NBS for outside sponsors

(both government and non-government). In general, initial dis- tribution is handled by the sponsor; public distribution is by the National Technical Information Services, Springfield, VA 22161,

in paper copy or microfiche form.
U.S. Department of Commerce

National Bureau of Standards

Washington, D.C. 20234

Official Business

Penalty for Private Use $300

POSTAGE AND FEES PAID US DEPARTMENT OF COMMERCi

COM-215 THIRD CLASS BULK RATE