Page 1 of 1

Issue while running the job from Unix

Posted: Fri Apr 05, 2013 8:00 am
by hi_manoj
Hi All,
I have requirement, which says like this.
I will be running a sequence (say AA) for a given end time (say 8 PM), and gracefully abort/stop the sequence once the system time is > 8 PM.

So i thought to write a script to do this. Initially I though to run the job from unix just to check whether the command is working or not; and the command i am using is to check for run is
dsjob -domain <dname> -server <sname> -user <uname> -password <paname> -run -project <pname> -job <AA>

and it throws this error
ERROR RUNNING JOB
status code = -14 DSJE_TIMEOUT

I have checked the director log for job AA, I could see just one entry for today's date and it says
Attempting to cleanup after ABORT raised in job AA

Regards
Manoj

Posted: Fri Apr 05, 2013 8:16 am
by chulett
Reset the job and try again?

FYI - the only way to 'gracefully' exit the sequence at a particular time would be from inside the sequence itself. What does the sequence do over the course of the day - loop?

Posted: Mon Apr 08, 2013 4:14 am
by hi_manoj
Hi Chulett,

I wrote a script and kept it just below the Endloop stage. Inside the script i am checking whether the system time is greater or equal to 20 (24 hrs) and if the condition is true then by help of dsjob -stop <proj name> <job name> command I am stopping the job.

I have tested the job and it is working fine, but not sure if this is going to create any issue in any situation,

Regards
Manoj

Posted: Mon Apr 08, 2013 7:21 am
by chulett
That should be... fine. I would typically check the time and branch past the End Loop to get out early, that way is more 'graceful' as the job ends normally and you can still do whatever wrap-up / completion steps you may need.

Posted: Tue Apr 09, 2013 1:05 am
by hi_manoj
Thanks Chulett for your response.
I am doing the same, checking time and then sending a STOP command to DS engine. All this is happening before the end loop stage.
<some satge> ---> <execute stage> -----> <End loop> ----> <begin loop>
From your last Ans (" branch past the End Loop" )are you saying to do the same thing after the end loop stage ?
<some satge> ---> <End loop> ----> <execute stage> -----> <begin loop>

One more question,

Initially I am running a script (execute stage) to check for the files and create trigger files according to the data files. After execute stage i have a sequencer stage and 3 links are coming out from the sequencer stage and connected to 3 wait for file stage; i have kept 5 min as time out value in wait for file stage.

When i run the job and the execute stage complete it job; wait for file stage starts it process and it start one after other ( i mean first one wait for file stage will execute it will run for 5 min then second will start and after 5 min third starts)
My question is as the 3 wait for file stage comes form a sequencer stage all should start at same time and after 5 min all should time out.
Or this the how it should work.

Please note the Property is ALL in sequencer stage.

Regards
Manoj

Posted: Tue Apr 09, 2013 7:20 am
by chulett
I'm not saying to do "the same thing" at all as there's no need to issue the stop request. What stage(s) come after the End Loop stage? Meaning when the loop ends do you do anything else? All you need is a Sequencer set to 'Any' after the End Loop to branch to which will end the loop early and the job will end normally. If you don't need to do anything after the Loop then that stage can end the job. Again, gracefully.

The Wait For File stage is a 'blocking' stage, nothing else will happen until it completes. So what you are seeing is How It Works. If your script checks for the files, why the need for the WFF stage at all? :?

Posted: Fri Apr 12, 2013 4:30 am
by hi_manoj
Hi All,

I have some new issue to address for the same job.
I have 2 types of file, depending on the type I have to pass a value to one parameter.

Suppose say for type A file the value should be GX else it will be GY. I want to implement this using User variable activity stage.

I will create a script with will check for the file type and write only GX or GY to another file (xyz.txt)
Using User variable activity stage i want to read the value from the file (xyz.txt) and pass it as a parameter to downstream jobs.

Please help
Regards
Manoj

Posted: Fri Apr 12, 2013 7:12 am
by chulett
What part do you need help with? I don't see anything that looks like a specific question. :?