Trigger DataStage Job through PeopleSoft Process Scheduler
Moderators: chulett, rschirm, roy
Trigger DataStage Job through PeopleSoft Process Scheduler
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,
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,
we have added some debug statements in the script.. here is the modiefied programchulett wrote:Post your actual script - that can't be it. 'Project Name'? 'Job Name'?
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
Great!!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.
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);
Thank you,
Can you send me your code?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.
Thanks a lot!!
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
"You can never have too many knives" -- Logan Nine Fingers
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
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..
I understand all that. Here is the fly in the ointment:
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.
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.When we execute the customjob.sh shell script from UNIX command prompt, job is getting started
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
"You can never have too many knives" -- Logan Nine Fingers