Scheduling of a Job

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

goriparthi
Charter Member
Charter Member
Posts: 57
Joined: Fri Feb 24, 2006 7:44 am

Scheduling of a Job

Post by goriparthi »

i want to schedule a job every third and last friday of each month,we are only using datastage director to schedule jobs . Is there a way to run the jobs accordingly? Any ideas Please!


Thanks

Raj
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

I don't think there is a direct way to schedule your jobs in the director as per your requirement.
You might need to look for other options.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The answer is no.

Every Friday 13th schedules every Friday and every 13th.

There's no way to identify the last Friday of a month with the Director scheduling interface; some months have four Fridays, some have five.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If all you are using is the Director to create cron entries, then it becomes a manual effort. You tell it which dates are the dates to run in any given month.
-craig

"You can never have too many knives" -- Logan Nine Fingers
goriparthi
Charter Member
Charter Member
Posts: 57
Joined: Fri Feb 24, 2006 7:44 am

Scheduling of a Job

Post by goriparthi »

Can i do it with in a sequencer by using a wait for file activity or a execute command stage , but if i use the execute command then i should know when exactly is the last friday of the month from unix dynamically .
and trigger the job every friday and the execute command should check wether its last friday or not of the month ,if ti satisfies that should trigger my job.

But can anyone help me in the unix command or to create a file on that day dynamically.

Thanks
Raj
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You can build a routine to take a date as one of three inputs and then check to see if it is the "Xth Y" of that month. We built one that will generically handle any occurance of any day name... however, didn't set it up for 'Last' - just 1st Monday, 2nd Friday, etc.

We then run a Sequence every day where that is the first activty, downstream activity is only triggered when the routine returns 'true'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
goriparthi
Charter Member
Charter Member
Posts: 57
Joined: Fri Feb 24, 2006 7:44 am

Scheduling of a Job

Post by goriparthi »

Guys,

Finally i thoought of creating a file in unix and check for file every friday and this files will be only created on third friday and last friday with different names and chekinig these files my jobs will get triggered .
I am doing this by altering my crontab file and creating these files.

code:
10 15 ? * 6#3 cat /clocal/srvr2159/dump01/db2temp_process_2/spdwinput/crun.txt > /clocal/srvr2159/dump01/db2temp_process_2/spdwoutput/frun.txt
for third friday

But i am getting an error saying


0481-079 Reached a symbol that is not expected

Can anyone please correct me so that this can work.

Thanks
Raj.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Can you please outline what you think this entry is doing?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Here's what i found on google.
http://post.doit.wisc.edu/library/techl ... rr0481.htm

Scroll down for the error code.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

6#3 is meant to represent the third occurance of the 6th day of the week - i.e. the third Saturday of the month. FYI, Friday is the day 5 of a week, while Sunday is the '0th' day.

However, it's not standard syntax from what I've seen. I believe that only specialized implementations of cron allow syntax like that, plus fun stuff like 'L' for 'Last', 'W' for 'closest Weekday' etc. Where did you find this, your man pages? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
goriparthi
Charter Member
Charter Member
Posts: 57
Joined: Fri Feb 24, 2006 7:44 am

Scheduling of a Job

Post by goriparthi »

This entry should create a dummy file every third friday at 10:15 am.
But i am not sure of this part ? * 6#3 ,it doesn't like the # symbol or something.I got this code by browsing google unix forums.Please explain



Thanks
Raj
DeepakCorning
Premium Member
Premium Member
Posts: 503
Joined: Wed Jun 29, 2005 8:14 am

Post by DeepakCorning »

Well there is one complex way that it can be done if you really want to do it --

1. Write a routine which will find out the last day of the friday. (Find out what is the last day and date in the month and subtract a number from it to reach the last friday).
2. Design a job and call this routine in it. Schedule this job to run each friday and if the friday's date matches with the date u stored in the step 1 then trigger the required job.

What do u think guys??? :?:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Obviously, it's not supported syntax on your platform. Talk to an SA, ask them how you can shedule something to run on the third Friday of any given month.

Or use your Enterprise Scheduler if you have one - Control-M for example. Or write that routine!

ps. Already been suggested, Deepak. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
goriparthi
Charter Member
Charter Member
Posts: 57
Joined: Fri Feb 24, 2006 7:44 am

Scheduling of a Job

Post by goriparthi »

Thanks guys , I will have to start working on that routine as craig mentioned earlier.Yes My Crontab is not supporting the 6#3 .I got this by browsing google.
I will work on that routine and let you all know


Thanks
Rajesh
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

:idea: A much easier routine would be one that reported (true/false) whether it was the third or last Friday in the month.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply