I have a Job Sequence which loops multiple times, calling a job which returns a single value each iteration (via UserStatus) to the calling sequence.
After n iterations of this loop I would like to have a comma-separated list of those returned values in a variable that I can then pass to yet another job.
Unfortunately the User Variable Activity stage variables do not allow the construct "A = A : <new value>" and I can't see a simple way to do this; but perhaps I'm overthinking the problem and am missing some simple solution that someone else here might find.
I've temporarily worked around the issue by declaring a user-written BASIC function which uses a COMMON block to statically store a variable and append strings to it on each call, but this seems to be a bit too complicated.
Job Sequence question - loops and user variables
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Maybe an Execute Command activity involving echo with the >> indirection operator to accumulate the values in a file then, outside the loop, another Execute Command activity to cat the file? Of course you'd also need to ensure that the file did not exist or was empty before the loop begins.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Re: Job Sequence question - loops and user variables
Execute Command Stage will be an option for this logic to implemented. Every time output value will be over written to existing file with new value concatenated to it. ![Idea :idea:](./images/smilies/icon_idea.gif)
![Idea :idea:](./images/smilies/icon_idea.gif)