Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Need to schedule a job to run every last Tuesday of the month

Former Member
0 Kudos

Hello,

I have been given a requirement to schedule a batch job that repeats every last Tuesday of the month. Right now, I am aware of the option to schedule monthly from a given date. However, that date the following month would not correspond to a Tuesday. Does anyone have any insight as to how I can use SM36 to schedule the job as required? I would much prefer to have it done on a schedule than re-releasing it each month on the specified date.

Thank you in advance for your assistance.

13 REPLIES 13

Former Member
0 Kudos

0 Kudos

Hi Pravin,

Thank you for the reply. I am already familiar with how to use SM36 to schedule jobs, as well as the start condition field. My question is if there is anyway, whether using the start condition field or some other method, that SM36 could be used to schedule a job for a certain day of the last week of each month. For example, we have a close period, and I need to schedule a job that will run at 5pm on the last Tuesday before month end. While I could schedule one for 1/27 (Tuesday) this month with a monthly frequency, this would mean it runs on the 27th the following month, which is not a Tuesday. I am wondering if there is a function in SM36 to allow me to schedule this job specific to last Tuesday of each month. Any assistance you can provide would be very helpful.

- Brian

Former Member

See if you can set up a new Factory calendar via OP03, utilizing Special rules to identify the last Tuesday of each month.

0 Kudos

Using a factory calendar (transaction SCAL) will do the trick.

Former Member
0 Kudos

Ugly, but you could do it this way:

Create a program that checks to see if the current date is on the last Tuesday of the month. If it is, submit your job using the job FMs.

Run this as a background daily at 5:00 PM.

Rob

0 Kudos

Scott and Rob,

Thank you both for the input. I think I am going to explore the Factory calendar method as I am likely to be getting additional job requests with similar type requirements. This looks like it might possibly be a good solution.

0 Kudos

Hi

   I think your way that is right. if the condition is very complex , you should write a program code.

Best regards,

Jimmy Chan

0 Kudos

I agree

Has a similar requirement to run a report only on Sundays...code was the easiest way to manage it.

Regards

Arden

0 Kudos

Yes, Even I think its the best option...

Instead of running it daily at 5PM i would say that we can schedule this Program to Run every day on the Last week (date after 22nd of every month!! (keeping FEB as well in mind)!

Just a thought!

Cheers,

Kripa Rangachari!

Former Member
0 Kudos

Did you give Report BTCAUX10 a try ?

Setting the Period Parameters accordingly may help you out.

0 Kudos

No, this will not work.

jan-erik_lovlie2
Explorer
0 Kudos

Hi Brian,

If you are able to use CRON, a CRON expression like this will run a process (or job) at 13:00 the last Tuesday of every month.

'00 13 * * 2L '

Here's a link to Cron on wikipedia if you need it:

https://en.wikipedia.org/wiki/Cron

There are external job schedulers that are capable of setting this up for you.

Here's a link to a list of them.

List of job scheduler software - Wikipedia, the free encyclopedia

Regards,

jogeswararao_kavala
Active Contributor
0 Kudos
  • Develop a code which runs your scheduling program only if the present day is the last Tuesday of the month .
  • And schedule this code to run every day (through SM36).