Chapter Contents |
Previous |
Next |
GETLATTR |
Category: | List |
Syntax | |
Details | |
Example | |
See Also |
Syntax |
attributes=GETLATTR(list-id<,index>); |
Type: Character
Type: Numeric or List
If index is 0 or is omitted, then the attributes returned by GETLATTR are list attributes. If index is nonzero, then GETLATTR returns the attributes associated with the indexed item instead of the attributes for the entire list.
Type: Numeric
Details |
The items in attributes can be used to assign attributes to another list or item. The string returned as attributes contains a blank before and after each attribute, which makes it easy to determine whether an attribute is set by searching attributes for an attribute name. Use the INDEX function to search the string for a specified attribute.
If index is omitted, attributes contains one attribute from each row of the following table:
Default Setting | Alternate Setting | |
---|---|---|
UPDATE | NOUPDATE | |
NOFIXEDTYPE | FIXEDTYPE | |
NOFIXEDLENGTH | FIXEDLENGTH | |
ANYNAMES | SASNAMES | |
DUPNAMES | NODUPNAMES | |
NOCHARONLY | CHARONLY | |
NONUMONLY | NUMONLY | |
COPY | NOCOPY | |
HONORCASE | NOHONORCASE |
If index is supplied, then attributes is the set of item attributes consisting of one attribute from each row of the following table:
Default Setting | Alternate Setting | |
---|---|---|
ACTIVE | INACTIVE | |
DELETE | NODELETE | |
NOFIXEDTYPE | FIXEDTYPE | |
UPDATE | NOUPDATE | |
WRITE | NOWRITE |
For detailed information about these attributes, see SETLATTR.
Example |
Create a list LISTID with one item and print the sets of list attributes for LISTID as well as the item attributes that are associated with the first item of LISTID. Note the leading and trailing blanks in the attribute strings, which are made evident by embedding the attribute strings in double quotation marks.
INIT: listid = makelist(1); listattrs = '"' || getlattr(listid) || '"'; put listattrs=; found = index(listattrs,'UPDATE'); put found=; itemattrs = '"' || getlattr(listid,1) || '"'; put itemattrs=; rc = dellist(listid); return;The output of this example is
LISTATTRS=" DELETE UPDATE NOFIXEDTYPE NOFIXEDLENGTH ANYNAMES DUPNAMES NOCHARONLY NONUMONLY COPY NOHONORCASE" FOUND=10; ITEMATTRS=" ACTIVE WRITE NOAUTO NOEDIT DELETE UPDATE NOFIXEDTYPE "
FOUND returns the starting position of the word "UPDATE" in the string of list attributes.
See Also |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.