Select value into Job Parametr
Moderators: chulett, rschirm, roy
Select value into Job Parametr
Hi !
I need to set Job Parametr to value from database
How i can do it ?
I need to set Job Parametr to value from database
How i can do it ?
snassimr,
since job parameters cannot be changed within the job they are used in you will need an indirect approach. Write a DataStage job to read the database values and write them to a hash file or sequential file. Then write a short function in Uv/BASIC to read this value and return it to the caller. Then write a DataStage sequence which calls this routine activity and gets the parameter value to pass to a DataStage job.
since job parameters cannot be changed within the job they are used in you will need an indirect approach. Write a DataStage job to read the database values and write them to a hash file or sequential file. Then write a short function in Uv/BASIC to read this value and return it to the caller. Then write a DataStage sequence which calls this routine activity and gets the parameter value to pass to a DataStage job.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
snassimr,
no code for this from me, although I think a good search will pick up some. You need to use the BASIC commands "OPEN" to open the hash file, and "READ" to read a record.
no code for this from me, although I think a good search will pick up some. You need to use the BASIC commands "OPEN" to open the hash file, and "READ" to read a record.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Why you want to do this? The purpose of a hash file is to use keys. If you are reading parameter values then the key should be the parameter name. The value should be field 1.May be you can post the code extracting non-key field from hash file
Code: Select all
ParamName = Arg1
open "MyParamValues" to ParamHashFile else stop
read ParamRec from ParamHashFile, ParamName else
ParamRec = ''
end
ParamValue = ParamRec<1>
Ans = ParamValue
Mamu Kim
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
STOP statement in Routine is bad practice. Routines should always return. Prefer something like
Code: Select all
ParamName = Arg1
ParamRec = ""
OpenPath "C:\users\mydir\MyParamValues" To ParamHashedFile
Then
Read ParamRec From ParamHashedFile, ParamName
Else
ParamRec = ""
Call DSLogWarn("Value for " : ParamName : " not found.", "Loading")
End
End
Ans = ParamRec<1>
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.
Hello,
You can read the value from the DB into a transformer in which you can use a StageVariable to call the UtilityRunJob routine like that:
UtilityRunJob("JobName", "JobParam1=value1|Jobparam2=value2....","RowsLimit","WarningsLimit")
You need to pass all of the jobs parameters, though.
this is also good for a loop (when you want to run a job for each record you read from a file and transfer parameters from the same record).
hope it helps'
Keren
You can read the value from the DB into a transformer in which you can use a StageVariable to call the UtilityRunJob routine like that:
UtilityRunJob("JobName", "JobParam1=value1|Jobparam2=value2....","RowsLimit","WarningsLimit")
You need to pass all of the jobs parameters, though.
this is also good for a loop (when you want to run a job for each record you read from a file and transfer parameters from the same record).
hope it helps'
Keren
Hi,
Just wanted to state that if you use the option of the routine givven to run DS jobs verify no passwords will be written to the logs.
IHTH,
Just wanted to state that if you use the option of the routine givven to run DS jobs verify no passwords will be written to the logs.
IHTH,
Roy R.
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Time is money but when you don't have money time is all you can afford.
Search before posting:)
Join the DataStagers team effort at:
http://www.worldcommunitygrid.org