Pass yesterday's date as parameter
Moderators: chulett, rschirm, roy
Pass yesterday's date as parameter
Hi,
I have a situation where I have to extract data from a oracle table which are generated daily with name as "table_mmddyyyy" so if I can pass yesterday's date as parameter in the extarction job then I can select the table which is created yesterday.
How can I pass that automatically at run time?
Pl help.
Regards
Om
I have a situation where I have to extract data from a oracle table which are generated daily with name as "table_mmddyyyy" so if I can pass yesterday's date as parameter in the extarction job then I can select the table which is created yesterday.
How can I pass that automatically at run time?
Pl help.
Regards
Om
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
If you're passing a parameter to the job you have to pass it from somewhere - perhaps a job sequence, perhaps a shell script. It's there that you generate yesterday's date. In a job sequence a suitable expression is (Adjust the specification to suit requirements.)
Code: Select all
Oconv(@DATE - 1, "D-YMD[4,2,2]")
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.
Thanks for the prompt reply ray,ray.wurlod wrote:If you're passing a parameter to the job you have to pass it from somewhere - perhaps a job sequence, perhaps a shell script. It's there that you generate yesterday's date. In a job sequence a suitable expression is(Adjust the specification to suit requirements.)Code: Select all
Oconv(@DATE - 1, "D-YMD[4,2,2]")
I have a shell script written which can generate yesterday's date in the format I want. How do I pass it in parameter?
Regards
Om
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
dsjob -server <host> -user <userID> -password <passwd> -run -jobstatus -param name=value <projectname> <job>
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.
-
- Charter Member
- Posts: 166
- Joined: Wed Mar 16, 2005 6:52 am
- Location: Mumbai, India
Hi Om,
Wrap Kumar's Function call in ereplace like:
to replace all spaces to Empty Strings.
Wrap Kumar's Function call in ereplace like:
Code: Select all
EREPLACE(Oconv(Date()-1,"DMDY[2,2,4]"),' ','')
Amey Vaidya<i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.</i>
<i>- Douglas Adams</i>
Done...ameyvaidya wrote:Hi Om,
Wrap Kumar's Function call in ereplace like:
to replace all spaces to Empty Strings.Code: Select all
EREPLACE(Oconv(Date()-1,"DMDY[2,2,4]"),' ','')
Thanks a Lot !
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
More efficient is (I assume this expression is in a job sequence; Oconv() is not available in parallel jobs but is available in job sequences.
Code: Select all
Oconv(@DATE-1, "D-YMD[4,2,2]" : @VM : "MCN")
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.