Hi,
How to return the value of stage variable to a control job.
i.e. I am Storing the count of Duplicates in a stage variable.I want to return this count to the Control job.so that i will log this count in error table.
Thanks,
SivaG
Returning stage variable value to Control job
Moderators: chulett, rschirm, roy
Hello 120267,
to expand on what Kim has already stated, the communication between a sequence (or controlling job) and a child is via job parameters. These parameters cannot be changed by the child, so the exchange of data only works in one direction - from parent to child.
Your controlling process must therefore get the information. As Kim pointed out, the child needs to store this information somewhere (a sequential or hashed file or by writing it into the log file) and then the calling process needs to retrieve this information - probably the easiest solution is to write your own small routine and call this through a routine activity in the sequencer.
to expand on what Kim has already stated, the communication between a sequence (or controlling job) and a child is via job parameters. These parameters cannot be changed by the child, so the exchange of data only works in one direction - from parent to child.
Your controlling process must therefore get the information. As Kim pointed out, the child needs to store this information somewhere (a sequential or hashed file or by writing it into the log file) and then the calling process needs to retrieve this information - probably the easiest solution is to write your own small routine and call this through a routine activity in the sequencer.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
One value can be loaded into the job's User Status area. This value can contain anything, including a delimited string, by which means it can pass more than one actual value.
A job sequence can access the job's user status area conveniently through the job activity's activity variable $UserStatus.
Of course, only the final value will be recovered in the control job; even though a stage variable might be updated every row, control does not return to the controller until the current run finishes.
Perhaps you have not thought through your requirement sufficiently thoroughly?
A job sequence can access the job's user status area conveniently through the job activity's activity variable $UserStatus.
Of course, only the final value will be recovered in the control job; even though a stage variable might be updated every row, control does not return to the controller until the current run finishes.
Perhaps you have not thought through your requirement sufficiently thoroughly?
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Did you search for the answer? You would have found this routine.
Invoke this in any column derivation that's not doing anything else, with the stage variable name as its argument. Or modify the code so that the DSSetUserStatus routine is invoked from an after-stage or after-job subroutine.
Code: Select all
FUNCTION SetUserStatus(TheValue)
Call DSSetUserStatus(TheValue)
Ans = TheValue
RETURN(Ans)
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.