when transforming stored procedure to datastage,I'm confused with codes like:
"IF day(I_Date) <> 4 THEN return 0;END IF;"
so I wannar check whether it's a right day to run the job.
IF NOT ,the job should be returned immediately.
Although the scheduler in director can point the exact day,I still wannar to check in the job in case of wrong scheduling.
please help!
how to check date before job running
Moderators: chulett, rschirm, roy
Can you not discuss your confusion with regards to the stored procedure with whomever wrote it? If not them, then whomever has taken over support of it?
You want to check in the job and then do what if the day is wrong? In my opinion, that check should be done in a Sequence job and then only run the processing job if it is the correct day, if not then skip the run and possibly send out an email notification to that fact. Schedule the Sequence job, not the actual processing job.
You want to check in the job and then do what if the day is wrong? In my opinion, that check should be done in a Sequence job and then only run the processing job if it is the correct day, if not then skip the run and possibly send out an email notification to that fact. Schedule the Sequence job, not the actual processing job.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
You could, I suppose... but the answer could be as simple as two triggers coming from whatever checks the date, a Routine Activity as one example. One trigger is the 'success / thumbs up / why it *is* the right day' trigger and goes to a Job Activity stage and the other is a 'thumbs down' trigger that goes to a Notification Activity stage or may not exist at all if you just literally want to 'do nothing' in that case.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The expression you mentioned seems to be relying on the ordinal position of the day in the week, that is day #4. You can generate expressions that return the day name (Oconv(@DATE,"DWA")) or day name abbreviation (Oconv(@DATE,"DWB")) or day number in week (Oconv(@DATE, "DD")) if you prefer. As to which is the "right" day - that's likely to be a local business rule, implemented as a constant in the expression, for example Oconv(@DATE,"DWB") = "WED"
Last edited by ray.wurlod on Tue Jul 13, 2010 1:18 am, edited 1 time in total.
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.