Sequencer

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Sequencer

Post by dspxguy »

If my job sequencer aborts for any reason then the temporary status file created has to be deleted otherwise the sequencer aborts again and again.
i have jobs in my sequencer and using routine activity stage for jobaudit, so whenever the sequencer fails, a temp status file has to be deleted otherwise sequencer does not run,

Any suggestions.
Thank you
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

More details needed...

- How and when is this 'temporary status file' created?
- What is the dependency of this 'temporary status file' and the failure of the job?

If you don't want this file to exist, you could do a check for its existance and nuke it off each time you begin your job.

P.S. It is sequence not sequencer.
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Create an After Job subroutine that checks the job's INTERIM status and if it says it will be aborting when it finishes, delete this 'temporary status file'.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

Thanks Chulett and Narasimha..
will I be using a routine "GetJobStats" ? and do I have to create routine for all jobs in my Job sequence ?
I am already using a routine "failureforce" after each job aborts, so I need to add another routine activity stage after "forcefailure" routine stage which will check for job status and delete temp status file...right?

Appreciate any help in this regard,
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

How about an ExecuteCommand (do not skip) activity at the front of the job sequence?

Code: Select all

test -f #pathname# && rm -f #pathname#
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

ray.wurlod wrote:How about an ExecuteCommand (do not skip) activity at the front of the job sequence?

Code: Select all

test -f #pathname# && rm -f #pathname#
...

Thanks for the post Ray..

rm -fr would remove all files in a directory and the directory itself, what does rm -f do? I am asking this because I have a temp directory created after sequencer aborts and a staus file is created ( which is not in the temp directory). so I have to get rid of both of them.
The execute command stage would be in the start of the sequencer and can you explain me the whole code please..

Thanks
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

dspxguy wrote: rm -fr would remove all files in a directory and the directory itself, what does rm -f do?
From rm man pages -
OPTION

-f, --force
ignore nonexistent files, never prompt
gateleys
dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

ray.wurlod wrote:How about an ExecuteCommand (do not skip) activity at the front of the job sequence?

Code: Select all

test -f #pathname# && rm -f #pathname#
...

Hi all,

When trying to delete my status file using the above syntax I am getting this info message in director

Reply=126
Output from command ====>
test: /usr/bin/test: cannot execute binary file

can anyone help pls.
thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Post your command syntax, not Ray's. And I mean the actual 'Executed command' from the same log entry you posted the output from.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

chulett wrote:Post your command syntax, not Ray's. And I mean the actual 'Executed command' from the same log entry you posted the output from.

Command:

'sh'


Parameters:

test -f #DEL_FILE# && rm -f #DEL_FILE#

DEL_FILE is my job parameter with path to the status.txt file in the unix directory
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Again, please post the actual values from the log, not from the job. It should have all those parameters translated and show exactly what was actually run.
-craig

"You can never have too many knives" -- Logan Nine Fingers
dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

I have one command activity stage and one job activity.
Just want to delete status file before the job activity stage runs.

the message in director is

seq_delstatfile..JobControl (@Exec_Comm): Executed: 'sh' test -f /home/edw/delstatus.txt && rm -f /home/edw/delstatus.txt
Reply=126
Output from command ====>
test: /usr/bin/test: cannot execute binary file

Event #:43
Timestamp:7/9/2007 12:15:07 PM
Event type:Info
User:user1
Message:
seq_delstatfile..JobControl (@Coordinator): Summary of sequence run
12:12:31: Sequence started
12:12:31: Exec_Comm (COMMAND 'sh') started
12:12:31: Exec_Comm finished, reply=126
12:12:31: Job_Act (JOB job1) started
12:15:07: Job_Act (JOB job1) finished, status=2 [Finished with warnings]
12:15:07: Sequence finished OK

Thanks
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

You don't need the sh here.
Just execute

Code: Select all

test -f /home/edw/delstatus.txt && rm -f /home/edw/delstatus.txt
You should be fine. (Parameterize as required)
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
dspxguy
Participant
Posts: 156
Joined: Thu May 24, 2007 4:09 pm
Location: Simi Valley, CA

Post by dspxguy »

narasimha wrote:You don't need the sh here.
Just execute

Code: Select all

test -f /home/edw/delstatus.txt && rm -f /home/edw/delstatus.txt
You should be fine. (Parameterize as required)

Thankyou very much all of you ....it works.

What if I also had a directory and it was in the same path folder in which I have the delstatus.txt file, and I want to get rid of the directory also. will I need two execute command stages before job activity or I can perform it in same execute command stage.
narasimha
Charter Member
Charter Member
Posts: 1236
Joined: Fri Oct 22, 2004 8:59 am
Location: Staten Island, NY

Post by narasimha »

You could do it as a part of the same activity, just append

Code: Select all

&& rm -r /home/edw
to your command (Assuming you want to remove edw directory)
Narasimha Kade

Finding answers is simple, all you need to do is come up with the correct questions.
Post Reply