Trigger DataStage Job through PeopleSoft Process Scheduler

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

sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Trigger DataStage Job through PeopleSoft Process Scheduler

Post by sri75 »

Hello, We are trying to trigger ETL job through PeopleSoft Process Scheduler and here is the situation:

Datastage and PeopleSoft both are on UNIX box and they are on same box.

here is the shell script code we gave and name of the shell script file is test.ksh:

#!/bin/ksh
echo "DATE and Time Is:"
date
echo "Hello"
dsjob -run -jobstatus Project Name Job Name
echo "DATE and Time Is:"
date
echo "Hello1"

when we execute the above shell script, it displays the date and time correctly, but some how it doesnt execute the dsjob command.

My question: Can we execute the dsjob command from process scheduler?

Please let me know if you need more information.

Thanks a lot,
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I would start with adding "-MODE NORMAL" to the command line. But how about printing out stderr in your script as well?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Post your actual script - that can't be it. 'Project Name'? 'Job Name'?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Post by sri75 »

chulett wrote:Post your actual script - that can't be it. 'Project Name'? 'Job Name'?
we have added some debug statements in the script.. here is the modiefied program

Code: Select all

dsjob -run -jobstatus -wait  HCM89_EPM90DEV SEQ_J_Stage_PS_ABS_CLASS_TBL
RETURN_VALUE=$?
echo "Return Value $RETURN_VALUE"

we are getting output as:
dsjob -run -jobstatus -wait   
Return Value 127
what does Return Value 127 mean?
mikegohl
Premium Member
Premium Member
Posts: 97
Joined: Fri Jun 13, 2003 12:50 pm
Location: Chicago
Contact:

Post by mikegohl »

I did this before. I created an Application Engine Program with a run control page.
Michael Gohl
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Post by sri75 »

mikegohl wrote:I did this before. I created an Application Engine Program with a run control page.
Did it work for you?

I am doing the same thing..created an Application Engine Program with a run control page... but it doesn't work..

I am getting return value as 127
mikegohl
Premium Member
Premium Member
Posts: 97
Joined: Fri Jun 13, 2003 12:50 pm
Location: Chicago
Contact:

Post by mikegohl »

Yes it did work. I called DSJOB directly from the Application Engine Program. I also used a run control table to store the parms, project and job name. The app engine parsed the parms and formatted the dsrun job command. I did not use a script.
Michael Gohl
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Post by sri75 »

mikegohl wrote:Yes it did work. I called DSJOB directly from the Application Engine Program. I also used a run control table to store the parms, project and job name. The app engine parsed the parms and formatted the dsrun job command. I did not use a script.
Great!!

Here is the code which I am using in the app engine

Code: Select all

&scriptFile = "/apps/home/prgmteam/hrepm/scripts/customjob.ksh";
&ExitCode = Exec("sh -c " | &scriptFile, %Exec_Synchronous + %FilePath_Absolute);
Can you tell me if I am missing some thing?

Thank you,
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Post by sri75 »

mikegohl wrote:Yes it did work. I called DSJOB directly from the Application Engine Program. I also used a run control table to store the parms, project and job name. The app engine parsed the parms and formatted the dsrun job command. I did not use a script.
Can you send me your code?

Thanks a lot!!
mikegohl
Premium Member
Premium Member
Posts: 97
Joined: Fri Jun 13, 2003 12:50 pm
Location: Chicago
Contact:

Post by mikegohl »

No, I can not send you my code.
Michael Gohl
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Post by sri75 »

mikegohl wrote:No, I can not send you my code.
I mean to say syntax..
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It's your script, not the 'application engine' stuff I would wager. And you completely ignored this from Arnd:
ArndW wrote:I would start with adding "-MODE NORMAL" to the command line. But how about printing out stderr in your script as well?
-craig

"You can never have too many knives" -- Logan Nine Fingers
sri75
Premium Member
Premium Member
Posts: 132
Joined: Thu Sep 09, 2004 12:42 pm

Post by sri75 »

chulett wrote:It's your script, not the 'application engine' stuff I would wager. And you completely ignored this from Arnd:
ArndW wrote:I would start with adding "-MODE NORMAL" to the command line. But how about printing out stderr in your script as well?

Code: Select all

dsjob -run -mode NORMAL -jobstatus -wait  HCM89_EPM90DEV SEQ_J_Stage_PS_ABS_CLASS_TBL 
RETURN_VALUE=$? 
echo "Return Value $RETURN_VALUE" 

we are getting output as: 
dsjob -run -jobstatus -wait    
Return Value 127
Let me explain the problem once again..

we have copied the command(dsjob -run -jobstatus -wait HCM89_EPM90DEV SEQ_J_Stage_PS_ABS_CLASS_TBL) in to shell script. Name of the shell script is customjob.sh...
When we execute the customjob.sh shell script from UNIX command prompt, job is getting started, but when we call the same shell script through app engine it doesn't execute the command (dsjob -run -jobstatus -wait HCM89_EPM90DEV SEQ_J_Stage_PS_ABS_CLASS_TBL) .
Also, FYI- App engine is able to execute other commands in the shell script, but it doesnt execute the dsjob command.

its ending up with error code/return value 127..
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I understand all that. Here is the fly in the ointment:
When we execute the customjob.sh shell script from UNIX command prompt, job is getting started
That only tells you that the script is syntactically correct, not that it is appropriate for running under any kind of a scheduler's environment. You are making assumptions that the environment would be identical to you as the user have from the command line, and generally they ain't.

I would suggest that you add more than just the 'dsjob' command into your script - something to ensure the environment is properly prepared. That means, at the very least, a check for $DSHOME and a 'sourcing' of your dsenv file so that everything (environment variables, paths, shared libraries, etc) is ready for the dsjob command. Then I'd wager it will work fine.

And without you adding any kind of capture of stderr as Arnd suggested, you really have no idea what's going wrong with your script when it executes thru the PS Secheduler.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

add "-mode NORMAL" to your command.
Post Reply