I´m using the getlabel function to retrieve the labels in the valueset of a variable.
The problem is that we have to know in advance which are the existing values in the valueset. For example, if the values are 1....9, I can execute a do loop retrieving them
do varying i = 1 until i > 9
x = getlabel(E17_MENOS_VS1,i);
But suppose that the values are not in order, like 1,4,8,9,17,99?
Then I would have to retrieve them one by one.
What I´m suggesting is that we might have something like the dynamic setvalueset, for example, getvalueset, but instead of returning a single value for the function, it would return the values and the labels in the arrays. Like
Or a function to retrieve the codes and another function to retrieve the labels for an index in the valueset. For example:
where i would be the ith entry in the valueset.
We might need also the size of the valueset, in order to execute that in a do loop, like
do varying i = 1 until i > lentgh(district_vs1)
x = getvaluesetcode(district_vs1,i);
y = getvaluesetlabel(district_vs1,i);
I know it is a little bit farfetched, but why not?
What would you like to see in CSPro?
2 posts • Page 1 of 1
There has been discussion about adding enhanced value set operations in a future release. For now, you can skip over unused values by checking if getlabel returns blank. This code would allow you to only process the values in your value set: