Page 1 of 1

Invocation of DS Job of Sequence from Java

Posted: Wed Apr 25, 2007 8:23 am
by Amit Jaiswal
Hi All,

In the existing requirement, we are using Java adapters to fetch the file using different protocols and store it on ETL server. Java is also used to do some intermediate stuff like scheduling, etc.
Just wanted to know if it is possible to invoke DS Job or Sequence directly from Java. Presently we are using Java Adapter to execute unix script which in tern is executing DS jobs. We want to avoid calling unix script in between.
Thanks in advance.

Amit

Posted: Wed Apr 25, 2007 8:26 am
by DSguru2B
If your java adapters can execute scripts it can definately execute datastage jobs. But its better to have a wrapper script to check for return codes, do other household work as well. But to answer your quest, yes it can.

Posted: Wed Apr 25, 2007 10:17 am
by sud
DSguru2B wrote:If your java adapters can execute scripts it can definately execute datastage jobs. But its better to have a wrapper script to check for return codes, do other household work as well. But to answer your quest, yes it can.
I think he is asking for the contrary ... how to invoke datastage job without executing shell scripts ... i.e., directly from java.

Well, there are datastage APIs for doing that, but those are C APIs which can be interfaced with java. The only other way out which I know of is to have SOA edition and publish your jobs as web services and invoke the web services from java.

Posted: Wed Apr 25, 2007 11:25 am
by DSguru2B
Thats what I told him, yes it is possible. Just pass the dsjob command from the java module and it will fire the job off.

Re: Invocation of DS Job of Sequence from Java

Posted: Wed Apr 25, 2007 12:30 pm
by sud
Amit Jaiswal wrote: ... Presently we are using Java Adapter to execute unix script which in tern is executing DS jobs. We want to avoid calling unix script in between.
Thanks in advance.

Amit
i think that's what Amit is already doing, and doesn't want to do that way, i.e., thru the scripts. He wants to invoke without calling any scripts from java ... or, in other words, he needs a java API to achieve this. :roll:

Posted: Wed Apr 25, 2007 3:39 pm
by DSguru2B
Lets wait for him to come back and clear our understanding.

Posted: Thu Apr 26, 2007 8:16 am
by Amit Jaiswal
Hi,

I don't want to use shell script or perl script to invoke my datastage job. I want to invoke it only through JAVA. Is it possible to achieve it? If its possible in Datastage SOA Edn what is the method?
Thanks in advance.
-Amit

Posted: Thu Apr 26, 2007 8:27 am
by chulett
Can you 'invoke' a command line O/S function via JAVA? Then just call dsjob directly without any scripting wrapper. Or check the Command Line Interface section of the Server Job Developer's Guide, the APIs that dsjob leverages are documented there.

Posted: Thu Apr 26, 2007 12:56 pm
by sud
chulett wrote:Can you 'invoke' a command line O/S function via JAVA? Then just call dsjob directly without any scripting wrapper. Or check the Command Line Interface section of the Server Job Developer's Guide, the APIs that dsjob leverages are documented there.
I don't think you can do without making a system call ... and that is exactly what he is trying to avoid. But, there is the dsapi.h which is for C but I am sure JAVA can call C functions(JNI).