Chapter Contents |
Previous |
Next |
SEARCH |
Category: | Catalog |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
rc=SEARCH(cat-name|special-argument); |
0 | successful |
-1 | not successful |
Type: Numeric
Type: Character
'-DISABLE'
'-ENABLE'
'-POP'
'-POPALL'
Note: You must include the hyphen (-) as the first character
in each of these argument values. Otherwise, the value will be treated as
a catalog name in the WORK library.
Type: Character
Details |
You do not need to know the exact location of a catalog member, only that it is in one of the catalogs in the current search path.
When a function that uses the current search path is called, the catalogs in the search path are searched from first to last until the specified entry is found or until the end of the search path is reached.
If there is no current search path, or if the current search path has been disabled or overridden, then the search is limited to the current catalog.
Example |
Set up a search list with MYLIB1.CAT1, MYLIB1.CAT2 and MYLIB1.CAT3. Each time SEARCH is called, the new value of the argument is pushed to the front of the list. Therefore, MYLIB1.CAT3 is searched first. If MYPROG.PROGRAM exists only in MYLIB1.CAT1, it still executes correctly, because MYLIB1.CAT1 is also in the search path.
rc=search('mylib1.cat1'); rc=search('mylib1.cat2'); rc=search('mylib1.cat3'); call display('myprog.program');
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.