UD FIND - Unsave Document - Find value

(11/18/09)

PURPOSE

Given a specific register column and a desired value retrieves first line from a document file having the desired value in the specified register column. Document files are stored in-core after first use until they are cleared with 'UD FIND E'.   Example.   Example.

SEE ALSO

UD FIND E [Unsave Document - End Use of UD Find incore doc]
UD NEXT [Unsave Document - Next line]
UD IC [Unsave Document - In-core, Retrieve register values]

USAGE

.OPERATION: UD FIND [key],[r1],[r2],....

[Where: <key> returns the document file key and [r1],[r2],........ returns up to 100 registers from that line. If the requested value is not found the [key] will contain a zero.]

.DOCUMENT FILE: DOC998
[Enter name of the document file.]

.REGISTER COLUMN & VALUE WANTED: 3, 102
[Enter register column to be searched and search value.]

[For example with the following document file:

; dat/dat 16-Sep-96 AT 09:52:24 doc007.dat
1 2 22.000 142.00
2 2 101.00 202.00
3 2 102.00 303.33
11 2 111.00 712.00
100 2 112.00 613.00


The following SPIDER procedure:

UD FIND [key],[r1],[r2]
doc002
1,102

VM echo ' ' r1: {****[r1]} r2: {%f8.2%[r2]}

Will give the following output:
 
R1: 102 R2: 303.00

NOTES

  1. When the end of the file is reached without finding the desired value the returned 'key' value is zero.

  2. IMPORTANT: only 12 document files may be accessed concurrently with 'UD IC' or 'UD FIND'. Once the limit is reached one of the current files must be cleared by a 'UD ICE' or 'UD FIND E' command. An attempt to apply 'UD FIND' to a 13'th document file before execution of a 'UD FIND E ' command to free the area reserved for data from an existing file will result in an error message.]

SUBROUTINES

UDOCIC, OPENDOC, LUNDOC

CALLER

DRIV3