Hi
Does anyone know if a job's $UserStatus has limitations with respect to storing dynamic arrays?
I note this post (at the bottom) says you can:
viewtopic.php?t=88837
My array structure is:
<1,n>
<2,n>
When I write the $UserStatus to the log, it apears the <2,n>'s are not making it.
If I change the structure to:
<n,1>
<n,2>
I get an abort with the error:
Job control process (pid DSLink2
1) has failed
Where DSLink2 and 1 are values in <n,1> and <n,2> respectively.
Thanks
$UserStatus and Dynamic Arrays
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
None whatsoever. You can store anything into a job's user status area, including a dynamic array of arbitrary structure.
Whether the activity $UserStatus accurately retrieves this, or truncates it to field #1 only, is something I've never tested. It ought not to - so if you can reproduce it and need the multi-field returned, submit an enhancement request.
A workaround would be to apply a Lower() function to the argument of DSSetUserStatus(), so that every delimiter in the dynamic array is demoted. You can then retrieve the single-field dynamic array and promote them again using a Raise() function before proceeding as planned.
Whether the activity $UserStatus accurately retrieves this, or truncates it to field #1 only, is something I've never tested. It ought not to - so if you can reproduce it and need the multi-field returned, submit an enhancement request.
A workaround would be to apply a Lower() function to the argument of DSSetUserStatus(), so that every delimiter in the dynamic array is demoted. You can then retrieve the single-field dynamic array and promote them again using a Raise() function before proceeding as planned.
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.
It seems it is not possible to set $UserStatus as a dynamic array:
The result of above:
SetUserStatusAsDynamicArray..JobControl (This is $UserStatus): 1=
One
By using Lower and Raise I can achieve the desired outcome:
Result of the above:
SetUserStatusAsDynamicArray..JobControl (This is $UserStatus): 1=
One
2=
Two
3=
Three
Anyone understand what is going on here?
Code: Select all
*Set up array
TestA<1,1> = '1='
TestA<1,2>= 'One'
TestA<2,1>= '2='
TestA<2,2>= 'Two'
TestA<3,1>= '3='
TestA<3,2>= 'Three'
*Set job user status and log
Call DSSetUserStatus(TestA)
TestB = DSGetJobInfo(DSJ.ME,DSJ.USERSTATUS)
Call DSLogInfo(TestB , "This is $UserStatus")
SetUserStatusAsDynamicArray..JobControl (This is $UserStatus): 1=
One
By using Lower and Raise I can achieve the desired outcome:
Code: Select all
*Set up array
TestA<1,1> = '1='
TestA<1,2>= 'One'
TestA<2,1>= '2='
TestA<2,2>= 'Two'
TestA<3,1>= '3='
TestA<3,2>= 'Three'
*Demote array elements
TestA = Lower(TestA)
*Set job user status
Call DSSetUserStatus(TestA)
*Promote back to dynamic array and log
TestB = Raise(DSGetJobInfo(DSJ.ME,DSJ.USERSTATUS))
Call DSLogInfo(TestB , "This is $UserStatus")
SetUserStatusAsDynamicArray..JobControl (This is $UserStatus): 1=
One
2=
Two
3=
Three
Anyone understand what is going on here?