Another method, which we usually discuss as the "better" (I put in quotes to keep other people happy) way instead of calling Java directly from RPG/COBOL, etc. is to use messaging or data queues for communication, whether or not you call the other language program from Java.

Joe Sam

Joe Sam Shirah -
conceptGO - Consulting/Development/Outsourcing
Java Filter Forum:
Just the JDBC FAQs:
Going International?
Que Java400?

----- Original Message ----- From: "James Perkins" <jrperkinsjr@xxxxxxxxx>
To: "Java Programming on and around the iSeries / AS400" <java400-l@xxxxxxxxxxxx>
Sent: Wednesday, October 28, 2009 12:01 PM
Subject: Re: Retrieving integer parameter after JT400 ProgramCall?

I agree with David. Using a ProgramCallDocument just seems easier to me. It
could ALMOST be considered and interface, maybe a better term would be a
defined contract. Plus the ProgramCallDocument.getValue(String) returns an
Object so all you have to do is cast, not create the object from a byte

The one draw back is there is no native date handling.

Here is a simple example.

<pcml version="4.0">
<program name="DELETEORDER" path="/QSYS.LIB/%LIBL%/WVOE01R.PGM">
<data name="INCOMPANYID" type="int" length="4" precision="31"
usage="input" />
<data name="INCUSTOMERID" type="char" length="15" usage="input" />
<data name="INSHIPTO" type="char" length="15" usage="input" />
<data name="INORDERNUMBER" type="int" length="4" precision="31"
usage="inputoutput" />

public boolean deleteOrder(OrderHeader header) {
String module = "DELETEORDER";
try {
ProgramCallDocument pcmlDoc = createPCMLDoc("WVOE01R");
pcmlDoc.setValue(module + ".INCOMPANYID",
pcmlDoc.setValue(module + ".INCUSTOMERID",
pcmlDoc.setValue(module + ".INSHIPTO", header.getShipToId());
.setValue(module + ".INORDERNUMBER", header
return call(pcmlDoc, module);
} catch (PcmlException e) {
"Could not delete the order.", e);
return false;
James R. Perkins

On Wed, Oct 28, 2009 at 07:25, Dan Kimmel <dkimmel@xxxxxxxxxxxxxxx> wrote:

I've been using ProgramCall successfully for years. You have to get the
datatypes right and do the conversions, but once you've got one, all the
rest come pretty easily. And I have some with lots and lots of
parameters going both directions with lots of data types. What do think
is the advantage of PCML? Don't you have to do basically the same thing
in a different format?

-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of David Gibbs
Sent: Wednesday, October 28, 2009 9:06 AM
To: Java Programming on and around the iSeries / AS400
Subject: Re: Retrieving integer parameter after JT400 ProgramCall?

This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives

This thread ...


Return to Archive home page | Return to MIDRANGE.COM home page