Stop button not working

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Stop button not working

Post by gpbarsky »

[:)][:)][:)][:)][:)]

Hi my friends.

During a running of a job, I pressed the "Stop" button (to cancel the job) and nothing happened. The job continued running.

The question is:
1) Why nothing happened ?
2) Is there any BASIC sentence that doesn't obey the "Stop" button ? Just in the middle of a SLEEP sentence this happened. Better said, this did not happen.

Thanks in advance.

[:)][:)][:)][:)][:)]


Guillermo P. Barsky
Buenos Aires - Argentina
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

If you have constructed a batch job using DS BASIC logic, or subroutines and functions, then the STOP button has some ineffectivity. When calling a DS API, you will find that the API's have awareness of the stop button, but not all BASIC functions do.

Try this, write a Batch job that contains the following logic [:D]:

Loop Until @FALSE Do Repeat

Run this job and press the stop button. Press the stop button again. Press it a third time. Now go get a sandwich. Press the stop button again. Finish your sandwich and put in a DVD of Lord of Rings: The Two Towers. Now press the stop button again. [:D]

If the job hasn't stopped by now, you're probably realizing that this button does not apply when you go off the reservation. If you build infinite loops, you're going to want to build an exit strategy into your loops. My favorite method is to periodically check a polling directory for a flag file's existence. You can find these techniques listed on this forum and www.datastagexchange.com.



Kenneth Bland
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

Kenneth:

Thank you for your answer.

I have already implemented the logic that you described in your note, but I couldn't believe that having the button, I had to check for the existence of a file, and so on...

I appreciate your comments, and anyway, I will be eating a sandwich without pressing the unusefull "Stop" button.

Thanks again.


Guillermo P. Barsky
Buenos Aires - Argentina
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you read the message that pops up when you press the Stop button, you will note that it sends a stop request to the server. Whatever is happening has to know how to check whether this has happened (it's actually an update to a record in the RT_STATUSnn table for the job). That would be the perfect thing to poll for, except that exactly what to poll for is a trade secret. [B)]

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
degraciavg
Premium Member
Premium Member
Posts: 39
Joined: Tue May 20, 2003 3:36 am
Location: Singapore

Post by degraciavg »

Guillermo amigo,

You need to see if the job is still active or not. One way to do it is check if it's still writing log info into the RT_STATUSnn, where nn is the job number, files. If not, no amount of clicking of the Stop button will change the Job Status in the Director window. What you need to do is select that job and Clear the Status file. If you're using v4, you need to open the job in Designer and re-compile it.

Sometimes the Job Status in the Director window does reflect the actual status of the job that you run. I also think it's an API problem...

cheers,
vladimir
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Keep in mind the STOP button does not work while job control is paused on a SLEEP statement. The original question asks about when the STOP button works with DS BASIC commands.

The answer is simple: DS API's are coded to look for the STOP button request. DS BASIC functions and commands do not have this awareness. See my previous post regarding the sandwich.

Kenneth Bland
Post Reply