Page 1 of 1

Convert to day

Posted: Mon Jan 21, 2013 11:22 pm
by nandela.sudheer
I have Sequence job.I want to Run the sequence job only on Sunday and Monday,other days sequence jobs needs abort.How to implement logic in the Sequence job.Please help me.

Posted: Mon Jan 21, 2013 11:54 pm
by vamsi.4a6
In execute command stage use below command
date +"%u" which will return the 0(Sunday) and in trigger check whether it is zero or not.If it is zero means trigger the Sequence

Posted: Tue Jan 22, 2013 12:04 am
by nandela.sudheer
Thanks for your help.Actually i want to run Sunday and Monday.Please let me know how to write the command in execute coomand.

Posted: Tue Jan 22, 2013 12:26 am
by vamsi.4a6
No need to change anything in execute command activity.Just change the trigger condition to check whether it is 0 or 1 instead of 0.

Posted: Tue Jan 22, 2013 12:35 am
by nandela.sudheer
Thanks. I have Implemented in executed command Returned value = 0 OR 1 (this is one condition for executing next level sequence job). Returned value = 2 or 3 or 4 or 5 (teriminator the sequence job).

Job design is : Excued command -------Returned value is (=2 or 3 or 4 or 5) ----Teriminator activity ------------(again from executed command) ---Return value is 0 or 1 ----Job activity.


The above condition is not working.Please help me

Posted: Tue Jan 22, 2013 1:17 am
by ray.wurlod
Custom trigger:

Code: Select all

 Mod(@DATE,7) <= 1

Posted: Tue Jan 22, 2013 1:23 am
by nandela.sudheer
Mod(@DATE,7) <= 1 for Sunday and Moday
Mod(@DATE,7) > 1 for Tuesday to Friday

Is it correct?

Posted: Tue Jan 22, 2013 4:33 am
by ray.wurlod
Yes, this was your requirement.

Posted: Tue Jan 22, 2013 7:08 am
by vamsi.4a6
Could anybody reply what is the reason for the problem and how to resolve it?

Posted: Tue Jan 22, 2013 7:32 am
by chulett
Probably invalid syntax. "Returned value = 0 OR 1" should in reality be "Returned value = 0 or returned value = 1" and I'm guessing it wasn't. That and the Field Mark you'd have to deal with in any Execute Command result.

Posted: Mon Mar 04, 2013 3:33 am
by vamsi.4a6
Could any body please explain how it will work?

Custom trigger:
Code: Mod(@DATE,7) <= 1

Because @DATE will give Date how can we can divide date by 7?please correct me if i am wrong?

Posted: Mon Mar 04, 2013 7:43 am
by chulett
@DATE returns the internal value for the current date.