Chapter Contents |
Previous |
Next |
SAS External File Class: _getMembers |
Syntax | |
_getMembers List Items | |
Details | |
Example |
Syntax |
CALL SEND (extfile-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 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. |
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 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. |
'APPEND' |
C | appends any members entries to members-list; members-list is cleared by default |
List item | Type | Description |
---|---|---|
NAME | C | a physical filename |
Details |
_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.
Example |
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.
extfilecls=loadclass ('sashelp.fsp.extfile.class'); extfileobj1=instance(extfilecls); extfileobj2= instance(extfilecls); length engine $8 type $15; call send (extfileobj1, '_assign_', 'myfile1', 'mypath1'); call send (extfileobj2, '_assign_', 'myfile2', 'mypath2'); memlist=0; 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' )[3263] ( NAME='Mail' )[3265] ( NAME='localsig' )[3443] ( NAME='remotesig' )[2975]
The name of each member in MYPATH1 and MYPATH2 is added to MEMLIST.
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.