Hi @BartDekeyser,
I know I just responded to your email, but I thought I would cross-post my answer here in case others find it useful.
Whenever I have wanted to extract all the values from a list, I’ve done so using a #foreach loop. I am not aware of a more direct way of obtaining the list, and this is the approach that we generally use in the tasks.
For example, I would use Velocity code such as this. It first checks to see if the list is empty, and then lists all of the items in the list:
#if($multientrytest.size() > 0)
%let List =#foreach($item in $multientrytest) $item#end;
#end
If $multientrytest returns , then the above loop would return .
If you still would like for the commas to appear in the list, then this version of the code does that:
#if($multientrytest.size() > 0)
%let List =#foreach($item in $multientrytest) $item#if($foreach.hasNext),#end#end;
#end
So the result would be .
How exactly do you want the list to appear in the generated code?
As for your other question, I am not aware of a way to directly list all the available methods/functions available for a certain VTL variable (I’m pretty sure I have asked a Common Task Model developer this question before and he said it wasn’t possible). For this, I typically use the .getClass() method to find out which java class the VTL variable belongs to. Once the java class is determined, then you reference the java documentation for that class. For example, $multientrytest.getClass() will return class java.util.ArrayList, and then you can look at the java documentation to see the built-in methods for ArrayLists.
Additionally, the SAS Studio task developer’s guide has documentation on additional methods that have been added specifically for writing tasks. For example, there are sections in the documentation with information on additional methods available for DataSource, Role, and OutputData elements.
I hope this is helpful. Please let me know if you have any additional questions or if this does not meet your needs.
Thanks,
-Brian
... View more