Convert to day

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
nandela.sudheer
Participant
Posts: 39
Joined: Mon May 19, 2008 7:22 am

Convert to day

Post 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.
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post 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
nandela.sudheer
Participant
Posts: 39
Joined: Mon May 19, 2008 7:22 am

Post 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.
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post 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.
nandela.sudheer
Participant
Posts: 39
Joined: Mon May 19, 2008 7:22 am

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Custom trigger:

Code: Select all

 Mod(@DATE,7) <= 1
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
nandela.sudheer
Participant
Posts: 39
Joined: Mon May 19, 2008 7:22 am

Post by nandela.sudheer »

Mod(@DATE,7) <= 1 for Sunday and Moday
Mod(@DATE,7) > 1 for Tuesday to Friday

Is it correct?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Yes, this was your requirement.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post by vamsi.4a6 »

Could anybody reply what is the reason for the problem and how to resolve it?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post 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?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

@DATE returns the internal value for the current date.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply