Job handling in Unix
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 78
- Joined: Wed Oct 26, 2005 6:12 am
Job handling in Unix
Hi,
I have been working on datastage from past few months.
All these days I was using DS Designer, Director, Manager for Designing / Running jobs.
Now I have to manage the jobs in unix by writing some shell scripts.
I have following basic questions, request you to clarify.
1. How can we check the job run status from Unix?
Any particular parameter that we can check using Shell program?
2. Does datastage write job execution logs in any physical files.
If yes then how can we see / change the log's destination?
3.I am trying to run a job in unix, If I try to run a job without compiling it then I am getting following error
"Error running job" "Status code = -2 DSJE_BADSTATE"
If I compile it from designer and run the job, It is running without any errors. Can any one tell me how we can resolve this?
Any other inputs on Managing DSJobs on Unix will be of great help.
Thanks
Sheshadri
I have been working on datastage from past few months.
All these days I was using DS Designer, Director, Manager for Designing / Running jobs.
Now I have to manage the jobs in unix by writing some shell scripts.
I have following basic questions, request you to clarify.
1. How can we check the job run status from Unix?
Any particular parameter that we can check using Shell program?
2. Does datastage write job execution logs in any physical files.
If yes then how can we see / change the log's destination?
3.I am trying to run a job in unix, If I try to run a job without compiling it then I am getting following error
"Error running job" "Status code = -2 DSJE_BADSTATE"
If I compile it from designer and run the job, It is running without any errors. Can any one tell me how we can resolve this?
Any other inputs on Managing DSJobs on Unix will be of great help.
Thanks
Sheshadri
Heres my 2 cents:
1. How can we check the job run status from Unix?
Any particular parameter that we can check using Shell program?
You could either do a dsjob -report
Print that to a file
Grep for the status and cut the code value
OR
you could just run your job via the dsjob -run command
and for status put a command like
RETURN_VALUE=$?
to get the status of your previous command and then print that to a file
2. Does datastage write job execution logs in any physical files.
If yes then how can we see / change the log's destination?
You could save the logs in a physical place by running the log commands
with the dsjob command
like logsum, report, log etc and save it to a file
3.I am trying to run a job in unix, If I try to run a job without compiling it then I am getting following error
"Error running job" "Status code = -2 DSJE_BADSTATE"
If I compile it from designer and run the job, It is running without any errors. Can any one tell me how we can resolve this?
You can also reset the job from your unix script, again by the dsjob.
dsjob -run -mode RESET -wait ProjectName JobName
Hope it helps
1. How can we check the job run status from Unix?
Any particular parameter that we can check using Shell program?
You could either do a dsjob -report
Print that to a file
Grep for the status and cut the code value
OR
you could just run your job via the dsjob -run command
and for status put a command like
RETURN_VALUE=$?
to get the status of your previous command and then print that to a file
2. Does datastage write job execution logs in any physical files.
If yes then how can we see / change the log's destination?
You could save the logs in a physical place by running the log commands
with the dsjob command
like logsum, report, log etc and save it to a file
3.I am trying to run a job in unix, If I try to run a job without compiling it then I am getting following error
"Error running job" "Status code = -2 DSJE_BADSTATE"
If I compile it from designer and run the job, It is running without any errors. Can any one tell me how we can resolve this?
You can also reset the job from your unix script, again by the dsjob.
dsjob -run -mode RESET -wait ProjectName JobName
Hope it helps
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 78
- Joined: Wed Oct 26, 2005 6:12 am
You should also look into the use of the -jobstatus option rather than the -wait option. Rather than return the 'standard' zero or non-zero status code, what you will get back are the same return codes as are logged in the Director:DSguru2B wrote:you could just run your job via the dsjob -run command
and for status put a command like
RETURN_VALUE=$?
to get the status of your previous command and then print that to a file
1 = Finished Ok
2 = Finished with warnings
3 = Aborted
etc. I've found that more useful in my experience.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
I most definately agree Craig.
Arsheshadri:
You can use Craigs advice or somthing like
to get the job status.
Regards,
Arsheshadri:
You can use Craigs advice or somthing like
Code: Select all
dsjob -jobinfo Project JobName | head -1 | cut -c33
Regards,
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
-
- Participant
- Posts: 78
- Joined: Wed Oct 26, 2005 6:12 am
Hi,
Can some one copy Craig's msg and send it :) I am not able to read it :(
"dsjob -jobinfo Test MiscTest|head -1|cut -c33" command works only if job status "Job Status : RUN with WARNINGS (2)". for other status we have to change "cut -cxx" cmd.
I wanted to check the status dynamically from a script and implement something like this
If status - 1 then echo "Job Run"
If status - 3 then echo "Job aborted"
If status - -1002 then echo "Failed to open a proj"
If status - -1004 then echo "Failed to open a job"...etc
Thanks for all your inputs
Sheshadri
Can some one copy Craig's msg and send it :) I am not able to read it :(
"dsjob -jobinfo Test MiscTest|head -1|cut -c33" command works only if job status "Job Status : RUN with WARNINGS (2)". for other status we have to change "cut -cxx" cmd.
I wanted to check the status dynamically from a script and implement something like this
If status - 1 then echo "Job Run"
If status - 3 then echo "Job aborted"
If status - -1002 then echo "Failed to open a proj"
If status - -1004 then echo "Failed to open a job"...etc
Thanks for all your inputs
Sheshadri
-
- Participant
- Posts: 78
- Joined: Wed Oct 26, 2005 6:12 am
[quote="chulett"]My post is simple enough, just a mechanism to get the job status back directly in the return status without having to 'grep' or 'cut' anything out of the text that is returned as well.
I unmarked it.[/quote]
Thanks Craig, I am using jobstatus now. we don't have to use wait cmd and we get back the status also :)
I unmarked it.[/quote]
Thanks Craig, I am using jobstatus now. we don't have to use wait cmd and we get back the status also :)
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Re: Job handling in Unix
Why? Your three questions indicate that you lack fundamental understanding of how DataStage works and/or that you have not read the documentation for dsjob in the manual. May I suggest you find and attend a training class?arsheshadri wrote:Now I have to manage the jobs in unix by writing some shell scripts.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 78
- Joined: Wed Oct 26, 2005 6:12 am
Re: Job handling in Unix
[quote="ray.wurlod"]May I suggest you find and attend a training class?[/quote]
Do you think one can get better exposure to datastage by attending training classes? :o
I have attended a corporate training class conducted by IBM on
"IBM Websphere datastage Introduction to Enterprise Edition"
believe me, I have learnt lot more by using this forum than by attending the classes and my company won't afford another training class on same.
Do you think one can get better exposure to datastage by attending training classes? :o
I have attended a corporate training class conducted by IBM on
"IBM Websphere datastage Introduction to Enterprise Edition"
believe me, I have learnt lot more by using this forum than by attending the classes and my company won't afford another training class on same.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Clearly you did not attend one of the training classes that I ran! If you had a bad experience, do let IBM know. They seem to be quite genuine in wanting to improve the training classes.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.