Can someone repost steps to use the $UserStatus variable

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
florianm@us.ibm.com
Participant
Posts: 1
Joined: Tue Apr 17, 2007 6:39 am

Can someone repost steps to use the $UserStatus variable

Post by florianm@us.ibm.com »

I have searched the archives of the forum to find the detailed steps of how to use the UserStatus variable in datastage and must say that I don't see it anywhere in the laundry list of posts. Can someone please repost a FAQ of how to set the variable and then subsequently call it later.

Like others, I am looking to get the max date in one job, call a user defined routine that contains the following call "Call DSSetUserStatus(Arg1)", and then reference that in the next job in the sequence.

It may seem like I understand what to do, but in practice, I am the type that needs to see it in action.

thanks in advance.
Matt Florian
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Welcome aboard. :D

Setting the User Status variable is, as you observe, a matter of calling the DSSetUserStatus subroutine. However, if you need to call it via a transform function you will need an interlude such as:

Code: Select all

FUNCTION SetUserStatus(Arg1)
Ans = Arg1                 ; * pass input argument unchanged
Call DSSetUserStatus(Arg1) ; * load Arg1 into user status area
RETURN(Ans)


To recover this value, you can use DSGetJobInfo(hJob, DSJ.USERSTATUS).
In a job sequence you can also use the name of the Job activity and its associated $UserStatus activity variable, for example:

Code: Select all

JobActivityName.$UserStatus


In versions earlier than 7.5 you will need to type in the variable name; from version 7.5 you can choose it using the expression editor or the parameter helper. The only restriction is that there must exist a connection (links) from the Job activity and wherever you are using the activity variable.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply