Invocation of DS Job of Sequence from Java

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Amit Jaiswal
Premium Member
Premium Member
Posts: 38
Joined: Fri Apr 22, 2005 6:07 am

Invocation of DS Job of Sequence from Java

Post 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
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Post 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.
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post 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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Re: Invocation of DS Job of Sequence from Java

Post 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:
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Lets wait for him to come back and clear our understanding.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Amit Jaiswal
Premium Member
Premium Member
Posts: 38
Joined: Fri Apr 22, 2005 6:07 am

Post 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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
sud
Premium Member
Premium Member
Posts: 366
Joined: Fri Dec 02, 2005 5:00 am
Location: Here I Am

Post 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).
It took me fifteen years to discover I had no talent for ETL, but I couldn't give it up because by that time I was too famous.
Post Reply