$UserStatus and Dynamic Arrays

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
adamski
Charter Member
Charter Member
Posts: 54
Joined: Thu Mar 20, 2003 5:02 pm

$UserStatus and Dynamic Arrays

Post by adamski »

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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
adamski
Charter Member
Charter Member
Posts: 54
Joined: Thu Mar 20, 2003 5:02 pm

Post by adamski »

Thanks Ray

I will see if I can re-produce this under another scenario, and try the work around if necessary.
adamski
Charter Member
Charter Member
Posts: 54
Joined: Thu Mar 20, 2003 5:02 pm

Post by adamski »

It seems it is not possible to set $UserStatus as a dynamic array:

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")
The result of above:
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")
Result of the above:
SetUserStatusAsDynamicArray..JobControl (This is $UserStatus): 1=
One
2=
Two
3=
Three

Anyone understand what is going on here?
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

What is your problem? All the values printed. If you print a dynamic by sending it to the log then it prints one value per line. It looks just like this.
Mamu Kim
adamski
Charter Member
Charter Member
Posts: 54
Joined: Thu Mar 20, 2003 5:02 pm

Post by adamski »

There is really no problem since the implementation of Lower and Raise.

However I am frustrated that a dynamic array could not be stored within $UserStatus without further manipulation.
Post Reply