Executing a command line program in Job Sequencing

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
vzmz
Participant
Posts: 36
Joined: Sun Nov 23, 2003 12:10 pm
Location: Dallas

Executing a command line program in Job Sequencing

Post by vzmz »

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
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

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.
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
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Re: Executing a command line program in Job Sequencing

Post by Teej »

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
Would you please elaborate a bit more on 'failed'?

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).
vzmz
Participant
Posts: 36
Joined: Sun Nov 23, 2003 12:10 pm
Location: Dallas

Post by vzmz »

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.
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.
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
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Fully qualify your path to the output file and see if that works.
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
vzmz
Participant
Posts: 36
Joined: Sun Nov 23, 2003 12:10 pm
Location: Dallas

Re: Executing a command line program in Job Sequencing

Post by vzmz »

Teej wrote:
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
Would you please elaborate a bit more on 'failed'?

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.
Ok going on with it.
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).
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Re: Executing a command line program in Job Sequencing

Post by Teej »

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.
Developer of DataStage Parallel Engine (Orchestrate).
vzmz
Participant
Posts: 36
Joined: Sun Nov 23, 2003 12:10 pm
Location: Dallas

Re: Executing a command line program in Job Sequencing

Post by vzmz »

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.
Yes u are right this what exactly i am doing and to be more specific here is the error.
/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
vzmz
Participant
Posts: 36
Joined: Sun Nov 23, 2003 12:10 pm
Location: Dallas

Post by vzmz »

kcbland wrote:Fully qualify your path to the output file and see if that works.
Yeah u r rite intially that was the problem when i fully qualify the path it worked fine for any shell command.
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 
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Contact technical support, you're into something funny with the engine binaries.
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
Post Reply