Issue while running the job from Unix

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
hi_manoj
Participant
Posts: 56
Joined: Sat Aug 13, 2011 2:00 pm
Location: BLR

Issue while running the job from Unix

Post 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
Manoj
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
hi_manoj
Participant
Posts: 56
Joined: Sat Aug 13, 2011 2:00 pm
Location: BLR

Post 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
Manoj
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
hi_manoj
Participant
Posts: 56
Joined: Sat Aug 13, 2011 2:00 pm
Location: BLR

Post 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
Manoj
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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? :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
hi_manoj
Participant
Posts: 56
Joined: Sat Aug 13, 2011 2:00 pm
Location: BLR

Post 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
Manoj
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What part do you need help with? I don't see anything that looks like a specific question. :?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply