Chapter Contents

Previous

Next
SAS Component Language: Reference

Referencing List Items by Index Number

List indexing is similar to array indexing. An index I specifies the position of an item in the list. The first item is at index I=1, and the last item is at index I=LISTLEN(mylistid), which is the length of the list. Thus, you can use DO loops to process all items in a list, as shown in the following example:

do i=1 to listlen(mylistid);
   t=itemtype(mylistid,i);
   put 'Item ' i ' is type ' t;
end;


Chapter Contents

Previous

Next

Top of Page

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