INDEX
*  SPIRES Searching and Updating
+  Foreword
+1  About This Manual
+2  Notation Conventions
+3  Preface
A  Getting Started in SPIRES
A.1  Introduction
A.1.1  How SPIRES Gets Its Information
A.1.2  How You Get Information from SPIRES
A.1.3  An Overview of SPIRES and Its Documentation
A.2  Communicating with SPIRES
A.2.1  Logging On
A.2.2  Entering: The SPIRES Command
A.2.3  Leaving SPIRES: The EXIT Command
A.2.4  The SET TRACE (SET TRA) and SET NOTRACE (SET NOTRA) Commands
A.2.5  Using Other Systems Through SPIRES
A.2.5.1  This section is no longer applicable in the Unix version.
A.2.5.2  The BREAK (BRE) Command
A.2.6  Interrupting a SPIRES Command
A.2.7  Abbreviations
A.2.8  Error Messages and Codes
A.2.9  The Active File and SPIRES
A.2.9.1  The IN ACTIVE (IN ACT) Prefix
A.2.9.2  The SET LIST and SET NOLIST Commands
A.2.9.3  The SET CLEAR (SET CLR) and SET NOCLEAR (SET NOCLR) Commands
A.2.9.4  The SET LENGTH (SET LEN) Command
A.2.9.5  The SHOW SETTINGS (SHO SET) Command
A.2.10  The SHOW SPIRES MAIL and SEND SPIRES MAIL Commands
A.3  Learning about SPIRES
A.3.1  Online Aids
A.3.1.1  The HELP Command
A.3.1.2  The EXPLAIN (EXP) Command
A.3.1.3  The SHOW EXAMPLE (SHO EXA) Command
A.3.1.4  The SHOW SYNTAX (SHO SYN) Command
A.3.1.5  SPIRES News
A.3.2  Printed Documents
B  How to Select and Search a Subfile
B.1  The Search Procedure
B.1.1  The Goal Record and Data Elements
B.1.2  The Subfile
B.1.3  Selecting a Subfile
B.1.4  Searching a Subfile
B.1.5  Displaying the Search Result
B.2  Choosing a Subfile
B.2.1  The SHOW SUBFILES (SHO SUB) Command
B.2.2  The SHOW SUBFILE DESCRIPTION (SHO SUB DES) Command
B.2.3  The SELECT (SEL) Command
B.2.4  The SHOW SUBFILE SIZE (SHO SUB SIZ) Command
B.2.5  Command Logging During Subfile Use
B.2.6  (*) Selecting a Chargeable Subfile
B.3  Specifying a Search Request
B.3.1  How Searching Works
B.3.1.1  The SHOW INDEXES (SHO IND) Command
B.3.1.2  How Indexes Are Created
B.3.1.3  Types of Indexes
B.3.2  Simple Search Requests
B.3.2.1  The Simplest FIND (FIN) Command
B.3.2.2  The Search Expression
B.3.2.3  Relational Operators in Search Expressions
B.3.2.3.1  (The Equality Operator (" " or "="))
B.3.2.3.1a  (The LIKE Operator)
B.3.2.3.2  (The Inequality Operators)
B.3.2.3.3  (The BETWEEN...AND... Operator)
B.3.2.3.4  (The FROM...TO... Operator)
B.3.2.3.5  (The PREFIX Operator)
B.3.2.3.6  (The SUFFIX Operator)
B.3.2.3.7  (The WORD Operator)
B.3.2.3.8  (The STRING Operator)
B.3.2.3.9  (The HAVING Operator)
B.3.2.3.10  (The WITH Operator)
B.3.2.3.11  (The MASK Operator)
B.3.3  Iterative Search Requests
B.3.3.1  Logical Operators
B.3.3.1.1  (The AND (&) Operator)
B.3.3.1.2  (The AND NOT (&~) Operator)
B.3.3.1.3  (The OR (|) Operator)
B.3.3.1.4  ((*) The TAND, TOR, and TNOT Operators)
B.3.3.1.5  ((*) Symbolic Abbreviations for AND, OR, AND NOT)
B.3.3.2  The BACKUP (BAC) Command
B.3.3.3  The SET SEARCH MODIFIER (SET SEA MOD) Command
B.3.4  Compound Search Requests
B.3.4.1  The Compound FIND Command
B.3.4.2  Parentheses in Search Requests
B.3.4.3  Compound vs. Iterative Search Requests
B.3.5  Subfile-Specific Search Facilities
B.3.5.1  Word Indexing
B.3.5.2  Personal Name Indexing
B.3.5.3  Date Indexing
B.3.5.3a  Forms of Dates Allowed by SPIRES
B.3.5.4  Searching on Truncated Values
B.3.5.5  Exclusion/Inclusion Lists
B.3.5.6  (*) Searching on Code Stems
B.3.5.7  Other Search Value Validations
B.3.5.8  (*) The Sub-Index
B.3.5.9  (*) Index Qualifiers
B.3.5.10  (*) Qualifiers and the TAND, TNOT, and TOR Operators
B.3.5.11  Proximity Searching
B.3.6  Search Techniques and Aids
B.3.6.1  The SHOW CLOCKS (SHO CLO) Command
B.3.6.2  The SET TIMER (SET TIM) Command
B.3.6.3  The BROWSE (BRO) index-name Command
B.3.6.4  Search Request Defaults and Ambiguities
B.3.6.4.1  (Default Index Names)
B.3.6.4.2  (Default Logical Operators)
B.3.6.4.3  (Ambiguities in Search Procedures)
B.3.6.4.4  (Ambiguous Special Characters)
B.3.6.4.5  (Ambibuous Search Values)
B.3.6.5  Searching Word Indexes
B.3.6.6  (*) The SET BIG SEARCH Command
B.3.7  Reviewing Searches
B.3.7.1  The SHOW RESULT (SHO RES) and CLEAR RESULT (CLR RES) Commands
B.3.7.2  The SHOW SEARCH (SHO SEA) Command
B.3.8  Saving Searches for Later Use
B.3.8.1  The STORE (STO) RESULT.name Command
B.3.8.2  The @RESULT.name Search Expression
B.3.8.3  The ERASE (ERA) RESULT.name Command
B.3.8.4  The SHOW (SHO) RESULT.name Command
B.3.8.5  The SHOW RESULT NAMES (SHO RES NAM) Command
B.3.9  The Result History
B.3.9.1  The SET RESULT HISTORY Command
B.3.9.2  The SHOW RESULT HISTORY Command
B.3.9.3  The CLEAR RESULT HISTORY Command
B.3.9.4  The Result History and the BACKUP Command
B.4  Examining Records Found by Searching
B.4.1  The SHOW ELEMENTS (SHO ELE) Command
B.4.1.1  The SHOW ELEMENT NAMES Command
B.4.1.2  The SHOW ELEMENT DESCRIPTION Command
B.4.1.3  The SHOW ELEMENT INFORMATION Command
B.4.2  Simple Examination of Search Results
B.4.2.1  The TYPE (TYP) Command
B.4.3  Abbreviating the Records for Examination
B.4.3.1  The "TYPE element-list" Command
B.4.3.2  The SET ELEMENTS, CLEAR ELEMENTS, and SHOW ELEMENTS SET Commands
B.4.4  Modifying the Results by Examination: The KEEP Option
B.4.5  Ordering the Result for Examination: The SEQUENCE (SEQ) Command
B.4.5a  Refining your Display with Element Filters
B.4.5a.1  The SET FILTER Command
B.4.5a.2  Showing and Clearing Filters
B.4.5a.3  Filter Capabilities and Limits
B.4.6  Using Formats
B.4.6.1  Automatic Format Selection
B.4.6.2  The SHOW FORMATS (SHO FOR) Command
B.4.6.3  The SET FORMAT (SET FOR) Command
B.4.6.4  The CLEAR FORMAT (CLR FOR) Command
B.4.6.5  The SHOW FORMATS SET (SHO FOR SET) Command
B.5  Other Kinds of Searching
B.5.1  Direct Examination of Goal Record Contents
B.5.1.1  The DISPLAY (DIS) Command
B.5.1.2  The BROWSE (BRO) GOAL Command
B.5.2  (*) Direct Examination of Indexed Values
B.5.2.1  (*) The SYNONYM (SYN) Command
B.5.3  Searching Unindexed Information
B.5.3.1  Differences Between Index and Sequential Searching
B.5.3.2  The ALSO Command
B.5.3.3  Global FOR: The "FOR class" Command
B.5.3.4  The DISPLAY (DIS) Command in Global FOR
B.5.3.5  The FOR TREE Command
B.5.3.6  The FOR SUBFILE Command
B.5.3.7  The FOR RESULT (FOR RES) and FOR STACK (FOR STA) Commands
B.5.4  Examining Unrelated Records
B.5.4.1  The STACK (STA) Command
B.5.4.2  Saving Stacks
B.5.4.2a  The GENERATE RESULT command
B.5.4.3  The EXTRACT (EXT) Command
B.5.4.4  The SCAN Command
B.5.5  Examining Other Versions of a Record: the VIA Prefix
C  SPIRES Report Writing: Report Definer and $REPORT
C.1  Report Definer
C.1.1  Entering Report Definer
C.1.2  The Report Definer Environment and Commands
C.1.3  Naming Your Elements (First Screen)
C.1.4  Summarizing Element Values (Second Screen)
C.1.5  Organizing Elements into Groups (Third Screen)
C.1.6  Element Layout (Fourth Screen)
C.1.7  Changing Your Page Layout (Fifth Screen)
C.1.8  Displaying Your Report
C.1.9  Sample Reports From Report Definer
C.1.9.1  Report Definer Checklist and Summary
C.2  Introducing $REPORT
C.2.1  Using the $REPORT Format
C.2.2  Displaying Elements
C.2.3  Grouping and Summarizing Values
C.2.4  Formatting the Page
C.2.5  Printing the Report
C.2.6  The Sections of a Report
C.3  Command Summary
C.3.1  The SET FORMAT $REPORT and SET FORMAT * Commands
C.3.2  The SHOW FORMAT INFORMATION Command
C.3.3  The SHOW FORMAT INPUT Command in $REPORT
C.3.4  Report Writer Command Language
C.3.4.1  Prefixes
C.3.4.2  The Element List
C.3.4.3  Section-Specific Commands
C.3.4.4  Global Commands
C.3.5  Defining Sections
C.4  The Body of the Report
C.4.1  The DETAIL Sections
C.4.2  The Element List
C.4.2.1  Multiply-Occurring Elements
C.4.2.2  Structures
C.4.2.3  Dynamic Elements
C.4.2.4  Literal Strings in the Element List
C.4.3  Element Parameters
C.4.3.1  The COLUMN Parameter
C.4.3.2  The WIDTH Parameter
C.4.3.3  The ADJUST and BUILD Parameters
C.4.3.4  The INDENT Parameter
C.4.3.5  The HEADING Parameter
C.4.3.6  The EDIT Parameter
C.4.3.7  The TYPE Parameter
C.4.3.8  The DEFAULT Parameter
C.4.4  Record-level Summary Elements
C.4.5  The OPTIONS Command
C.4.5.1  The NOBREAK Option
C.4.5.2  The MAXROWS Option
C.4.5.3  The NOREPORT and NOPAGE Options
C.4.5.4  The CLUSTER Option
C.4.5.5  The DEFAULT Option
C.4.5.6  The ADJUST Option
C.4.5.7  The GAP Option
C.4.5.8  Options For Downloading Data to Microcomputer Programs
C.4.5.9  Options for Various Styles
C.4.6  Element Information Packets and $REPORT
C.4.7  Vertical Reports
C.5  Section-Specific Commands
C.5.1  The NEWPAGE and FRONTPAGE Commands
C.5.2  The PRINT Command
C.5.3  The IN ROW Prefix
C.5.4  The SKIP Command
C.5.5  Vertical Binding and Element Lists
C.5.6  The FONT Command
C.6  Grouping Elements and Summarizing Data
C.6.1  The GROUPED BY Command
C.6.1.1  The NOFINAL Parameter
C.6.1.2  The DISPLAY Parameter
C.6.1.3  The BLANKS Parameter
C.6.1.4  The HEADING and NAME Parameters
C.6.1.5  The RecNo Parameter
C.6.2  The NOGROUP Option
C.6.3  The START OF GROUP Section
C.6.4  Summarizing Data: The END OF GROUP Section
C.6.5  Summary Arithmetic Functions
C.6.5a  Edit Masks in $REPORT -- Reference Chart
C.6.6  The LABEL Command
C.6.7  Summary Elements: The DEFINE VALUE Command
C.6.8  Groups in Vertical Reports
C.7  The Appearance of the Printed Page
C.7.1  Default Page Headers and the TITLE Option
C.7.2  The START OF PAGE Section
C.7.3  Page Footers: The END OF PAGE Section
C.7.4  The LENGTH Option
C.7.5  The LINES Option
C.7.6  The INDENT Option
C.8  Report Titles and Summaries
C.8.1  The Title Page: The START OF REPORT Section
C.8.2  Final Summaries: The END OF REPORT Section
C.9  Summary Reports
C.9.1  Ending Section Summaries
C.9.2  The SUMMARIZE Option
C.9.2.1  Summarizing the Entire Report
C.9.2.2  Summarizing with Groups
C.10  Syntax Reference
C.10.1  Complete Syntax
C.10.2  Commands, Syntax, and Defaults
C.11  Generating Formats Code from your $REPORT Format
D  Subfile Modification: Adding, Updating and Removing Records
D.1  Introduction to Subfile Modification
D.1.1  Subfile Modification Procedures
D.1.2  Subfile Privileges
D.1.3  Determining the Types of Data to Be Input
D.1.3.1  (What is the goal record key?)
D.1.3.2  (Are all the elements required?)
D.1.3.3  (How many times can an element occur?)
D.1.3.4  (How long can an element value be?)
D.1.3.5  (Should the values be entered as codes?)
D.1.3.6  (The SHOW ELEMENT CHARACTERISTICS (SHO ELE CHAR) Command)
D.1.4  Using Input Formats for Subfile Modification
D.1.5  Overview of Part D
D.2  Subfile Modification Using the Active File
D.2.1  Using the WYLBUR Text Editor for Data Creation
D.2.2  Standard Format Input Rules
D.2.3  Standard Format Input with Structures
D.2.4  Adding New Information: The ADD Command
D.2.4.1  The USING (USI) Option
D.2.5  The TRANSFER (TRA) and UPDATE (UPD) Commands
D.2.6  The ADDUPDATE (ADDUPD) Command
D.2.7  The MERGE (MER) Command
D.2.7a  The ADDMERGE (ADDMER) Command
D.2.8  Update Messages and Error Codes
D.2.8.1  The SET SUPERMAX Command
D.3  The SPIRES Prompting Input Format: $PROMPT
D.3.1  The SET FORMAT $PROMPT (SET FOR $PROMPT) Command
D.3.1.1  The SET FORMAT * Command
D.3.1.2  The SHOW FORMAT INFORMATION and SHOW FORMAT INPUT Commands
D.3.1.3  Adding Records using the $PROMPT format
D.3.1.4  Updating Records Using the $PROMPT Format
D.3.1.5  Errors and Error Messages
D.3.2  The Element List
D.3.2.1  Element List Specification
D.3.2.1.1  (Changing How an Element is Prompted)
D.3.2.1.2  (Changing the Number of Times an Element is Prompted)
D.3.2.1.3  (Adding New Occurrences During MERGE)
D.3.2.1.4  (Changing How a Structure is Prompted)
D.3.2.2  Modifying the Current Element List
D.3.2.3  Summary of Element Options
D.3.3  Processing Options
D.3.4  Subcommands for Input Processing Control
D.3.4.1  Element Input Subcommands
D.3.4.2  Structure Control Subcommands
D.3.4.3  Element MERGE Subcommands
D.3.4.4  Function Control Subcommands
D.3.4.5  Summary of Subcommands
D.3.5  (*) Special Considerations for File Definers
D.4  Removing Records and Undoing Subfile Modification Requests
D.4.1  Removing Records: The REMOVE (REM) Command
D.4.2  The UNQUEUE (UNQ) Command
D.4.3  The DEQUEUE (DEQ) Command
D.4.4  The ZAP DEFQ Command
D.5  Updating Using Global FOR
D.5.1  The TRANSFER (TRA) Command in Global FOR
D.5.2  The REMOVE (REM) Command in Global FOR
D.5.3  The DISPLAY (DIS) Command in Global FOR
D.5.4  The MERGE (MER) Command in Global FOR
D.5.5  The SHOW KEYS (SHO KEY) Command
D.6  Effects of Online Modification
D.6.1  Effects of Subfile Modification Before File Processing
D.6.2  The Effects of File Processing
D.6.3  The Effects of Immediate Indexing
D.7  Monitoring Subfile Updating Activity Using Global FOR
D.7.1  The FOR DEFQ Command
D.7.2  The FOR ADDS (FOR ADD) Command
D.7.3  The FOR UPDATES (FOR UPD) Command
D.7.4  The FOR REMOVES (FOR REM) Command
D.7.5  The STACK (STA) Command in Global FOR
D.7.6  The DEQUEUE (DEQ) Command in Global FOR
D.7.7  The UNQUEUE (UNQ) Command in Global FOR
D.8  Batch (Multiple-Record) Subfile Modification in SPIRES
D.8.1  The INPUT BATCH Command in SPIRES
D.8.1.1  Setting an Exception File
D.8.2  Using Input Formats for Batch Modifications
D.8.3  Submitting Overnight Batch Requests -- The BATCH Command
D.9  Transaction Group Processing: Bracketing Multiple Record Updates
D.9.1  The OPEN TRANSACTION GROUP and CLOSE TRANSACTION GROUP Commands
D.9.2  Some Restrictions and Limits to Transaction Group Processing
D.9.3  Timing of Transaction Group Processing
D.9.4  (*) Special Considerations for File Owners
E  Additional Facilities for the SPIRES User
E.1  Protocols: The Invocation of Predefined Command Sequences
E.1.1  Executing Protocols from a SPIRES Subfile
E.1.1.1  The SET XEQ Command
E.1.1.2  The XEQ FROM Command
E.2  The Entry Commands Subfile
E.3  Use of SPIRES in Batch
E.3.1  This section is not applicable to Unix
E.3.1.1  Commands Used Only in Batch SPIRES
E.3.2  The OFFLINE (OFF) Command
E.3.2.1  The SAVE Option
E.3.2.2  The RERUN Option
E.3.3  This section is not applicable to Unix
E.4  Control of System Messages
E.4.1  The SET MESSAGES (SET MES) Command
E.4.2  The SET WIDTH Command
:
:29  SPIRES Documentation

*  SPIRES Searching and Updating

******************************************************************
*                                                                *
*                     Stanford Data Center                       *
*                     Stanford University                        *
*                     Stanford, Ca.   94305                      *
*                                                                *
*       (c)Copyright 1994 by the Board of Trustees of the        *
*               Leland Stanford Junior University                *
*                      All rights reserved                       *
*            Printed in the United States of America             *
*                                                                *
******************************************************************

        SPIRES (TM) is a trademark of Stanford University.

+  Foreword

+1  About This Manual

The "SPIRES Searching and Updating" Manual is divided into five distinct but closely related parts, progressing steadily from a general overview of SPIRES to the topics of searching, displaying, reporting upon, and updating (or modifying) the information in SPIRES records.


Part A           offers a general introduction to SPIRES.
Part B           describes commands for searching and displaying
                           stored information.
Part C           describes methods to create special reports using
                           this stored information.
Part D           covers techniques for adding and updating data.
Part E           discusses additional tools available for advanced
                           SPIRES users.

Many examples in the text are taken directly from applications and sample data bases currently in use at Stanford or at other sites. Other examples are fictitious but suggest plausible future applications of SPIRES.

SPIRES was originally developed for the ORVYL/WYLBUR/MILTEN operating environment developed at Stanford University. It also ran under IBM's VM/CMS (Virtual Machine / Conversational Monitor System) and under MTS (Michigan Terminal System).

This version of "SPIRES Searching and Updating" was prepared for the Unix version of SPIRES.

You do not need to know a computer programming language to use SPIRES. This manual does assume some familiarity with the WYLBUR text editor, a Stanford system that provides communication between your terminal and the computer. WYLBUR can also help you prepare or correct data for use with SPIRES. The document "WYLBUR Overview" serves as a helpful introduction to the subject.

SPIRES is an expanding system that is continually being improved. Changes to the system are usually made every few months in an upward-compatible fashion -- that is, new facilities are added, but old ones are not taken away. On its publication date, each new edition of "Searching and Updating" incorporates documentation on the latest of these improvements. However, each new edition becomes outdated in its turn as the system continues to expand.

You can keep informed of changes to this manual and to SPIRES by consulting the online file SPIRES NEWS (SHOW SPIRES NEWS). The SPIRES NEWS file is always kept current with SPIRES system enhancements, so you can learn about changes there without waiting for the SPIRES manuals to be revised and republished. [See A.3.1.5.]

+2  Notation Conventions

Examples

In SPIRES manuals, examples of sessions are shown with prompts and messages from SPIRES as they actually appear on the terminal screen; SPIRES prompts usually end with a question mark or greater-than sign (">"), while SPIRES messages usually begin with a hyphen. Commands you type are shown in lowercase, following a prompt. (You may generally use upper or lower case interchangeably when you actually use SPIRES.) For example:

Here SPIRES types "-OK to clear?" and you type "ok".

Formal Command Syntax Descriptions

In formal command syntax descriptions, uppercase letters denote command verbs or other command elements to be entered exactly as shown; a value for lowercase terms and characters must be supplied by you. For example:

To use this particular command, you type the command verb SELECT with the name of the desired subfile, for instance, "Restaurant":

where "->" is the prompt from SPIRES.

Brackets ([]) denote optional elements. Braces ({ }) indicate that you must specify one and only one of the alternatives within the braces. Within the braces or brackets, a vertical line (|) separates possible choices. Neither brackets nor braces are to be typed as part of the command. For example:

could be entered as

depending on whether you want the option. Here is an example from the report writer command language using braces:

You must choose one of the words in the braces when using this command. For example, this command could be entered as

or as

(*) = Technical Detail Indicators

Sections and subsections of this manual whose titles are preceded by an asterisk in parentheses -- (*) -- may be considered optional reading at that point. Usually the material provides details that most users will not need about how to handle uncommon situations, or technical information about how SPIRES internally handles some particular command.

+3  Preface

The usefulness of sophisticated data base and information retrieval systems has been demonstrated by a multitude of specialized online systems -- credit card data, airline reservations, etc. But the cost of developing such systems is high, and little of the investment in one specialized system is transferrable to any other.

SPIRES (Stanford Public Information REtrieval System) was developed to meet the need for a generalized data base management system -- one that could serve a bibliographic data base, a medical data base, or any of a variety of administrative and research applications. Since development costs are spread over its many users, a generalized system brings data base services within the reach of smaller applications.

SPIRES differs substantially from most commercially available data base systems in other respects, too. Most systems in the 1970's were designed primarily for batch and online access, and had only rudimentary self-contained command language capability for inquiry and searching. In contrast, SPIRES provided a rich command language for searching and updating both online and in batch.

Another important SPIRES capability missing in most systems is file definition and creation by the users; SPIRES users may develop and administer their own data base applications without the constraints found in systems requiring centralized administration.

Finally, SPIRES is designed to handle bibliographic and text applications, as well as those oriented toward administration and management. The wide range of applications found in a university environment demands a system that employs generalized data structures and manipulative capabilities. At the same time, SPIRES, with its high-level command interface and its generality, may be less CPU-efficient than a set of host language programs carefully designed and optimized for a specific application. However, the rising costs of development and maintenance, as well as decreasing CPU costs, make SPIRES an attractive alternative, especially when professional programmers are not available or their time is limited, or when the size and scope of an application rule out developing a large, specialized system.

A  Getting Started in SPIRES

A.1  Introduction

  Who is doing research on solar energy?
  What routines to calculate the Kendall coefficient of concordance
       can be called from FORTRAN?
  What Chinese restaurants serve lunch?
  Who are the clerical employees who have not been promoted during
       the last two years?
  Where are there donors with A-negative blood who have not given
       in the last 90 days?

SPIRES can give you immediate answers to questions like these. The answers to these questions can be obtained from SPIRES files of the past and present, and could be found at a terminal with only two commands.

However, SPIRES capabilities go beyond quick answers to one-time questions, as useful as those may sometimes be. Once you know where those blood donors are, for example, you might want to print a set of mailing labels and a letter to each reminding them how long it's been since the last time they donated. If it's an emergency situation, you'd instead want a list of their names and telephone numbers, and you would probably want the list ordered starting with those donors that you haven't called recently.

These are simple examples where SPIRES report generation capabilities could be useful. Real applications currently in use produce many different "reports", ranging in format from letters and mailing labels to medical records, purchase orders, conference schedules, catalogs and directories. Reports can be printed on your own hard-copy terminal, on a high-speed line printer connected to the computer, or on any other output device. Although many SPIRES files use predefined formats to produce reports, you can produce other types of reports as well, depending on your particular needs, perhaps by defining your own, or by using the Report Definer or $REPORT features in SPIRES. Or, if you are a programmer, you can combine SPIRES services with some other processor (COBOL, PL/I, etc.) to perform further operations on SPIRES results.

In summary, you can use SPIRES to answer your individual questions at the terminal, you can use it for selective retrieval of data for processing by another program, or you can use it to produce almost any kind of report you can imagine.

You will probably have many different files available to you in SPIRES for searching. Some demonstration files may be available. For example, RESTAURANT, a file on local restaurants, and BLOOD DONORS, a file on donors to an imaginary blood bank, are available for use at most sites running SPIRES. This manual will teach you how to use the files available to you, and at the same time should help you decide whether you might benefit from designing a file of your own, a private file for your own particular application.

A.1.1  How SPIRES Gets Its Information

Before any data can be entered into a SPIRES file, the file must be defined, using a special file definition language. (You may want to create your own files after you are familiar with the searching and updating capabilities. This manual does not discuss the file definition language. That is the purpose of the "SPIRES File Definition" and "SPIRES File Definer" manuals.) [See A.1.3.] The file definition specifies, among other things, how the data in your file is to be organized, how SPIRES should index the data and how the data is to be searched, and what restrictions there will be, if any, on who can use the file.

Once a file is defined, data is entered from a terminal, processed according to the file definition and saved in the computer's disk storage. Each record (probably one per person in the hypothetical file of blood donors) can be made up of a variety of required and optional data elements either fixed or varying in length -- name, address, age, blood type, etc. Each day that new records are added to a file, SPIRES builds indexes to these data elements; the indexes will be used later in answering your search requests.

Index information is just another kind of record to SPIRES, so we speak of "goal records" and "index records" to distinguish the two. Goal records (or some of the data elements in the goal records) are the object of your searches. Indexes and index records help you retrieve goal records. In the blood donor file the goal record would be a person, and one index might be on blood types; in a bibliographic file the goal record would be a book, with indexes perhaps on authors and titles.

In addition to index searching, SPIRES can do direct, sequential searching of the goal records. Although less efficient for some searches, this technique is a practical alternative when certain elements are used as search criteria so rarely that the cost of building and maintaining indexes is not justified.

A.1.2  How You Get Information from SPIRES

Searching takes place in the form of a conversation between you and SPIRES. SPIRES types its prompt (->) on your terminal and you answer with an appropriate command. Then SPIRES executes your command and prompts you for another.

A search consists of three steps:

Because SPIRES allows the file owner to define different search and update privileges to the same data for different users or user groups, and because common information can be shared among related data collections, SPIRES files are organized into "subfiles." To choose the collection you want to search, you must tell SPIRES the subfile name.

What does a search look like? Let's use those first questions in the Introduction as examples. First:

The terminal conversation would look like this (the notes to the right explain the session):

 COMMAND> spires                <-- Calling SPIRES
 -Welcome to SPIRES ...
 -> select faculty profile      <-- Choosing the subfile
 -> find keyword = solar energy <-- Specifying the criterion
 -Result: 5 PERSONS             <-- 5 records found matching the
                                     criterion
 -> type name, identification   <-- Requesting a display from the
                                     records
 NAME = Seifert, Howard S.;     <-- SPIRES begins typing data
 IDENTIFICATION = applied physicist, aerospace propulsion engineer,
 fluid dynamicist, space systems engineer, rocket designer;
 NAME = Walker, Arthur B.C., Jr.;
 IDENTIFICATION = physicist, astrophysicist;
 NAME = Wilcox, John M.;
 IDENTIFICATION = solar p...    <-- User interrupts typing by
                                     pressing ATTN key
 ->                             <-- SPIRES prompts for a new command

Let's look at the search for the second question, which was:

That terminal conversation would look like this:

 -> select restaurant           <-- New subfile chosen
 -> find cuisine = chinese      <-- A new search request
 -Result: 28 RESTAURANTS
 -> and hours = lunch           <-- Another criterion added
 -Result: 8 RESTAURANTS
 -> type                        <-- User asks SPIRES to type
                                    the complete records
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 Chung King                      Cuisine(s): Far-Eastern, Chinese
 2209 El Camino Real              Szechuan
 Palo Alto, CA                   Quality of Food: Excellent
                                 Quality of Service: Excellent

 Very tasty Chinese food.  Reasonable prices and generous portions.
 Try the smoked chicken and sizzling rice soup.
 --Reviewed by Denny Wong. Reviewed on MAY 14, 1981 and on JULY 10,
 1981--

 Hours: Lunch & dinner every day                    Phone: 327-1811
 Bar: Wine and Beer                            Average Price: $3.00
 Reservations are Unnecessary.                Payment: Cash, Credit
                                                            Card(s)

 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 China Lion Restaurant           Cuisine(s): Chinese
 3345 El Camino Real             Quality of Food: Excellent
 Palo Alto, CA                   Quality of Service: Good

 Why people go to a crowded place like Chef Chu's when there is a
 restaurant just as good wi...  <-- User interrupts typing

 ->                             <-- SPIRES prompts for a new command

As you read the rest of this manual, you will learn commands that provide detailed information about individual subfiles, so you will know which one to search and know how to phrase your requests. The examples above are very simple index searches. You can make your requests much more specific or broaden them with successive commands using logical operators, relational operators, and other SPIRES features. Part B covers the search procedure in detail.

A.1.3  An Overview of SPIRES and Its Documentation

The search commands covered in Part B of this manual are only one facet of the SPIRES system. Efficient and powerful searching was the original reason for designing the whole system, and the SPIRES searcher need never be aware of other parts of the system. However, SPIRES provides a number of other tools. The system can generally be thought of as a set of modules:

File Definition Language

    Function:  Define the structure of each file, determine handling
               of data entered into and retrieved from the file
               (input and output processing rules) and specify
               indexes to be built by the system.
    Documentation:  "SPIRES File Definition" and "SPIRES File
                    Definer".

Search and Display Commands

    Function:  Locate information in a file and present it
               to the user.  Some search commands utilize
               the indexes maintained by SPIRES; others
               examine each record directly.
    Documentation:  Part B of this manual: "SPIRES Searching
                    and Updating".

Report Generation

    Function:  Use information within a file to create reports.
    Documentation:  Part C of this manual: "SPIRES Searching
                    and Updating".

Updating Commands

    Function:  Add, remove, or modify records in a file.
    Documentation:  Part D of this manual: "SPIRES Searching
                    and Updating".

Formats

    Function:  (a) Transform SPIRES data from its default format
               into a variety of arrangements for display on any of
               the available output devices (output formats); and,
               (b) Transform input data, from an arrangement
               convenient to the person preparing it, to SPIRES
               internal input format.  Any number of formats can be
               defined for a file, including full-screen formats.
    Documentation:  "SPIRES Formats" and "SPIRES Device Services".

Protocols

    Function:  Carry out a previously prepared sequence of SPIRES
               commands (WYLBUR and Unix commands can also be
               included).  Facilities for conditional branching,
               variable definition, string manipulation and
               interactive communication with the terminal are also
               provided.
    Documentation:  "SPIRES Protocols".

Sequential Record Processing

    Function:  Manipulation of records using sequential techniques,
               rather than indexes.  Provides powerful facilities
               for processing parts of records, and management
               facilities for the file owner.
    Documentation:  "Sequential Record Processing in SPIRES:
                    Global FOR".

Device Services

    Function:  Links SPIRES to devices, such as terminals and files.
               Provides full-screen support, Host Language
               Interface, and file transfers.
    Documentation:  "SPIRES Device Services".

Changes to SPIRES

    Function:  Informs users of changes and additions to SPIRES
               and points them toward updated documentation.
    Documentation:  "SPIRES NEWS (SHOW SPIRES NEWS command)".
                    See also the Appendix on documentation in each
                    SPIRES manual.

In addition to the reference manuals cited above, SPIRES has several primers that introduce some of these components in a less rigorous way than the reference manuals. Each primer's title begins with "A Guide to". Here are the titles in the series so far:

A.2  Communicating with SPIRES

The material in this chapter covers fundamentals of conversing with SPIRES. Sections A.2.1 through A.2.3 relate to the use of SPIRES on the mainframe computer. You will need: (1) an account for computer services and (2) a terminal.

Account information should be available at the computer center whence this manual came. The people there (and specifically, your SPIRES consultant) should be able to help you determine any particular setup requirements for your account to be able to use SPIRES (if any). (You may, for example, need a particular amount of storage space reserved for you if you intend to create a SPIRES file.) The people at the computer center can also give you information on terminals that can be used to access the computer on which SPIRES runs.

A.2.1  Logging On

Before you can use SPIRES, you must establish a connection between your terminal and the computer, and respond to the logon prompts that ask you to identify yourself. Your SPIRES consultant or other staff members at the computer center should be able to help you logon if need help. If you have difficulty establishing a connection or any problems with operation of your terminal, contact them as well.

Your computer center probably has literature to give you that has detailed instructions for logging on to the computer.

A.2.2  Entering: The SPIRES Command

When you have completed the logon procedure, the system shows you it is ready to accept commands by typing "Command>". (This prompt may vary, depending on different parameters set in Unix. See Unix documentation for more information.)

To enter SPIRES, type the command "spires" (the complete command syntax is shown later).

As soon as SPIRES has been summoned, you will get a welcoming message [See A.2.4.] and the first SPIRES command prompt: "->". (This prompt can and will vary during your SPIRES session, depending on other settings and modes you will learn about.) Sometimes you may also get a message about system changes, a referral to SPIRES NEWS [See A.3.1.5.] and possibly a message that you have received SPIRES mail. [See A.2.10.]

The procedure looks like this:

SPIRES displays its release number in the welcome message to help you identify which release of the program you are using. The first two digits represent the year, and the second two represent the month of the release ("June 1987" in the sample above). Which release of SPIRES you are using is particularly useful to your consultant if you are reporting problems.

SPIRES is a public program running under Unix, which is a timesharing monitor and file system.

SPIRES may be disabled by system's programmers. If SPIRES is not available when you attempt to enter SPIRES, the following message is likely to appear:

You should try again when SPIRES is available.

Special Parameters on the SPIRES Command

You may add some special parameters to the SPIRES command to tailor the SPIRES environment and control the messages SPIRES displays as you enter. Generally these parameters are a set of dash-options, like: -q

A.2.3  Leaving SPIRES: The EXIT Command

When you are through using SPIRES, type

Control will be returned to WYLBUR, and you will again receive the "Command>" prompt.

When you have finished working, type LOGOFF. (You may also log off without exiting SPIRES.)

If you use the QUIET option, you will be returned to WYLBUR without receiving the "Exiting SPIRES" message.

A.2.4  The SET TRACE (SET TRA) and SET NOTRACE (SET NOTRA) Commands

(Note: Command tracing as discussed below is currently disabled at most, if not all, SPIRES sites. Contact your SPIRES consultant to find out whether it is enabled at your site.)

Unless you take specific action to prohibit it, SPIRES logs all commands issued during a terminal session. This is done to provide the SPIRES consultants with knowledge about how the system is being used and how it might be improved. It also provides a complete record of actions taken by a user during the terminal session preceding a software problem; this is often an invaluable aid to timely problem resolution. It should be emphasized, however, that only commands are traced, not data. Furthermore, it is the right of every user to turn off the tracing facility.

You may issue the command:

at any time during the session to disable the trace facility. If you have disabled tracing, it may be restarted with the command:

A.2.5  Using Other Systems Through SPIRES

You can issue almost all WYLBUR and Unix commands while in SPIRES. This means you can edit SPIRES results and print material offline or submit other jobs without needing to exit SPIRES and later reenter. When you type a command SPIRES does not recognize, it simply passes the command to Unix.

If the commands issued during a SPIRES session are primarily SPIRES commands, then there is no problem with the efficiency of passing commands from SPIRES to WYLBUR and Unix. However, if a SPIRES session consists primarily of WYLBUR editing commands and only occasionally of SPIRES searching and updating commands, some small degree of inefficiency is introduced. If you need to issue a series of WYLBUR commands, you may wish to save yourself the expense of passing them through SPIRES first. Using the EXIT command is a possible answer but is not convenient, since you would completely lose your place in SPIRES -- you would probably have to issue several commands just to regain your previous position in SPIRES. The best methods to get in more direct contact with WYLBUR is to launch WYLBUR while you are still in SPIRES. There are several ways to do that, described elsewhere.

A.2.5.1  This section is no longer applicable in the Unix version.

A.2.5.2  The BREAK (BRE) Command

The BREAK command no longer does anything useful in the Unix version.

A.2.6  Interrupting a SPIRES Command

The ATTN/BREAK key has different meanings to SPIRES depending on when it is pressed.

Pressing ATTN/BREAK after you have begun typing a command has the effect of ignoring what you have typed so far, and you are prompted for a new command.

If you press ATTN/BREAK while SPIRES is typing out information, the typing will be interrupted and you will get a new command prompt, "->".

In most cases, if you issue a SPIRES command, press carriage return, and then press ATTN/BREAK before SPIRES responds to the command, ATTN/BREAK is ignored. It neither revokes nor interrupts processing of the command. A few commands, such as the FIND command, can be interrupted; SPIRES will ask you if it should continue executing the command. [See B.3.6.2.]

A.2.7  Abbreviations

Most SPIRES command verbs of four or more characters in length can be abbreviated to the first three characters. FIND and FIN are identical in effect, for example. In addition, longer fragments of a command element (e.g., SELE or SELEC for SELECT) are accepted. Options may usually be abbreviated as well: the PAUSE option on the TYPE command may be abbreviated to PAU or PAUS, for instance.

Command verbs of three or fewer characters may not be abbreviated.

If ambiguities exist between a SPIRES abbreviation and one from another system (e.g., CONTinue XEQ in SPIRES and CONdense in WYLBUR), you must use as many characters as it takes to resolve the ambiguity, such as CONT XEQ.

A.2.8  Error Messages and Codes

When SPIRES cannot properly process your command, an error message will be displayed. Most error messages associated with searching and updating commands also include an error code. [See D.2.8.]

You can get more specific information about the meaning of the code by typing

where "code" is the number of the error code.

For example,

Common error messages from SPIRES include:

term: unrecognized command

SPIRES does not recognize the "term" you have typed. The command has been passed to WYLBUR or Unix, but is still unrecognized or encountered an error.

Not a legal or complete command

This message will occur if your command is made up of recognized terms but cannot be processed for some other reason. For example, IN ACTIVE CONTINUE SHOW TIME is invalid because it is a mixture of SPIRES options with a WYLBUR command, SHOW TIME.

Unrecognized: term

The command verb you have typed is valid, but some part of the phrase is meaningless in this context.

For example,

In this example, SPIRES recognizes the SHOW SPIRES NEWS command [See A.3.1.5.] but the word "today" is not valid on that command. Often, as in this case, the command will work successfully with the unrecognized term omitted.

'term' not found; try 'EXPLAIN EVERYTHING'

This response after an EXPLAIN command means no online explanation is available for the term you have given. [See A.3.1.2.]

System file queued, or System busy

SPIRES files necessary to process your command are being used for a function that requires exclusive access. Your command will be processed, as soon as those files are released for general use.

Privileged command

The command you have issued is not allowed for the account under which you are currently logged on.

Core exhausted

SPIRES does not have enough memory to perform the requested operation. When this happens, the EXIT command [See A.2.3.] is automatically invoked by SPIRES. You should re-enter SPIRES and reissue the command. If this does not correct the problem, please call the SPIRES consultant.

SPIRES unavailable

This message will be typed in response to the SPIRES command if internal system work is being done that precludes user access to SPIRES. An automatic EXIT will be issued immediately and you will be returned to WYLBUR. When this message appears, the systems staff is at work on the problem, and there is no need for you to notify Consulting. This condition is infrequent and is usually of short duration.

SPIRES abort -- Please notify consultant

The last command you issued caused an error to be detected in SPIRES. The error is serious enough that SPIRES cannot continue processing. About twenty lines of information will be printed on your terminal; this information should be saved (please write it down if you are on a CRT), since it may help your consultant locate and correct the problem. Please save a list of commands you have typed, if possible. Contact the SPIRES consultant with this information promptly.

No such subfile

This response after a SELECT command [See B.2.3.] often means the subfile name was misspelled. Try SHOW SUBFILES [See B.2.1.] to verify the name of the file you want.

No subfile selected

This message after a command means you have neglected to specify which subfile you want to use before you issued commands against it. [See B.2.3.]

No indexes defined

The selected subfile does not have indexes, and you have issued index searching commands.

Zero result

Your command is valid, but the subfile simply does not contain any records that satisfy the given criteria.

Request has no content

Your command used only words that were part of an exclusion list in the file definition and thus are not stored in the file's indexes. [See B.3.5.5.]

A.2.9  The Active File and SPIRES

For most communication with SPIRES, you issue commands at the terminal and SPIRES responds by displaying responses on the terminal screen. At other times, however, you might want SPIRES to put the response into a data set (a listing of records in a SPIRES subfile, for example), that you will print. Or you might want to add records that you have saved in a data set into a SPIRES subfile, without having to re-type them at the terminal.

SPIRES generally uses the WYLBUR active file in such cases. You can ask SPIRES to place that listing of records in your active file so that you can then issue the PRINT command to get an offline listing. (Or you can use other WYLBUR commands on the listing as desired -- VIEW, MODIFY, SAVE, COPY, etc.) For input purposes, you can tell SPIRES to read records from your active file to be entered into the subfile.

For output purposes, you usually precede a command with the IN ACTIVE prefix to tell SPIRES to place the results in your active file instead of displaying them at the terminal. [See A.2.9.1.]

Anytime that you issue a command to place data in your active file when there is already something there, SPIRES will prompt "-Ok to clear?" If SPIRES may clear your active file, type YES or OK; if SPIRES may not, then type NO or press the ATTN/BREAK key.

SPIRES gives a name and title to a newly created WYLBUR active file when you have issued a command that places data in the active file. This name will be the name of the SPIRES processor you are in (SPIRES, SPIBILD, etc.). The title of the active file is generally the name of the currently selected subfile, followed by the command that created the active file.

For example, if you are using the RESTAURANTS subfile, and issue the command IN ACTIVE DISPLAY ALL, the title of the new active file will be : "RESTAURANTS: DISPLAY ALL".

A.2.9.1  The IN ACTIVE (IN ACT) Prefix

The IN ACTIVE prefix may precede many SPIRES commands. This prefix causes the normal output from the command to be placed in the active file. It is valid with almost all SHOW commands that are processed by SPIRES.

The command prefix syntax is as follows:

The CLEAR option may be used to cause the system to clear the active file before sending data to it. The CONTINUE option may be used to cause the output from the command to be appended to the end of the current active file contents. APPEND performs the same function as CONTINUE. KEEP opens up a new active file without clearing the contents of the old one. (The PICK command lets you restore the previous active file.) If there is information in the active file, and neither CLEAR, KEEP, nor CONTINUE (or APPEND) is specified, the system will prompt "-OK to clear?", to which you may respond only YES, OK or NO. If you have SET CLEAR, the information already in the active file will be cleared automatically. [See A.2.9.3.] If you press ATTN/BREAK, you will receive the message "-No action taken."

Note that even after you give permission to clear the active file, SPIRES will not actually clear it until some data is placed in it. Hence, if you issue a command such as "IN ACTIVE CLEAR, TYPE" and there are no records in the current result or stack to be displayed, the current contents of the active file will be retained.

The SET DELTA command must be issued in SPIRES if you want lines to be sent to the active file with a line number increment other than the default of 1.

If the IN ACTIVE option prefixes a SPIRES command for which its use is invalid, it is ignored; that is, no message will interrupt or warn you, and the active file will not be altered.

If you are placing records from a SPIRES subfile into the active file by using the IN ACTIVE prefix and either the TYPE command [See B.4.2.1.] or the DISPLAY command in Global FOR, [See B.5.3.4.] you may add the CLEAN option to the IN ACTIVE prefix to suppress the separating lines that normally appear when multiple records are displayed.

The IN ACTIVE prefix is one of several SPIRES command prefixes. The prefix may be separated from the command itself by either a blank or a comma, e.g.,

A single command may have multiple prefixes; the particular order of the prefixes does not matter in any case.

A.2.9.2  The SET LIST and SET NOLIST Commands

The SET LIST command causes SPIRES to issue a LIST command to WYLBUR automatically whenever data is placed in the WYLBUR active file. SET NOLIST suppresses this automatic listing. The default upon entry to SPIRES is LIST.

The listing can be interrupted at any time by pressing ATTN/BREAK. Data transfer is completed before listing begins, so ATTN/BREAK has no effect on the amount of information placed in the active file.

The SET LIST and SET NOLIST commands is also availalble in SPIBILD.

A.2.9.3  The SET CLEAR (SET CLR) and SET NOCLEAR (SET NOCLR) Commands

The SET NOCLEAR command causes the system to prompt "-OK to clear?" whenever a command is issued that would replace the contents of the active file. When the SET CLEAR command is issued, many commands will automatically clear the active file without asking you for permission -- the permission is assumed from the SET CLEAR command. Warning: this command can be dangerous; it is not generally recommended.

The default upon entry to SPIRES is NOCLEAR.

A.2.9.4  The SET LENGTH (SET LEN) Command

SPIRES has a system variable called $LENGTH that can be used to set the maximum length of output lines from various SPIRES utilities. You will probably never need to change the line length setting, but there may be times when you do. System formats frequently use the value of SET LENGTH to determine how long the lines of output they produce can be. The standard format, the $REPORT format and the $PROMPT format all use the set length, for example. [See B.4.6, C.2.1, D.3.1.]

If a value is too long to be placed within the set length without breaking it somewhere other than at blanks, an error will result (error code S259). If you get this error, you may want to raise the value of the SET LENGTH so that the value can break across lines appropriately, without adding blanks that are not part of the value.

SPIRES automatically assumes a WYLBUR line length of 72. This length may be altered by issuing the WYLBUR command SET LENGTH during the SPIRES session.

The form of this command is

where "number" is a line length less than or equal to 235.

Remember that if you have issued the SET WYLBUR command or used the "(W)" parameter on the SPIRES command, you must preface the SET LENGTH command with a "/" so that SPIRES will "see" the command first. Otherwise, SPIRES will still assume a line length of 72.

A.2.9.5  The SHOW SETTINGS (SHO SET) Command

Some of the options currently set may be displayed by typing the command:

The SHOW SETTINGS command will give you a list of various WYLBUR and SPIRES options that you have set or that were set by entry commands or by default.

For example,

This user has retained the default LIST and NOCLEAR settings. UPPER refers to the WYLBUR case commands SET UPPER|UPLOW. The SET UPPER and SET UPLOW commands also control whether SPIRES translates your responses to uppercase (UPPER) or leaves them as entered (UPLOW).

If SET BIG SEARCH had been issued, then the words BIG SEARCH would appear at the end of the list of settings. [See B.3.6.6.]

The other settings are SPIRES settings discussed in the "SPIRES Protocols" manual. Also discussed there are the STORE SETTINGS and RESTORE SETTINGS commands, which can be used to save and restore the current settings if you want to change them temporarily.

The IN ACTIVE option can be used to direct the output of the SHOW SETTINGS command into the active file. [See A.2.9.1.]

A.2.10  The SHOW SPIRES MAIL and SEND SPIRES MAIL Commands

Occasionally when you enter SPIRES you may receive the message "Mail waiting" or simply "(Mail)". This means someone has used the SPIRES mail facility to send you a message.

Issue the command

and the message will be typed on your terminal. If the message is long, or if you are using a CRT (video) terminal and want a permanent record of the message, type

The message will first be placed in your active file and then listed. You can interrupt the listing at any time to save the data set or make an offline listing. [See A.2.9.1.]

If no SPIRES mail is waiting, then issuing the SHOW SPIRES MAIL command will cause SPIRES to respond "-No SPIRES mail". If you add the QUIET option to the SHOW SPIRES MAIL command, that message will be suppressed if there is no mail for you.

Whenever you SHOW SPIRES MAIL, the system asks permission with a "-Clear mailbox?" prompt to discard mail you have just seen. If you wish to keep your mail in the SPIRES mailbox so you can look at it again later, reply "no" to the question. To avoid the prompt altogether, you can tell SPIRES to clear your mailbox when you issue the SHOW SPIRES MAIL command by typing:

Or, you can avoid the prompt and tell the system not to clear your mailbox by typing:

When you use the colon (:) parameter on the SPIRES command, no check for SPIRES mail is made. [See E.2.]

To send mail to another SPIRES user, collect the message in your active file, return to command mode and then type

where "account" is the account number (in the form uuu$gg or gg.uuu) of the user to whom you are sending mail. Be sure that the account number is valid; SPIRES will not verify that the account actually exists. The USING range option may be used when only the specified range of the active file is to be sent as the message. [See D.2.4.1.] You may then collect the message at the end of the active file and send it without disturbing the rest. The addressee need not be logged on at the time the message is sent.

When you issue the SEND SPIRES MAIL command, SPIRES will respond by telling you how many lines from your active file were sent.

For example,

A single SEND SPIRES MAIL command will transmit about 1,900 characters, which is approximately the amount of information that will fit on a CRT screen. Thus, if a message is long, it may not all be sent. The SPIRES response indicating the number of lines sent can be used to determine whether the message was completely delivered. If it was not, the USING option can then be employed to send the remainder of the message.

A.3  Learning about SPIRES

SPIRES has several facilities to help you learn to use the system effectively. Online, several commands provide assistance; offline, consulting and printed documentation are available.

For consulting assistance at Stanford, contact the consultants in Forsythe Hall, or issue the SPIRES command EXPLAIN CONSULTING for information on current consulting services.

A.3.1  Online Aids

SPIRES can help you learn about SPIRES. The HELP, EXPLAIN, SHOW SYNTAX and SHOW EXAMPLE commands provide up-to-date information ranging from introductory material to detailed explanations. In addition, you may experiment as much as you like; searching is a safe process that does not affect the information stored in SPIRES files. (Updating, obviously, is a different matter!)

In addition to the commands described below, others are available to help you learn about particular files. [See B.2.]

A.3.1.1  The HELP Command

The HELP command is useful when you are lost. HELP causes SPIRES to explain where you are -- whether you have selected a subfile, whether you have a search result, etc. It changes its response to you depending on what you have done in your current session with SPIRES. HELP also points you to appropriate EXPLAIN commands for information on what to do next.

For example,

    You do not have a SPIRES subfile SELECTed.  To obtain a list of
    all the subfiles you are allowed to SELECT, issue the command:

       SHOW SUBFILES

    This will give you a list of the subfile-names you can access.
    If you want to use any of the subfiles listed but need more
    information about them, type

       SHOW SUBFILE DESCRIPTION subfile-name

    When you are ready to use a subfile, type

       SELECT subfile-name

    Then type the HELP command again if necessary.  You might also
    try some of the following commands:

       EXPLAIN EVERYTHING
       EXPLAIN SELECT
       EXPLAIN SHOW SUBFILES

    To leave SPIRES, type the EXIT command.

    ->

A.3.1.2  The EXPLAIN (EXP) Command

The EXPLAIN command provides summaries of the syntax and use of SPIRES commands. There are also explanations of topics such as abbreviations and error messages. About three thousand explanations are available.

The general form of the command is:

You may specify the first one or more characters of the term you want explained. If more than one explanation is available for the term you specify, you are shown a list of alternatives and then are given the opportunity to specify one term from the list.

If you put a period (.) after the term you wish explained, you will not be shown a list of terms; SPIRES will give you an explanation only if the exact term you specified is found.

If you receive a menu of explanations like the one shown for FIND above, and none of the listed explanations is what you were looking for, you can answer the "-Which number?' prompt with a 0 (zero) to indicate that you don't want to see any of the explanations. This is equivalent to pressing the ATTN/BREAK key.

Any explanation retrieved by the EXPLAIN command can also be placed in the active file by adding the IN ACTIVE prefix to the EXPLAIN command. [See A.2.9.1.]

Most of the explanations come directly from the various SPIRES reference manuals. For example, if you issue the command EXPLAIN EXPLAIN COMMAND, this section of the "Searching and Updating" manual will appear. The name of the manual and the section number are displayed at the beginning of the explanation, so you can use the EXPLAIN file as a master online index to the SPIRES documentation.

At the end of the display, many explanations will have several lists of cross-references, identified by the headings "Reference to", "Referenced by" and "See also". For more information, you can explain any of those terms. [Since the online explanations are simply sections in the various SPIRES manuals, the "Reference to" and "Referenced by" refer to sections cross-referenced in the text. "See also" references refer to sections beneath the current section. For example, an explanation that displays the text of section B.3 in this manual might have "See also" references for sections B.3.1, B.3.2, etc.]

The EXPLAIN command is also available in SPIBILD. However, it is not available in batch SPIRES or batch SPIBILD.

A.3.1.3  The SHOW EXAMPLE (SHO EXA) Command

The SHOW EXAMPLE command provides a subset of the information available from the EXPLAIN command. [See A.3.1.2.] Instead of giving a detailed explanation of a command or concept, it only gives a short example that shows the forms and options of a command. Otherwise, it is similar to the EXPLAIN command. [See A.3.1.3.]

The format of the command is:

where "term" identifies the concept or command for which you want an example. Alternative terms with the same stem will be shown to you, and you are given the opportunity to specify one of them.

For example, you could get an example of a particular FIND command as follows:

For further information, you can EXPLAIN the term, or EXPLAIN or SHOW EXAMPLE for the referenced terms at the end of the explanation.

A.3.1.4  The SHOW SYNTAX (SHO SYN) Command

The SHOW SYNTAX command provides a subset of the information available from the EXPLAIN command. Instead of giving a detailed explanation of a command or concept, it gives only a short syntactic definition containing the forms and options of a command. Otherwise, it is used similarly to the EXPLAIN command. [See A.3.1.2.]

The format of the command is:

where "term" identifies the concept or command for which you want a syntactic definition. Alternative terms with the same stem will be shown to you, and you are given the opportunity to specify one of them.

For example, you could get a syntactic definition of the FIND command with the following command:

A.3.1.5  SPIRES News

News of the most recent SPIRES changes is maintained in an online file that is updated whenever a change occurs. When you enter SPIRES, a message is displayed if SPIRES NEWS has been added recently. [The message is suppressed if you call SPIRES with the "Q" (for "quiet") option. [See A.2.2.]]

For example,

The command

will begin a listing of the SPIRES NEWS file at your terminal, with the most recent items first. Like many other SPIRES commands, it can place SPIRES NEWS directly into your active file, using the IN ACTIVE prefix. [See A.2.9.1.]

The information displayed by the SHOW SPIRES NEWS command gives only the most recent changes to SPIRES. If older news is needed, then issue the WYLBUR command:

This will place the SPIRES NEWS archive (all SPIRES NEWS since July 1976, in reverse chronological order) into your active file. Printed listings of SPIRES.NEWS are available in Document Sales.

An index to SPIRES NEWS items is available online; for a printed copy, issue the command PERFORM PUBLISH.

A.3.2  Printed Documents

This manual, "Searching and Updating," is one of the best places to begin learning about SPIRES. If you want to learn more about the SPIRES system, you should consider studying the following manuals:

Reference Guides (one or two page documents) to special topics such as searching or the $REPORT format are also available.

At Stanford, to be sure you have the most current edition of a document, issue the PUBLISH command to place an order for the documents you need:

You will be asked what manuals you want, and then jobs will be constructed to print copies of the manuals for you on the 9700 printer.

A list of SPIRES documents is included in this manual [See the Appendix.] and is also available online. Type:

B  How to Select and Search a Subfile

This part of the manual describes the search procedure in SPIRES. The simplicity of the search procedure makes it one of the best features of the SPIRES system. Using straightforward commands such as SELECT, FIND and TYPE, you can choose a subfile to search, learn about its contents, find the goal records that meet criteria you specify, and then display them at your terminal. The variations on this basic searching formula are discussed in Part B.

The first chapter of Part B is a broad overview of the search procedure. Included is a brief description of the structure of files and subfiles. The second chapter tells you how to find the appropriate subfile and "select" it -- that is, how to access the subfile for your searching.

Basic search methods using the FIND command are discussed at length in the third chapter. Within this large chapter are sections about different types of indexes found in various subfiles, including techniques for searching them, ways to save searches to use again later, and suggestions for making searches more efficient and inexpensive.

Once you have found records that meet the criteria you have set, you will want to look at the records. You can look at entire records or just at selected elements. Methods for the display of records are the subject of the fourth chapter.

Most searches use indexes, since searching is most efficiently done using them. However, you may occasionally need to search unindexed data elements; the fifth chapter discusses several techniques that can be used for searching unindexed information, including some of the powerful Global FOR commands.

B.1  The Search Procedure

Subfiles may be searched indirectly, using the information contained in index records, or directly, using the information contained in the goal record. This manual deals primarily with index searching; the capability of retrieving records via direct examination is discussed briefly in this manual and discussed fully in the manual "Sequential Record Processing in SPIRES: Global FOR." [See B.5, D.5, D.7.]

This section contains a brief discussion of the structure of SPIRES files and subfiles, as well as an overview of the search procedure using SPIRES subfiles. The other chapters in Part B will then describe search techniques in specific detail.

B.1.1  The Goal Record and Data Elements

"Goal record" is the SPIRES term for a data record that could be found as a result of a SPIRES search operation. In a collection of data about automobile registration, for example, the goal records would probably be automobile owners; in a bibliographic subfile, the goal record would most likely be a book.

The basic unit of information in a SPIRES goal record is the data element; a car owner's name, address and license plate numbers would be some of the elements of the automobile registration file. Elements may be simple or structural. The simple data element is a fixed or varying length character string; it may be required or optional and may be singly or multiply occurring. Each goal record of a subfile has one data element which is the goal record key. Each goal record's key value is unique; the key value identifies the goal record to SPIRES as an individual entity. [See D.1.3.1.]

Structure data elements are made up of other data elements; these may, in turn, be either simple data elements, or other structure data elements. Structures group related data elements together. [See D.2.3.]

For example, in a subfile of students at a university, the goal record would be a student. Elements in the goal record might include the name, address, student number, phone number, school at the university, year admitted and so forth. Since SPIRES needs one element in each goal record to always be a unique value, the data base owner must choose an element to be the goal record key. The best choice for the key in the student subfile might be the student number; none of the other elements in the goal record is guaranteed to be unique. (In subfiles where there is no unique element to be used as the key, SPIRES assigns a unique number to each record entered. This system-manufactured element serves as the goal record key.) The student's courses would probably be a structure data element, made up of a course number, a course name and a grade; there would be a separate occurrence of the structure for each course.

B.1.2  The Subfile

Each SPIRES file has a definition that determines the goal record characteristics of the various subfiles of the file.

The file definition specifies:

A SPIRES file may contain more than one subfile. A single subfile may present different data elements from the same goal record to different groups of users. Goal records from different subfiles vary greatly in structure as well as content. The various subfiles within the file may contain different goal record sets.

SPIRES subfiles are being used to store information on a great variety of subjects -- clinical medicine, administration, library technical processing -- so the user can expect search procedures to vary somewhat from subfile to subfile. However, the basic search commands themselves do not vary.

B.1.3  Selecting a Subfile

No searching is possible until you tell the SPIRES system which subfile you want to use. Many public subfiles are available for you to search, some of which also permit updating by the general public. There may also be group and private subfiles that you have privileges to use for searching and perhaps updating. Once you have determined which subfile you want, you can issue the SELECT command to get access to its data. [See B.2.]

B.1.4  Searching a Subfile

Once a subfile has been selected, you search it by issuing a FIND command followed by criteria to be used for locating and retrieving goal records. [See B.3.] SPIRES replies with a message telling you the number of records which meet the criteria. This group of records is called the search result.

After obtaining a search result, you may choose to:

For example, suppose you are searching a bibliographic subfile. If you ask SPIRES to find books by Theodore H. White, you might receive the search result "8 BOOKS". You might then ask for the books among these eight having the title word "President" and receive the search result "3 BOOKS". Finally, you might ask for the books among these three published after 1963 and receive the search result "2 BOOKS".

B.1.5  Displaying the Search Result

Once a search result that meets the necessary criteria has been retrieved, you may examine the contents of the records. [See B.4.] Several options are available; you can:

B.2  Choosing a Subfile

The following sections describe a number of commands that provide information about the subfiles available to you and the data they contain. Having decided on a subfile of interest, you may issue the SELECT command and begin searching.

SPIRES allows file owners to create many different kinds of subfiles, more than can possibly be discussed here completely. Therefore, the explanations provided online for many public subfiles should be consulted via the SHOW SUBFILE DESCRIPTION command. [See B.2.2.]

B.2.1  The SHOW SUBFILES (SHO SUB) Command

Once you have entered SPIRES, you may issue the SHOW SUBFILES command to obtain a list of the available subfiles.

The SHOW SUBFILES command has the following syntax:

You may ask to see a list of one, three, or all of the four types of subfiles: PUBLIC, PRIVATE, GROUP or COMMUNITY. For security reasons, only subfiles available for your use are shown. Public subfiles are available to all the users of SPIRES, while private subfiles are available only to designated users, chosen by the subfile's owner. Group subfiles are available to all users that have the same group code in their account. Community subfiles are available to all users whose group codes (in their account numbers) begins with the same letter. Used with the SHOW SUBFILES command, these options produce various lists of subfiles: PUBLIC, PRIVATE, GROUP, or some subset of the four such as NON PUBLIC. ALL is the default value.

NON can be entered before one of the four types of subfiles only. A list of all the subfiles in the other three categories will be displayed. The "LIKE stem" option causes SPIRES to display the appropriate set of subfile names that begin with the root specified. The IN ACTIVE prefix can be used to place the list in the active file. [See A.2.9.1.]

The following are some examples of SHOW SUBFILES commands:

In the last example, SPIRES will list all subfiles whose names begin with the letter R.

The SHOW SUBFILES command will list all subfiles available to you, even those to which you have access because your account is included in an "access list" named by the file owner. Those subfiles are listed separately in each category, preceded by the name of the access list. For example,

[See B.9.2a in the manual "SPIRES File Definition" for information about access lists.]

B.2.2  The SHOW SUBFILE DESCRIPTION (SHO SUB DES) Command

The SHOW SUBFILE DESCRIPTION command provides a short description of a subfile, i.e., what information is contained in the goal records, how the records are structured, and notes on any special restrictions on searching the subfile. The file definer is responsible for providing the subfile description, and thus these descriptions do not follow a general form; the information can range from very sparse to very complete.

The form of the command is:

If you do not specify which subfile you want described, you will receive the description of the subfile you have selected. [See B.2.3 for information about selecting a subfile.] If you have no subfile selected and do not specify a subfile name in the SHOW SUBFILE DESCRIPTION command, you will be asked to provide the name of a subfile. The subfile description can be placed in your active file using the IN ACTIVE option. [See A.2.9.1.]

You can see descriptions of only those subfiles you can select.

Here is an example, requesting the explanation for a (fictitious) subfile:

B.2.3  The SELECT (SEL) Command

Once you have decided on a subfile to be searched, issue the SELECT command. You cannot search or retrieve the records in a subfile until the SELECT command has been issued.

The command is typed as:

The following commands are also useful:

displays the name of the subfile currently selected. The IN ACTIVE option can be used to direct the output of the SHOW SELECT command into the active file. [See B.2.9.1.]

cancels the previous SELECT command, leaving you with no subfile selected.

Some subfiles allow you to pass parameters to them with the SELECT commands. These subfiles have SELECT-COMMANDs that accept parameters. If the subfile you are selecting is designed so that you can pass parameters to it, the syntax of the command is:

You can also omit the comma by putting the subfile name in quotation marks or apostrophes.

B.2.4  The SHOW SUBFILE SIZE (SHO SUB SIZ) Command

Once a subfile has been selected, the SHOW SUBFILE SIZE command displays the number of goal records comprising the subfile.

The form of the SHOW SUBFILE SIZE command is:

The IN ACTIVE prefix can precede the command to put the result in the active file. [See A.2.9.1.]

For some complex files, the SHOW SUBFILE SIZE command may produce the message "-The subfile has an unknown size". SHOW SUBFILE SIZE does not reflect records added or removed since the file was last processed. [See D.6.1.]

B.2.5  Command Logging During Subfile Use

Owners of SPIRES data bases are often interested in how their subfiles are being used. In order to monitor the activity on a subfile, the owner can tell SPIRES to log all commands issued by users who have selected that subfile. If you select one of these monitored subfiles, SPIRES will tell you that all your commands are being logged.

For example,

Unlike the SPIRES system logging [See A.2.4.] which you can choose to have on or off, subfile command logging cannot be turned off except by the data base owner. During the time the subfile is selected, all commands that you issue are logged, whether or not they actually involve using the file. When you select another subfile or exit SPIRES, the command logging ends.

B.2.6  (*) Selecting a Chargeable Subfile

Some owners of SPIRES data bases instruct the system to maintain records of who uses their subfiles, the length of time used and the number of records displayed. These data base owners may decide to charge a fee for subfile use based on the statistics SPIRES will collect for them. Such a subfile is a "chargeable" subfile.

When you attempt to select a chargeable subfile, SPIRES will inform you of the rates that the file owner has set for its use. SPIRES will then ask you whether you agree to accept charges for using the subfile. If you refuse, no record of your SELECT command is kept; if you accept, record of your use of the subfile is maintained. When you issue the CLEAR SELECT command, select another subfile, or issue the EXIT command, you will receive an approximate calculation of your charges for use of the subfile.

If a data base for which you incur charges is maintained by the computer center, then charges for its use will appear on your regular billing from the computer center. If you use data bases maintained by other account holders at the center, you may have to make separate arrangements with them for billing purposes.

The data base charging messages appear as follows:

The file owner can charge for any or all of the following:

B.3  Specifying a Search Request

After selecting a subfile, you probably want to find information within the records contained there. Depending on the file definition, the subfile may have indexes to use for searching a particular type of information. If it does not, other methods of searching will be needed. [See B.5.]

You must first determine whether there is an appropriate index to use. If there is, a search request can be made. You specify a FIND command verb followed by a single index name and value, or multiple search expressions linked by logical operators. The procedure may become intricate as additional criteria are specified. A search request is constructed as a logical expression; therefore, the order of the criteria affects which records are retrieved.

If desired, you can review the requested search and store it in a Unix file for re-use at another time.

B.3.1  How Searching Works

In SPIRES, search terms correspond to indexes (collections of index records constructed according to the file definition). In order to efficiently search for goal records, you must learn how a subfile is indexed. The SHOW INDEXES command displays a list of search terms and their valid aliases, as well as the kind of indexes to which they correspond.

B.3.1.1  The SHOW INDEXES (SHO IND) Command

The SHOW INDEXES command provides you with a list of indexes and the valid search terms for a selected subfile. A search term is the name of an index that has been defined for the subfile. "Index name" and "search term" are generally synonymous.

The form of the SHOW INDEXES command is:

The RECNAMES option tells SPIRES to include the name of the index record-type from the subfile's file definition at the end of the list of searchtypes for each non-compound index.

The following terms are listed:

For example:

The example shows that the subfile "Documents" has simple indexes built from keyword, title (with a local qualifier) and topic information and a compound index with index records on the pub-date, location, distribution and course information contained in each goal record. Also, those words and their listed abbreviations are available as search terms for use in a search request on this subfile.

If the file owner has set up the subfile so that the goal record can also be used as an index, the display will show this by labeling the goal record name as "Goal -- Index:" rather than "Goal Records:" as shown in the above example. This means you can then use the goal record name in a search request just as you would use an index name. [See B.3.1.2 for information on the goal-index in searching.]

If the file owner had set the TITLE index to be immediately indexed, it would be displayed as "Simple Index: T, TITLE (Immediate)".

A subfile's search terms can be placed in the active file by preceding the SHOW INDEXES command with the IN ACTIVE option. [See A.2.9.1.]

Index Information

In some cases, the file owner will add some additional information about the indexes to help the user in choosing the proper index to search. This includes things like the type of index, what types of values can be used in a search request, and a description of the index and how it might be used. There are two commands that display this information: SHOW INDEX INFORMATION and SHOW INDEX DESCRIPTION.

The complete syntax of these commands is:

If you don't specify an index name, information for all of the indexes in the subfile will be displayed.

For example,

If the file owner has not entered any information about the index, you will receive the message "-No information defined" (or "-No description defined").

Defining Your Own Index Names

Sometimes the names file owners give to indexes are not as easy to use as you might like. SPIRES lets you use a command called DEFINE INDEX to define aliases for simple indexes in the currently selected subfile, as shown in this example:

The alias lasts only as long as you have the subfile selected.

The DEFINE INDEX command has other uses as well: it can be used to link to indexes in another subfile when those indexes are relevant to the goal records in the currently selected subfile. [EXPLAIN DEFINE INDEX COMMAND for more information.]

B.3.1.2  How Indexes Are Created

SPIRES builds an index using values of one or more goal record data elements; within each index record SPIRES stores a unique data element value and a reference pointer to each goal record that contains the value.

Indexes provide pathways which allow you to form goal record subsets based upon element values stored in index records. A search result is a collection of goal record references gathered from these index records. When you want to display the records, SPIRES uses the references in the search result to retrieve records from the goal record subset.

When records are added or changed in a subfile, SPIRES places them into the "deferred queue" where they stay until the data base owner has the file "processed". When a file is processed, the deferred queue records are moved into the goal record data set or "tree", the area where the goal records already in the subfile are kept. Then the subfile indexes are updated, incorporating the new information.

Many files are processed overnight each night that there are records in the deferred queue -- this means indexes are "fresh" each morning. But unless an index is defined by the file owner to be an "immediate" index (see below), it will not reflect recent changes made in the subfile (the changes residing in the deferred queue) until the file has been processed. Thus, for files with overnight processing, a non-immediate index does not reflect changes made to the subfile during the day.

Immediate Indexing

However, any index can be defined by the file owner to be updated immediately whenever changes are made to a record that would change the index. This is known as "immediate indexing". An immediate index can be used to retrieve values that have just been added to the subfile (and which would ordinarily not be passed to the index until the file was processed). Whether or not an index is updated immediately does not affect the way an index is searched, but it might affect the result, so you should use the SHOW INDEXES command to see any of the indexes in the subfile are immediately updated. [See D.6.1, D.6.2, D.6.3.]

If a file owner has defined a "goal-index", which is an index built upon the file's goal record, [See B.3.1.1.] the goal-index acts much like an immediate index. For instance, this goal-index can be used to retrieve a newly-added record with the FIND command, even though the file has not yet been processed.

B.3.1.3  Types of Indexes

Structurally speaking, SPIRES maintains two different kinds of indexes: simple and compound. Simple and compound indexes differ in their structure; depending on the type of searching involved, one type may be more efficient (and hence less expensive) than the other. While the distinctions between simple indexes and compound indexes are important to the data base owner creating a file definition, they are not so important to the user searching the files; the searcher probably has no real choice with regard to the type of index he needs to use. There are, however, two distinctions between the types that are meaningful to the searcher. First, in a search command, there are two relational operators ("FROM...TO..." and "BETWEEN...AND...") [See B.3.2.3.] that cannot be used on simple indexes. Second, the BROWSE command cannot be used on a compound index. [See B.3.6.3.]

B.3.2  Simple Search Requests

A simple search request begins a search for all records that satisfy the specified criterion.

B.3.2.1  The Simplest FIND (FIN) Command

The FIND command initiates a simple search. You specify a single search expression following the FIND command verb, which causes the system to gather a list of those records that satisfy the criterion, based on their indexed values. [See B.3.2.2.] When you issue the FIND command, any previous search result is dropped.

The syntax of the simple FIND command is:

Here is an example of a simple FIND command:

SPIRES reports the number of goal records satisfying the search request in a "-Result:" message. The search may then be continued iteratively [See B.3.3.] or the records in the search result may be displayed by issuing the TYPE command. [See B.4.2.1.] The BROWSE command may be useful in finding sample search values (such as DEUTSCH in the example above) to use in a search expression. [See B.3.6.3.]

B.3.2.2  The Search Expression

The "search expression" states the criterion to be used in selecting records, and is written as:

where:

The phrase "search term" is often used instead of "index name". [See B.3.1.1.]

Here are some examples of search expressions, used with the FIND command:

          index-    relational-    search-
           name      operator       value
    FIND  author         =         White
    FIND  author      (blank)      White
    FIND  diagnosis     with       coronary disease
    FIND  age            >         64
    FIND  date         after       1968

A space or " " between the index name and search value is equivalent to "=". [See B.3.2.3.]

Whether the index name is typed in upper case, lower case or a mixture makes absolutely no difference to SPIRES. Almost invariably, the case of the search value makes no difference either -- SPIRES will convert it to uppercase for comparison to the uppercase indexed values. Though quite rare, there are indexes where the case of the search value makes a difference, but the file owner should tell you so, either in the subfile or index description. [See B.2.2, B.3.1.1.]

B.3.2.3  Relational Operators in Search Expressions

There are four different types of relational operators: equality, inequality, range and content.

The equality operator is used to specify a precise numeric or alphanumeric value in a search request. It retrieves records with a specific indexed value. This operator is indicated by either a "=" or a blank (" ").

Although the inequality operators are mostly mathematic symbols, they are useful for searching in indexes with numeric or text values:

     (1) -> find city ~= fresno     (not equal to)
     (2) -> find date > 1973
     (3) -> find date after 1973
     (4) -> find age >= 37
     (5) -> find date < 1926
     (6) -> find date before 1926
     (7) -> find age <= 78

Note that examples 2 and 3 are equivalent, as are 5 and 6.

Range operators cause a search to retrieve records that have an indexed value within a specific range.

Content operators such as STRING are also provided for use in situations that require you to find records through pattern matching or substring matching on indexed values or within words of indexed values.

The inequality and content operators are most efficient when used to search compound indexes. [See B.3.1.3.] They are least efficient (and most expensive) when used to search simple indexes in large files. To prevent you from using a large amount of CPU-time in a search, SPIRES will issue a warning after certain intervals of CPU-time have elapsed during a search. [See B.3.6.2 for an explanation of the SPIRES timer facility.]

Here is a list of all the relational operators:

The following sections describe each of the relational operators in detail.

B.3.2.3.1  (The Equality Operator (" " or "="))

The equality operator indicates that a search should find records where an indexed value is equivalent to the search value. In SPIRES "=" is the equality operator; SPIRES also recognizes a blank between a search term and a value as an equality operator.

The equality operator is the most efficient of the relational operators for searching simple indexes.

B.3.2.3.1a  (The LIKE Operator)

The LIKE operator is used to search for specific characters in sequence in an indexed value, with the option of using single and multiple "wild-card" characters in the search request.

The "wild-card" characters reserved for the LIKE operator are:

Without the "wild-card" characters, the LIKE operator is functionally equivalent to the EQUALITY operator. With these reserved characters, however, the LIKE operator becomes a very flexible string-matching facility.

For example, FIND TITLE LIKE A_E would retrieve indexed titles that contain the word AGE, ACE, or APE. FIND TITLE LIKE A?E would retrieve the former result as well as titles with words such as AVERAGE, ACHE, AMUSE, and ANNOUNCE.

The "wild card" characters can be combined in a single search request.

would retrieve indexed values BRIGADOON and the BLUE LAGOON.

If the index is not a "word index," blanks can be included in the search value.

Thus,

might retrieve the titles LOST IN LOVE AGAIN or LAST IN LINE.

The \ (backslash) is a reserved character for the LIKE operator that functions as an escape character. The strings \? and \_ are interpreted as the literal ? and _ characters respectively. \\ is interpreted as the literal \ character.

FIND TITLE LIKE ?FAR\? would retrieve the record "HOW FAR?" but not the title "OLD MCDONALD'S FARM".

B.3.2.3.2  (The Inequality Operators)

Most of the inequality relational operators are represented by standard mathematic symbols. Two others, BEFORE and AFTER, are equivalent to two of those symbols.

The inequality operators are:

         ~=    not equal to
          >    greater than
         >=    greater than or equal to
          <    less than
         <=    less than or equal to
     BEFORE    less than
      AFTER    greater than

The "not equal" sign consists of a tilde or a "not sign", depending on the terminal or printer character set, followed by the equals sign.

Here are examples of FIND commands that use inequality operators:

The above command will find records with indexed "age" values that are greater than 65. The following command would provide equivalent results:

Although most are mathematical symbols, the inequality operators are not restricted to indexes containing numeric values. In the commands below, which are equivalent, you are requesting SPIRES to find records with indexed NAME values that fall alphabetically before the letter K:

The indexed value JOHNSON would fit the criteria, but not KENNEDY.

B.3.2.3.3  (The BETWEEN...AND... Operator)

The "BETWEEN value AND value" operator is a combination of BEFORE and AFTER ("> and <") over the range of specified values. This operator retrieves records with values in the specified range, excluding the values named.

The "BETWEEN...AND..." operator can be used to search compound indexes and qualifiers but cannot be used to search simple indexes. The ">" and "<" operators can be used in combination to perform the "BETWEEN...AND..." function on simple indexes.

B.3.2.3.4  (The FROM...TO... Operator)

The FROM-value-TO-value operator retrieves records containing values over the range specified and including the values named.

The "FROM...TO..." operator can be used to search compound indexes and qualifiers, but like the "BETWEEN...AND..." operator, it cannot be used to search simple indexes. The ">=" and "<=" operators can be used in combination to perform the "FROM...TO..." function on simple indexes.

B.3.2.3.5  (The PREFIX Operator)

The PREFIX operator specifies that any indexed value retrieved must contain the designated alphabetic characters in sequence at the beginning of the value.

For example, "FIND TITLE PREFIX ENVI" might retrieve records containing ENVIRONMENTS AROUND US or ENVIOUS LADY.

would retrieve all records in which the indexed title value has the characters "over an" at the beginning, such as "OVER AN IGLOO", "OVER AND OVER" or "OVER ANDOVER". A record with a title value of "UNDER, OVER AND THROUGH" would not be retrieved.

You should note that if an index is a "word index", where each word in the element value is indexed separately [See B.3.5.1, B.3.6.5.] no value in the index will be longer than one word. In such an index, if your search value is longer than one word, an error message will result. You might want to use the equality operator instead.

B.3.2.3.6  (The SUFFIX Operator)

The SUFFIX operator works like the PREFIX operator, except that the search value must be appear at the end of the retrieved value instead of at the beginning. If the end of the value matches the SUFFIX string specified, the record is retrieved.

For instance, "FIND TITLE SUFFIX MENT" would find records with the indexed value ENVIRONMENT or WET CEMENT or NO COMMENT.

would retrieve all records containing the phrase "nd Smith" at the end of the indexed value, including BROWN AND SMITH and LELAND SMITH.

As with the PREFIX operator, you should note that if an index is "word-indexed" [See B.3.5.1, B.3.6.5.] no value in the index will be longer than one word. In that type of index, if your search value is longer than one word, an error message will result. In that case you shoul