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 variable's name (including the period).
Number of a stem item.
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:
ARG n MISSING OR INVALID
STEM VARIABLE NOT FOUND
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 © 2012 CA. All rights reserved. | Tell Technical Publications how we can improve this information |