SAS Component Language Dictionary |
Category: | Catalog |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
rc=SEARCH(cat-name|special-argument); |
contains the return code for the operation:
0 | |
-1 |
is the catalog to push to the front of the current search list.
to enable the current search list. If there is no disabled list, then the current search list remains empty.
to clear the current search list.
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.
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 |
Copyright © 2009 by SAS Institute Inc., Cary, NC, USA. All rights reserved.