Passing parameter out of datastage job

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

Juls
Participant
Posts: 51
Joined: Tue Sep 14, 2004 9:17 am

Post by Juls »

chulett wrote:If the value is set in one sub-sequence and needs to be accessed in another, that second sub-sequence will need a Routine Activity stage that can retrieve the User Status area from any named job in order to bring that value over into the second sub-sequence. Assuming, of course, that the job that sets it in the other sub-sequence has run by then.
Thanks!
This is almost exactly what I need to do:
Value is set in one sub_sequence and needs to be accessed in the top sequence job (that calls it) to do some "if then" condition testing and decide whether or not to proceed running 2nd sub-sequence job.

This is were I will use routine that I wrote that extracts the user status based on jobname(argument). I will call this routine in top sequence job.
Correct?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Correct! :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

I tried to use the DSSetUserStatus routine that is published on some posts but I keep getting this error when I test the routine.

Routine:

Call DSSetUserStatus(Arg1)
Ans = Arg1
RETURN(Ans)


TEST #1
*******

Arg1 = 'Jim'

Test completed.

DSLogWarn called from : DSRGetJob
Message to be logged is...
> Cannot find a job number 0

Result = Program "TSTSetUserStatus.B": Line 5, Variable "ANS" previously undefined. Empty string used.


Can someone please help.

Thanks
Jim Stewart
Raftsman
Premium Member
Premium Member
Posts: 335
Joined: Thu May 26, 2005 8:56 am
Location: Ottawa, Canada

Post by Raftsman »

I tried to use the DSSetUserStatus routine that is published on some posts but I keep getting this error when I test the routine.

Routine:

Call DSSetUserStatus(Arg1)
Ans = Arg1
RETURN(Ans)


TEST #1
*******

Arg1 = 'Jim'

Test completed.

DSLogWarn called from : DSRGetJob
Message to be logged is...
> Cannot find a job number 0

Result = Program "TSTSetUserStatus.B": Line 5, Variable "ANS" previously undefined. Empty string used.


Can someone please help.

Thanks
Jim Stewart
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Two things.

1) I don't believe this is something testable from the Manager as there is no user status area to update. You'll need to use it in either a small test job or just go for the real deal and see what happens.

2) You didn't actually include the 'RETURN(Ans)' part in your routine, did you? That's automatically part of the routine.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Jessie
Participant
Posts: 16
Joined: Wed Mar 07, 2007 2:11 pm

Post by Jessie »

[
vercama
Participant
Posts: 11
Joined: Thu Aug 07, 2008 3:21 am

UserStatus in PX

Post by vercama »

chulett wrote:No need for an additional stage if it's already available in the User Status area of one of the jobs in the Sequence job. Besides, that wasn't the question.

Juls asked about accessing it from two sub-sequence jobs called from a third top level sequence job. The User Variables stage won't help here. If the user status value is set in the top level sequence, you just need to pass it to both sub-sequence jobs in order to use it in any of their jobs.

If the value is set in one sub-sequence and needs to be accessed in another, that second sub-sequence will need a Routine Activity stage that can retrieve the User Status area from any named job in order to bring that value over into the second sub-sequence. Assuming, of course, that the job that sets it in the other sub-sequence has run by then.

Hi Folks,
there are many posts about UserStatus in parallel talking about C routines, and so on, but I've not found the final solution yet. So to summarize:
I know how passing one parameter from one job to another one into a Sequence job using Server jobs (setUserStatus SERVER routine).
What about Prallel? DSSetUserStatus is not usable in PX :(
Post Reply