Chapter Contents

Previous

Next
SAS Component Language: Reference

Assigning List and Item Attributes

You can assign attributes to lists or to items in a list. Attributes are useful for controlling the use and modification of lists. For example, you can specify that a list is not available for update, which means that other programs called by your program (for example, via CALL DISPLAY) cannot change the data in the list or cannot add or delete items from the list. You can also assign attributes such as NOUPDATE or NODELETE to individual items in a list.

Because it is easy to change the type of any item in a list simply by replacing the value with a new value, it would be quite easy for one application to accidentally change a list in a way that you did not intend. To prevent this possibility, you may want to specify that a list or items in a list have a fixed type. When you assign the proper attributes to the lists and items that you create, you do not need to worry about other parts of the application corrupting your data, and you can avoid adding data validation statements to your programs.

Assigning list and item attributes is not required. However, doing so can facilitate application development, because an attempt to violate an attribute, which indicates a bug in the application, causes the application to stop with a fatal error.

To set the attributes of a list or item, use the SETLATTR function. The GETLATTR function returns a string that describes the current attributes. The HASATTR function returns 1 if the list or item has the specified attribute and 0 if it does not.


Chapter Contents

Previous

Next

Top of Page

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