DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
suja.somu
Participant



Joined: 07 Feb 2013
Posts: 79

Points: 778

Post Posted: Thu Mar 21, 2019 5:40 am Reply with quote    Back to top    

DataStage® Release: 11x
Job Type: Parallel
OS: Unix
A Sequence job is scheduled to trigger daily at 10 PM and it runs multiple jobs . There is one Parallel DataStage job(say X) in that sequence that has to run at a particular time at 2 AM. Even if the Preceding jobs finish early before 2 AM, the sequence job should keep running and wait till 2 AM to trigger the job X . If the Preceding jobs finish later than 2 AM, the sequencer should exit . How I can do this ?
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54501
Location: Sydney, Australia
Points: 295558

Post Posted: Thu Mar 21, 2019 9:51 am Reply with quote    Back to top    

Check whether the time is after 10PM and earlier than 2AM (e.g. User Variables activity). If it is, execute a sleep command to wait until 02:00 then run the job. If it is after 2AM, then bypass that ...

_________________
RXP Services Ltd
Melbourne | Canberra | Sydney | Hong Kong | Hobart | Brisbane
Rate this response:  
Not yet rated
ith0021



Group memberships:
Premium Members

Joined: 16 Jul 2016
Posts: 1

Points: 7

Post Posted: Fri Mar 22, 2019 3:25 am Reply with quote    Back to top    

Ray provided the solution..

Another option would be, take out the 'X' job from the main sequence job.
Schedule the main sequence job to run at 10 pm and once it is completed touch 'mainsequencejob.Done' file.
Also schedule the 'X' job to run at 2 AM and have a wait for file activity to check the 'mainsequencejob.Done' file, if it is there continue to run the 'X' job or dont execute the job.

_________________
Karthik
Rate this response:  
Not yet rated
suja.somu
Participant



Joined: 07 Feb 2013
Posts: 79

Points: 778

Post Posted: Fri Mar 22, 2019 9:40 am Reply with quote    Back to top    

Thanks Ray and Karthik for the response.

Currently I am checking the time in a shell script and executing the Job, it works fine. I want to simplify the design to get rid of shell script and also I don't want to use touch or done file.

I am more inclined towards Ray solution. Could you please elaborate on the first step : how to check time in User Variable activity?

Also , Sleep HH:MM in the execute command stage failed with a error " invalid time interval "

Even on the Linux box , the error is as below
sleep: invalid time interval `02:00'


Version: DataStage 11.5 on RHEL LINUX

Please help.
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 42923
Location: Denver, CO
Points: 221366

Post Posted: Sat Mar 23, 2019 2:05 am Reply with quote    Back to top    

Just going to address the "Also". That sleep sleeps for an amount of time, by default in seconds, not until a specific time, which is why you got that interval error. So you would need to get the current time as Ray noted and then compute the number of seconds (or minutes) until your target time, then sleep for that interval.

_________________
-craig

The Old Ones were, the Old Ones are, and the Old Ones shall be. Not in the spaces we know, but between them. They walk serene and primal, undimensioned and to us unseen.
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54501
Location: Sydney, Australia
Points: 295558

Post Posted: Mon Mar 25, 2019 5:38 pm Reply with quote    Back to top    

Within DataStage BASIC programming language SLEEP hh:mm is permitted, so you can effect this with a very simple one-line routine. (Avoid Execute Command - every time you use it you carry the over ...

_________________
RXP Services Ltd
Melbourne | Canberra | Sydney | Hong Kong | Hobart | Brisbane
Rate this response:  
Not yet rated
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54501
Location: Sydney, Australia
Points: 295558

Post Posted: Mon Mar 25, 2019 5:42 pm Reply with quote    Back to top    

Code: Oconv(@TIME, "MT") >= "22:00" Or Oconv(@TIME, "MT") <= "02:00" System variable @TIME is set when the job starts ...

_________________
RXP Services Ltd
Melbourne | Canberra | Sydney | Hong Kong | Hobart | Brisbane
Rate this response:  
Not yet rated
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 42923
Location: Denver, CO
Points: 221366

Post Posted: Tue Mar 26, 2019 6:27 am Reply with quote    Back to top    

Ah yes... forgot about the whole BASIC versus UNIX aspect of sleeping. Wink

_________________
-craig

The Old Ones were, the Old Ones are, and the Old Ones shall be. Not in the spaces we know, but between them. They walk serene and primal, undimensioned and to us unseen.
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours