Previous Page | Next Page

SAS Component Language Dictionary

SEARCHPATH



Reports the complete pathname of a SAS catalog entry
Category: Catalog

Syntax
Details
Example
See Also

Syntax

path-name=SEARCHPATH(entry-name<,description>);

path-name

contains the path (four-level name) for the specified entry if it was found in the current catalog or in the search path. If the entry was not found, then the value is blank.

Type: Character

entry-name

is the SAS catalog entry to search for.

Type: Character

description

specifies whether to return the description of the entry and the date the entry was last updated. Specify Y to return the description and the date.

Type: Character


Details

SEARCHPATH returns the full four-level SAS library member name for a catalog entry if the entry is found in one of the catalogs that are in the current search path. It also returns the description that is stored with the entry in description.

If an entry that has the specified name appears in more than one catalog in the search path, then only the path to the first entry found is returned. If no search path is defined, the search is limited to the current catalog (the catalog in which the executing entry is stored).

To define the search path for your application, use SEARCH.

Note:   To get the pathname and description of an entry, you can use the method interface of the Catalog entry class.  [cautionend]


Example

Load a stored list from a catalog entry if the entry is found in the current search path:

init:
   DCL num desclen
   rc=rc;
   rc=search('sashelp.afclass');
   rc=search('sashelp.aftools');
   rc=search<'sashelp.assist');

   path=searchpath('listed.frame','y');
   pathlen=length(path);
   name=scan(path,1,");
   namelen=length(name) + 1;
   desclen = pathlen - (namelen) - 10;
   desc = substr(path, namelen + 1, desclen);
   date = substr(path, pathlen - 9, 10);
   put name=;
   put desc=;
   put date=;
return;

This program produces the following output:

name=sashelp.aftools.LISTED.FRAME
desc=   Generic list editor
date=10/09/1996


See Also

SEARCH

Previous Page | Next Page | Top of Page