SEARCH
Searches a file for occurrences of a specified string and places the item-ids in a select list.
Command Class
TCL-II command.
Syntax
SEARCH file-specifier item-list {(options}
Syntax Elements
file-specifier The file to be searched.
item-list The list of items in the file to be searched. This can be one or more item-ids separated by spaces, a list generated by a list-generating command, or an asterisk (*) to specify all items.
Options
A ANDs string together. Items must contain all the specified strings. If omitted, items containing any of the specified strings are selected.
F Include the item-id in the search.
I Lists only the item-ids as they are selected.
L Saves the line numbers where the specified strings are found.
The generated select list has the same format as an exploded SELECT. The item-id is repeated in the list, and each id is appended with a value mark and the number of the attribute in which a matching string was found.
N Selects only those items that do NOT contain the specified strings.
Note
If the N and A options are combined, only those items that contain all the specified strings are omitted from the list.
S Suppress the select list. Automatically invokes the I option and is normally used just to show the items that contain a match.
U Specifies that case is significant when comparing strings.
W Specifies that case should be ignored when comparing strings.
Prompts
If you omit the item-list in the TCL statement, the processor prompts:
ITEM-ID:
Enter an asterisk (*) for all items or list the specific item-ids.
After you enter the command line, SEARCH prompts:
STRING:
Type the string of characters to be searched for and press RETURN.
Each time you can type a different string of characters to be searched for. The
STRING
prompt redisplays until you press RETURN only.
Restrictions
The maximum length of the combined input strings is 500 bytes.
Comments
The SEARCH command is similar to the English command ESEARCH.
Case Sensitivity
If neither U nor W is specified, the current data case setting (set with the DATA.CC environment option or the CASE TCL command) is used. See Case Sensitivity for more details.
If both U and W are specified an error message is displayed and no list is generated.
Example
:SEARCH TEST1 * (I
STRING:CHAIR
STRING: RETURN INV 1 ITEMS SELECTED. >>ED TEST1
INV TOP .P
001 CHAIRS 002 2 EOI 002 .EX
'INV' exited from file 'TEST1'
In this example, the item INV is selected from the file TEST1.