Chapter Contents


SAS External File Class: _getMembers

SAS External File Class: _getMembers

Conditionally retrieves the members of a SAS External File object of type "DIRECTORY"

_getMembers List Items


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

Argument Type Description
N specifies the identifier of an SCL list. Each entry in members-list corresponds to an external file and is a sublist. Specify members-list as a numeric variable that is initialized either to 0 or to a valid list identifier. If the value of members-list is 0, then _getMembers creates a new list, fills it with the members of the SAS External File object, and returns the list identifier. If members-list is nonzero, then it must be a valid list identifier; otherwise, the program will halt with an error.
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.
C specifies the named items that are included in each entry of members-list. 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 "¬". In Release 6.11, 'NAME' is the only item that can be masked.
C appends any members entries to members-list; members-list is cleared by default

_getMembers List Items
List item Type Description
NAME C a physical filename


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

If _getMembers is invoked on a SAS External File object of type "FILE", then members-list is empty.

By default, _getMembers clears all items from members-list and fills it with the SAS External File object members. If 'APPEND' is specified, then the SAS External File 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.


This example creates two SAS External file objects, EXTFILEOBJ1 and EXTFILEOBJ2. The _assign method associates the filerefs, MYFILE1 and MYFILE2, to directories for EXTFILEOBJ1 and EXTFILEOBJ2, respectively. _getMembers for EXTFILEOBJ1 returns any files named ' Mail' or ' sasuser' into MEMLIST. The _getMembers method for EXTFILEOBJ2 appends the names of the members in mypath2 to MEMLIST. The result is that MEMLIST contains any ' Mail' or ' sasuser' members in MYPATH1 and all members in MYPATH2.

extfileobj2= instance(extfilecls);
length engine $8 type $15;
call send (extfileobj1, '_assign_', 
           'myfile1', 'mypath1');
call send (extfileobj2, '_assign_', 
           'myfile2', 'mypath2');
call send (extfileobj1, '_get_members_',
           memlist, "NAME='Mail sasuser'");
call send (extfileobj2, '_get_members_', 
           memlist, ' ', 'name','append');

Here is an example of what the list might look like:

putlist memlist
( ( NAME='sasuser'
  ( NAME='Mail'
  ( NAME='localsig'
  ( NAME='remotesig'

The name of each member in MYPATH1 and MYPATH2 is added to MEMLIST.

Chapter Contents



Top of Page

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