How to pass a variable date as a parameter in dsjob
Moderators: chulett, rschirm, roy
How to pass a variable date as a parameter in dsjob
Hi
I have requirement, where I have to read a text file which contains o one date value.I have to send this date as job parameter, Later I have to use that parameter in my SQL Query.
How Can I achive this? Please let me know. I appriciate your time.
Note : we are not using Sequencer Jobs
Thanks
Vkr
I have requirement, where I have to read a text file which contains o one date value.I have to send this date as job parameter, Later I have to use that parameter in my SQL Query.
How Can I achive this? Please let me know. I appriciate your time.
Note : we are not using Sequencer Jobs
Thanks
Vkr
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Create the job with a Date type job parameter.
When the job is submitted, provide a legal date value (in YYYY-MM-DD format).
For example
When the job is submitted, provide a legal date value (in YYYY-MM-DD format).
For example
Code: Select all
dsjob -run -param jpMyDate='2010-11-18' -jobstatus project jobname
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.
Thank you for the updates.
Let me enhance my requriement.I have a sub query,that fetches a date from one table.I am using that date in my main query.We have observed that if I have used the sub Query in my main Query, It is taking longer window to fetch records.
To over come this,I have came up with a design like,
First execute the SubQuery and load that into a sequential file.
Now I have read the file and pass the value to DS Job param,Then I will use that parameter in my sql query.
Starttime=`cat /home/vkrp/testfile.txt`
I have confusion on how to pass the value in seq file to Job parameter.
Please advise me on this? Thanks in Advance
Let me enhance my requriement.I have a sub query,that fetches a date from one table.I am using that date in my main query.We have observed that if I have used the sub Query in my main Query, It is taking longer window to fetch records.
To over come this,I have came up with a design like,
First execute the SubQuery and load that into a sequential file.
Now I have read the file and pass the value to DS Job param,Then I will use that parameter in my sql query.
Starttime=`cat /home/vkrp/testfile.txt`
I have confusion on how to pass the value in seq file to Job parameter.
Please advise me on this? Thanks in Advance
-
- Participant
- Posts: 42
- Joined: Thu Dec 11, 2008 11:07 am
the way i understood your design is :
1st job creating a sequencial file with subquery to get the date field
(which you are reading through unix command)
2nd job actual extract query
Now, if these two jobs are in different sequencer job is easy just map your jobparameter while calling your dsjob -param <paramset>.<jpName> =$Starttime
else if these two jobs are in same sequencer and you have to pass the jobparameter value at run time try using execute command between the jobs in sequencer canvas.
1st job creating a sequencial file with subquery to get the date field
(which you are reading through unix command)
2nd job actual extract query
Now, if these two jobs are in different sequencer job is easy just map your jobparameter while calling your dsjob -param <paramset>.<jpName> =$Starttime
else if these two jobs are in same sequencer and you have to pass the jobparameter value at run time try using execute command between the jobs in sequencer canvas.
Thanks for the response,
We are using batch jobs.We are passing all the parameters in prm file.
Job execution order in csv file to Master Job Control.
If I do the bellow way,
dsjob -param <JParam>=$Var
I am sure it will pass the value to control job. How would it pass to actual job? Please advise me
We are using batch jobs.We are passing all the parameters in prm file.
Job execution order in csv file to Master Job Control.
If I do the bellow way,
dsjob -param <JParam>=$Var
I am sure it will pass the value to control job. How would it pass to actual job? Please advise me
-
- Participant
- Posts: 42
- Joined: Thu Dec 11, 2008 11:07 am
-
- Participant
- Posts: 42
- Joined: Thu Dec 11, 2008 11:07 am
Sorry...
completely missed your note
Note : we are not using Sequencer Jobs
Could you pls share some more info about your master job is this a parallel job/server basic job which reads your param file and csv file of job names to call the jobs in sequence.
Please elaborate on your master control job
![Embarassed :oops:](./images/smilies/icon_redface.gif)
Note : we are not using Sequencer Jobs
Could you pls share some more info about your master job is this a parallel job/server basic job which reads your param file and csv file of job names to call the jobs in sequence.
Please elaborate on your master control job
-
- Participant
- Posts: 42
- Joined: Thu Dec 11, 2008 11:07 am
In that case your master job would have a polling mechanism for triggering and it might be looping through list of jobs in csv files, after reading your .ini file.
update your .ini file with startdate parameter and csv with your job 1st creating startdate file then your select job.
Here you just need to make sure as in run time this parameter is being created just read your .ini file inside the job loop or think check your logic you need to get this parameter before you call your select job.
update your .ini file with startdate parameter and csv with your job 1st creating startdate file then your select job.
Here you just need to make sure as in run time this parameter is being created just read your .ini file inside the job loop or think check your logic you need to get this parameter before you call your select job.