Chapter Contents

Previous

Next
SAS Logical: _getMembers

SAS Logical: _getMembers



Conditionally retrieves the members of a SAS Logical object


Syntax
_getMembers List Items
Details
Examples
Example 1: Select-exclude lists
Example 2: Item masks
Example 3: Obtaining a list of librefs and paths

Syntax

CALL SEND (object-id, '_getMembers', members-list<, select-exclude><, item-mask><, 'APPEND'>);

Argument Type Description
members-list
N specifies the identifier of an SCL list. Each entry in members-list corresponds to a SAS logical name and is a sublist containing the items in Table 1. Specify members-list as a numeric variable that is initialized either to 0 or to a valid list identifier. If the value of members-listis 0, then _getMembers will create a new list, fills it with the members of the Catalog object, and returns the list identifier. If members-listis nonzero, then it must be a valid list identifier; otherwise, the program halts with an error.
select-exclude
C specifies the entries that are returned in members-list. Uses this form:
<item-name='item-values'
...<item-name-n='item-values'>>
The select-exclude argument contains one or more blank-separated select-exclude expressions where item-name is one of the item names from members-list, and item-values is a blank-separated string of possible values for the given item name. To exclude entries with a certain value for an item-name, precede that value with a "not" character, for example '^' or '¬', in the select-exclude expression.
item-mask
C specifies the named items that are included in each members-list entry. item-mask is a blank-separated string of the item names from members-list. To exclude an item from each entry of members-list, precede it with a "not" character, for example '^' or '¬'.
'APPEND'
C appends any members entries to members-list; members-list is cleared by default.

_getMembers List Items
List item Type Description
NAME C the SAS Logical name of the entry
ENGINE C the engine used to access NAME, for example, 'v608'
PATH C the external pathname
TYPE C the Logical name type. If TYPE cannot be determined, _unknownFile is returned. More descriptive information is returned in the lists returned by _getLibrary or _getExtfile, and TYPE can be checked in those lists.
SERVER C the name of the server if the member is a remote SAS library
DATA_REP C the type of data representation if the member is a remote SAS library; can be _dndText, _dndFile, or _dndDataset. For more information about these representations, see SAS/AF online help.


Details

_getMembers and _loadMembers perform the same function except _getMembers allows you to select the members and items that are loaded.

By default, _getMembers clears all items from members-list and fills it with the SAS Logical object members. If 'APPEND' is specified, the SAS Logical object members are appended to the existing members-list. The conditions defined by the select-exclude, item-mask, and options arguments determine the items that are returned in the list.


Examples

Example 1: Select-exclude lists

The following select-exclude string restricts the entries in members-list to only those librefs with a V608 engine:

"type='library' engine='v608' name='^sashelp
      ^sasuser'"

The following select-exclude string restricts the entries in members-list to all non-libref logical names:

"type='^library'"

Example 2: Item masks

The following item-mask restricts the items in each entry to only NAME and TYPE:

"name type"

The following item-mask excludes the ENGINE item from each entry, but all other items (NAME, PATH and TYPE) will be included:

"^engine"

Example 3: Obtaining a list of librefs and paths

This example demonstrates how to use the Logical class to obtain a list of librefs and paths for all currently defined SAS librefs. Since members is set to 0 before the method invocation, after returning from _getMembers, members will contain the list of librefs.

logclass=loadclass
         ('sashelp.fsp.logical.class');
logobj3=instance(logclass);
members=makelist();
call send (logobj3, '_get_members_', members, 
           "type='library'", "name path");


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.