Executing a command line program in Job Sequencing
Moderators: chulett, rschirm, roy
Executing a command line program in Job Sequencing
I have a job sequence to run a perl program. On ok i have to trigger another job. Job sequence fails and i don't know y. when i run the same command on the command prompt its run fine but when i enter that on DS job sequence it fails.
Thanks
Thanks
Environment, environment, environment. Your jobs run under a different environment than when you try things from a command line.
You must investigate the environment of the job sequence job to find out what's missing. Write a simple batch or sequence job to execute "env" and find out what's missing or different.
You must investigate the environment of the job sequence job to find out what's missing. Write a simple batch or sequence job to execute "env" and find out what's missing or different.
Kenneth Bland
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Re: Executing a command line program in Job Sequencing
Would you please elaborate a bit more on 'failed'?vzmz wrote:I have a job sequence to run a perl program. On ok i have to trigger another job. Job sequence fails and i don't know y. when i run the same command on the command prompt its run fine but when i enter that on DS job sequence it fails.
Thanks
If you are saying that dsjob is returning a value of '1', that is not Failed in Ascential's eyes. That is actually Okay. '2' is "Warning Found". '3' is "Fatal". There are also other codes that handles unusual situations such as a job crashing. They're grouped in the 90s.
On the Unix line, you need to catch the returned value, and determine if it is 1 or 2, and consider that as a success. You may also only want to accept success without warnings (1 only).
Why is it this way? Ascential believes that you would like to see specific details on how the job did, so they implement this solution to return the same type of codes they uses internally on job sequencer. (Do a search for $JobStatus)
-T.J.
Developer of DataStage Parallel Engine (Orchestrate).
Ok to do that i typed env on the command area under Execute_Command stage and on it sucess i have an email notification with subject pass.kcbland wrote:Environment, environment, environment. Your jobs run under a different environment than when you try things from a command line.
You must investigate the environment of the job sequence job to find out what's missing. Write a simple batch or sequence job to execute "env" and find out what's missing or different.
and on fail i have another email notification with subject pass.
And its works fine, but when i try to type " env >out.txt ." Job sequence fails
Re: Executing a command line program in Job Sequencing
Ok going on with it.Teej wrote:Would you please elaborate a bit more on 'failed'?vzmz wrote:I have a job sequence to run a perl program. On ok i have to trigger another job. Job sequence fails and i don't know y. when i run the same command on the command prompt its run fine but when i enter that on DS job sequence it fails.
Thanks
If you are saying that dsjob is returning a value of '1', that is not Failed in Ascential's eyes. That is actually Okay. '2' is "Warning Found". '3' is "Fatal". There are also other codes that handles unusual situations such as a job crashing. They're grouped in the 90s.
On the Unix line, you need to catch the returned value, and determine if it is 1 or 2, and consider that as a success. You may also only want to accept success without warnings (1 only).
Why is it this way? Ascential believes that you would like to see specific details on how the job did, so they implement this solution to return the same type of codes they uses internally on job sequencer. (Do a search for $JobStatus)
-T.J.
I have some which after cleanzing are been mload to teradata. Once they are in DB i have to run BTEQ scripts.
I made a bteq script file which run perfectly fine on command prompt. But when i am try to run that bteq script in a job sequence its fails.
I have a Execute_Command stage in my job where i write my script file name that has to executed and under trigger i have 2 trigger one on fail and one on OK (which in your terms zero or 1).
Re: Executing a command line program in Job Sequencing
Okay, this is the reverse on what I assumed occured here. In summary:
You have a "BTEQ.sh" script. I know your actual name for that script may be different, but for now, lets assume it is called "BTEQ.sh".
You ran this script via your command line, which uses a specific shell (lets say "Korn Shell"). It worked.
You ran this script via DataStage, which uses the same shell (this is why Ken Bland asked you to show your environment). It failed.
Question: In the Job Sequencer that you ran this script on - what specific stage did you use? Is there any parameters for this script you are attempting to pass to this script?
I would assume that you are using ExecuteCommand stage, and that you have the command "env" on the first textbox, and "> /usr/users/dsadm/output.txt" on the second textbox. Did this work?
-T.J.
You have a "BTEQ.sh" script. I know your actual name for that script may be different, but for now, lets assume it is called "BTEQ.sh".
You ran this script via your command line, which uses a specific shell (lets say "Korn Shell"). It worked.
You ran this script via DataStage, which uses the same shell (this is why Ken Bland asked you to show your environment). It failed.
Question: In the Job Sequencer that you ran this script on - what specific stage did you use? Is there any parameters for this script you are attempting to pass to this script?
I would assume that you are using ExecuteCommand stage, and that you have the command "env" on the first textbox, and "> /usr/users/dsadm/output.txt" on the second textbox. Did this work?
-T.J.
Developer of DataStage Parallel Engine (Orchestrate).
Re: Executing a command line program in Job Sequencing
Yes u are right this what exactly i am doing and to be more specific here is the error.Teej wrote:Okay, this is the reverse on what I assumed occured here. In summary:
You have a "BTEQ.sh" script. I know your actual name for that script may be different, but for now, lets assume it is called "BTEQ.sh".
You ran this script via your command line, which uses a specific shell (lets say "Korn Shell"). It worked.
You ran this script via DataStage, which uses the same shell (this is why Ken Bland asked you to show your environment). It failed.
Question: In the Job Sequencer that you ran this script on - what specific stage did you use? Is there any parameters for this script you are attempting to pass to this script?
I would assume that you are using ExecuteCommand stage, and that you have the command "env" on the first textbox, and "> /usr/users/dsadm/output.txt" on the second textbox. Did this work?
-T.J.
/home/apps/z628945/perltest.pl
Reply=137
Output from command ====>
/usr/lib/pa20_64/dld.sl: '/apps/opt/ascential/Ascential/DataStage/DSEngine/java/jre/lib/PA_RISC/hotspot/libjvm.sl' is not a valid load module: Bad magic number
SH: 4113 Killed
Yeah u r rite intially that was the problem when i fully qualify the path it worked fine for any shell command.kcbland wrote:Fully qualify your path to the output file and see if that works.
But when i am trying to run a Bteq scripts or perl i have this below error
Code: Select all
home/apps/z628945/perltest.pl
Reply=137
Output from command ====>
/usr/lib/pa20_64/dld.sl: '/apps/opt/ascential/Ascential/DataStage/DSEngine/java/jre/lib/PA_RISC/hotspot/libjvm.sl' is not a valid load module: Bad magic number
SH: 4113 Killed