Page 1 of 1

Stop button not working

Posted: Thu Sep 11, 2003 12:10 pm
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

Posted: Thu Sep 11, 2003 1:34 pm
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

Posted: Thu Sep 11, 2003 1:44 pm
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

Posted: Thu Sep 11, 2003 5:38 pm
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

Posted: Thu Sep 11, 2003 7:32 pm
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

Posted: Thu Sep 11, 2003 8:45 pm
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