How can i change value of job parameter at run time.
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 37
- Joined: Sun Aug 01, 2004 1:18 am
How can i change value of job parameter at run time.
Hi Guys,
I have an small question. How can i change value of job parameter at run time. Here is the situation..
I had 15 stages in my job. In second stage, a value is going to generate. I need to catch that value and need to use in 15th stage for file name. So my intension is .... I will declare one job parameter. Now i have to assign that value to this Job parameter, so that i can use it in last stage as file name.
I would appreciate in advance
BB
I have an small question. How can i change value of job parameter at run time. Here is the situation..
I had 15 stages in my job. In second stage, a value is going to generate. I need to catch that value and need to use in 15th stage for file name. So my intension is .... I will declare one job parameter. Now i have to assign that value to this Job parameter, so that i can use it in last stage as file name.
I would appreciate in advance
BB
-
- Participant
- Posts: 85
- Joined: Fri Jun 04, 2004 2:30 am
- Location: Melbourne, Australia
- Contact:
Remove the last stage of your job (job1) and save the input rows for that stage into a temporary staging file (either a sequential file or hashed file).
Output the parameter you want to catch into a Sequential file or Database table.
Create another job (job2) that uses the temporary staging file as input and add the last stage you have removed from your original job.
Then create another job (job3) that uses Datastage BASIC in the Job Control tab of the 'Job Properties' dialogue to open the file/table, get the parameter and then use Job Control commands to set the parameter and also kick off the final job.
Output the parameter you want to catch into a Sequential file or Database table.
Create another job (job2) that uses the temporary staging file as input and add the last stage you have removed from your original job.
Then create another job (job3) that uses Datastage BASIC in the Job Control tab of the 'Job Properties' dialogue to open the file/table, get the parameter and then use Job Control commands to set the parameter and also kick off the final job.
Cheers,
Dave Nemirovsky
Dave Nemirovsky
I think you could modify the routine in viewtopic.php?t=89419 post and change a parameter value in the current job.
Mamu Kim
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Use a job sequence to run the jobs.
In the job that generates the value, have it also place the value in that job's user status area.
In the next job, use Job2.UserStatus$ to retrieve the previous job's user status area value when loading the parameter value.
In the job that generates the value, have it also place the value in that job's user status area.
In the next job, use Job2.UserStatus$ to retrieve the previous job's user status area value when loading the parameter value.
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.
Please excuse me for having a HUGE mental block - but Ray said:
deal and doing this process with a literal is no problem ie: - but I'm struggling with how to move a newly computed value into the UserStatus area.
Thanks Again!
Jennifer
How exactly would I accomplish that? With an after job routine? In the JobControl? How exactly do I get, say, a value from an output column into the UserStatus area??? I mean, I get the wholeIn the job that generates the value, have it also place the value in that job's user status area.
Code: Select all
Call DSSetUserStatus (column.value)
Code: Select all
Call DSSetUserStatus ("Pass This Value")
Thanks Again!
Jennifer
I still do not like this method. I think it is cleaner to leave the result in a hash file and use the routine posted to change the parameter value to the one written to the hash file. I can do one or a hundred parameter values this way. All I need is a temporary holding place like a hash file or a sequential file. I posted the same routine which reads a complete list of parameters from a sequential file. A lot of people do this in batch files. I like sequences but need this functionality. I think more people would use sequences if they knew they could do this. They have been told for so long that you need a batch file for this that they have given up on trying to do this in a sequence. You do not need batch files any more with this technique.
Mamu Kim
This won't work if the job parameter is part of a filename AND the stream is continous (without a passive stage breaking the flow)kduke wrote:I think you could modify the routine in viewtopic.php?t=89419 post and change a parameter value in the current job.
So, if your job looks like this:
SEQ --> XFM --> SEQ, then the target sequential file is created the instant the transformer output link starts. In that case, the filename is permanently fixed.
Now, if your job loks like this:
SEQ --> XFM --> HASH --> SEQ, then the target sequential file is not created until the hash file has finished receiving input rows. So, an after-transfomer routine call could in theory modify a job parameter value.
However, I failed to followup on the post Kim linked, because I am prejudiced against using internal hacks on the job design in a production jobstream. If Ascential changes ANYTHING on an upgrade it could potentially break these "hacks" and that's why I don't recommend these approaches.
There are NO documented facilities for dynamically changing a job parameter at runtime. There are MACROs that can be used to generate dynamic results in fixed fields, such as filenames, that could do what you wish. There's certainly plenty of functionality in job control APIs and Sequencers to provide your functionality. There's always my favorite, write a standard output filename and then rename into the final name, which is quick, easy, and painless.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
-
- Participant
- Posts: 37
- Joined: Sun Aug 01, 2004 1:18 am
can i change value of job parameter at run time?
Hi All,
I was in vacation. Thats why i am unable to respond about this issue. I havn't used routines earlier, Could you plz assist me how to include some value in Job status in a job activity and how to retrieve in another job activity.
And i am so thankful for your quick response.
Thanks,
BB
I was in vacation. Thats why i am unable to respond about this issue. I havn't used routines earlier, Could you plz assist me how to include some value in Job status in a job activity and how to retrieve in another job activity.
I also want to send job name to the next job activity. How can i do?ray.wurlod wrote:Use a job sequence to run the jobs.
In the job that generates the value, have it also place the value in that job's user status area.
In the next job, use Job2.UserStatus$ to retrieve the previous job's user status area value when loading the parameter value.
And i am so thankful for your quick response.
Thanks,
BB
Here is part of a routine I use to get parameter from SQL server during run time, and setting it to job parameter:
If ParamName = '' Then Return('')
ParamList = STAGECOM.JOB.CONFIG<CONTAINER.PARAM.NAMES>
Locate(ParamName,ParamList,1;ParamPos) Then
STAGECOM.JOB.STATUS<JOB.PARAM.VALUES,ParamPos> = ParamValue
End
Good lock,
Noam.
If ParamName = '' Then Return('')
ParamList = STAGECOM.JOB.CONFIG<CONTAINER.PARAM.NAMES>
Locate(ParamName,ParamList,1;ParamPos) Then
STAGECOM.JOB.STATUS<JOB.PARAM.VALUES,ParamPos> = ParamValue
End
Good lock,
Noam.
-
- Participant
- Posts: 37
- Joined: Sun Aug 01, 2004 1:18 am
Thanks Bland,
and about point 2 is.. my job has one FTP stage and it is directly sending to our FTP server. How can i change file name(in FTP server) from UNIX env.
Could you please give clear picture..
Thanks,
BB
How can i generate required file name by using MACROs and what MACROs i can use?kcbland wrote:kduke wrote:1.) There are MACROs that can be used to generate dynamic results in fixed fields, such as filenames, that could do what you wish. There's certainly plenty of functionality in job control APIs and Sequencers to provide your functionality.
2.) There's always my favorite, write a standard output filename and then rename into the final name, which is quick, easy, and painless.
and about point 2 is.. my job has one FTP stage and it is directly sending to our FTP server. How can i change file name(in FTP server) from UNIX env.
Could you please give clear picture..
Thanks,
BB