Chapter Contents

Previous

Next
SAS Catalog: _getMembers

SAS Catalog: _getMembers



Conditionally retrieves a list of member names contained in a SAS Catalog object


Syntax
_getMembers List Items
Details
Examples
Example 1: Select-Exclude Lists
Example 2: Item Masks
Example 3: Creating an object for a catalog
See Also

Syntax

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

Argument Type Description
members-list N specifies the identifier of an SCL list. Each entry in members-list corresponds to a SAS catalog member and is a sublist containing the items in Table 2. 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 Catalog object, and returns the list identifier. If members-list is a nonzero, then it must be valid list identifier; otherwise, the program halts with an error.
select-exclude
C specifies the entries that are returned in members-list. Use 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-nameis 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. The item-mask argument 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; the members-list argument is cleared by default.
'TIME'
C specifies that the value of MODIFIED and CREATED dates in the members-list be returned as a numeric datetime value rather than a character date value.

_getMembers List Items
List item Type Description
LIBNAME C the name of the SAS library containing catalog-object-id
CATNAME C the catalog name for catalog-object-id
OBJNAME C the catalog entry name for the nth entry in CATNAME
OBJTYPE C the catalog entry type for the nth entry in CATNAME
OBJDESC C the entry description for the nth entry in CATNAME
MODIFIED N | C the last-modified date for the nth entry in CATNAME
CREATED N | C the creation date for the nth entry in CATNAME


Details

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

By default, _getMembers clears all items from members-list and fills it with the SAS Catalog object members. If 'APPEND' is specified, the SAS Catalog 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 call to _getMembers returns all catalog entries from the SAS Catalog object, CATALOG, except those of type PROGRAM:

call send (catobj, '_get_members_', entrylist,
          "objtype='^program'");

The following call to _getMembers returns all catalog entries from the SAS Catalog object, CATALOG, with a type of FRAME or SCL:

call send (catobj, '_get_members_', entrylist,
          "objtype='frame scl'");

Example 2: Item Masks

The following call to _getMembers returns all catalog entries from the SAS Catalog object, CATALOG. Each entry in entrylist has the following item names: OBJNAME, OBJDESC, MODIFIED.

call send (catobj, '_get_members_', entrylist,
           "", "objname objdesc modified");

The following call to _getMembers returns all catalog entries from the SAS Catalog object, CATALOG. Each entry in ENTRYLIST has all item names except MODIFIED.

call send (catobj, '_get_members_', entrylist,
           "", "^modified");

Example 3: Creating an object for a catalog

This example creates an object for the SAS catalog, SASUSER.CAT1, and retrieves information for all entries in SASUSER.CAT1 except those of type PROGRAM.

Each entry in ENTRYLIST contains the LIBNAME, CATNAME, OBJNAME, OBJTYPE, and OBJDESC items.

entrylist=makelist();
call send (catobj, '_get_members_', entrylist,
          "objtype='^program'", 'libname
           catname objname objtype objdesc');

If you list the contents of ENTRYLIST, you see

( ( LIBNAME='SASUSER'
    CATNAME='PROFILE'
    OBJNAME='PASSIST'
    OBJTYPE='SLIST'
    OBJDESC='User profile'
   )[2693]
 )[2661]

_getMembers returns the LIBNAME, CATNAME, OBJNAME, OBJTYPE, and OBJDESC for each entry in SASUSER.PROFILE whose entry type is not PROGRAM. In this example, SASUSER.PROFILE contains only one entry, PASSIST.SLIST. Your SASUSER.PROFILE may contain many other entries.

See Also

_loadMembers


Chapter Contents

Previous

Next

Top of Page

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