Page 1 of 1
How to schedule chore job monthly
Posted: Mon Mar 18, 2013 1:14 pm
by LP_user
Hi,
I want to schedule one chore job monthly. But TM1 doesn't support schedule monthly. How can I do it?
With best regards,
LP_user
Re: How to schedule chore job monthly
Posted: Mon Mar 18, 2013 1:17 pm
by declanr
Presumably you mean that you want a chore to run on the last day of every month (or something like that).
You can just schedule 1 TI Process (lets call it "z_control") to run every day at your desired time.
In the Prolo of that one process you have an IF statement to check whether the date "NOW" fits within the parameters you want and if it isn't then it just ends.
If the parameters are met then you just use ExecuteProcess()'s to kick off all the TIs you would have had in your chore.
HTH
Re: How to schedule chore job monthly
Posted: Mon Mar 18, 2013 1:36 pm
by LP_user
Hi declanr,
Thanks for your answer. It is good idea to write one TI process to control the chore job.
Could you please give me the code example how to justify if the "NOW" is the last day of the month?
With best regards,
LP_user
declanr wrote:Presumably you mean that you want a chore to run on the last day of every month (or something like that).
You can just schedule 1 TI Process (lets call it "z_control") to run every day at your desired time.
In the Prolo of that one process you have an IF statement to check whether the date "NOW" fits within the parameters you want and if it isn't then it just ends.
If the parameters are met then you just use ExecuteProcess()'s to kick off all the TIs you would have had in your chore.
HTH
Re: How to schedule chore job monthly
Posted: Mon Mar 18, 2013 8:09 pm
by Alan Kirk
LP_user wrote:Hi declanr,
Thanks for your answer. It is good idea to write one TI process to control the chore job.
Could you please give me the code example how to justify if the "NOW" is the last day of the month?
See my post on
Using Dates And Times, which lists all of the relevant functions including the
Day() one.
In this case I would add 1 to the Now() value to get the following day's date, then check the Day() function for that. If it's 1, you know that tomorrow is the first and that therefore today is the last day of the calendar month. This saves you from needing to do a test based on the month as well ("30 days has September, April June and November..." etc) and also gets you out of needing to worry about February in leap years.
If your accounting months do not correspond with the calendar months, though, you should have some form of dates lookup cube which contains flags to indicate dates which are the last day of the month. You would look up the date returned from the Now() function (converted to a string; again, see my post for details) in that cube to see whether it's currently the last day of the month.
Re: How to schedule chore job monthly
Posted: Fri Mar 29, 2019 4:39 pm
by CellPutN
Thanks Alan,
The following process is executed every day and it works just fine to execute my Month-End process.
Code: Select all
#==================================================
# Variable Declaration
#==================================================
sTomorrow = DATE(NOW + 1);
#==================================================
# Execute process based on sTomorrow value
#==================================================
IF(DAY( sTomorrow ) = 1);
# Do stuff
ENDIF;
Cheers,
Peter
Re: How to schedule chore job monthly
Posted: Mon Apr 01, 2019 5:31 am
by macsir
In newer TM1 version, tm1runti command can execute chores now.
https://www-01.ibm.com/support/docview. ... wg27048305
Re: How to schedule chore job monthly
Posted: Mon Apr 01, 2019 12:04 pm
by CellPutN
Thanks macsir but i'm not sure to understand how tm1runti can solve this problem ?
Peter
Re: How to schedule chore job monthly
Posted: Mon Apr 01, 2019 12:11 pm
by Wim Gielis
You could use a Windows Scheduled Task, containing the script with TM1runti.exe. For example a batch file.
If then the script is executed every first of the month using Windows, you obtain what is required.
Re: How to schedule chore job monthly
Posted: Mon Apr 01, 2019 1:35 pm
by CellPutN
Thanks Wim !!