Invoke Java Class from Dstage

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
Corvus
Participant
Posts: 10
Joined: Sat Apr 04, 2009 6:39 am

Invoke Java Class from Dstage

Post by Corvus »

Hi,

Could anyone please let me know on how to invoke a Java class from Datastage.

The requirement is to invoke a java class and use its properties from Datastage and then propagate the records in the form of XML.

Amy help on this will be very helpful
miwinter
Participant
Posts: 396
Joined: Thu Jun 22, 2006 7:00 am
Location: England, UK

Post by miwinter »

Could this not be uncomplicated somehow, perhaps by using whatever scheduling you may use to call the Java component first, then trigger the Datastage process after the XML is produced?

Furthermore, what exactly does "use its properties from Datastage" mean?

One option might be to employ a before job sub-routine.

PS. Sorry I'm not Amy :wink:
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

To do this inside a DataStage job, you'd need to purchase the Java PACK as far as I know, which would give you a "Java Transformer".
-craig

"You can never have too many knives" -- Logan Nine Fingers
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

Set the classpath,Set the JVM. Its quiet simple.
If you have worked in java then it would be pretty fast.

Regards
Sreeni
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

JavaPack makes it a lot more elegant, as you can directly interact on a row by row basis with your class. I have a more detailed entry on the subject in my blog below, but basically, DataStage gives control to your class when it (DataStage) needs a row (if your java stage is a source) or when it (DataStage) is ready to give you a row (if your java stage is a target). Your java class, then, is provided with a set of API calls that it can make "back" to the DataStage engine to inspect things or ultimately just write a row to a link, or receive data from a link. It's easy to do if you are comfortable with java and is by far the easiest way to "extend" DataStage functionality. There is source code at that blog entry.

...and it's "in the box" with DataStage nowadays (no cost).

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Ah... can't seem to remember what all is "in the box" any more. :(
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply