Use the LOCSTEM() function to determine the values used for a stem variable's indexes.
The LOCSTEM() function has this syntax:
index = LOCSTEM(stem.,[num])
The LOCSTEM() function takes these arguments:
|
stem. |
Stem variable's name (including the period). |
|
num |
Number of a stem item. |
|
index |
Returns one of the following: (if num is specified): Value of the index for the specified stem item. (if num is omitted or zero): Count of stem elements. (if an error occurs): Error text. Indexes are returned in the same order as they were created. |
The LOCSTEM() function produces these return codes:
101 - 102 ARG n MISSING OR INVALID
121 STEM VARIABLE NOT FOUND
122 STEM HAS NO MEMBERS
Example
Consider this example:
limit = locstem('ABC.') /* Obtain count of members */
do i = 1 to limit
index = locstem('ABC.',i) /* Obtain value for index */
say 'ABC.'||index 'Has value: ABC.index
end i
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |