If you're good with JNI, you can load the service program like you would a unix lib or windows dll and call the routine directly.
As you suggest, you can also call the routine from CL. Bind the CL program to the service program and use CALLPRC in your CL to get to the C function.
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Tomer Sason
Sent: Thursday, December 29, 2011 1:03 AM
To: Java Programming on and around the IBM i
Subject: RE: FW: Using PCML from Java to Call C/400 Program
Hi everybody,
Thanks for your responses.
I am Java programmer and I don't know how to invoke the C routine inside a service program.
Do you think one can warp the C program with CL program, so I can call the CL program instead of the C program?
(The C program is used by other applications, so I can't make any change on it).
Regards,
Tomer S.
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of David Gibbs
Sent: Wednesday, December 28, 2011 5:15 PM
To: Java Programming on and around the IBM i
Subject: Re: FW: Using PCML from Java to Call C/400 Program
On 12/28/2011 8:34 AM, Joe Pluta wrote:
Even more problematic is that AFAIK C parameters are not
bidirectional.
Isn't argv is an array of pointers ... so they are, by definition, bidirectional ... if you pass in pointer parameter ... and change the contents of that memory ... the values are changed.
And, I think, PCML passes everything by reference.
Hmm ... maybe it would be better to invoke the C routine inside a service program ... so that the QZRUCLSP api will be used?
Back in the day at SSA we had to create our own parameter passing
technique. It used a stream file to pass parameters between the two
programs.
I don't think the same remote program invocation mechanism existed back then.
Ugh. The flashbacks! THE FLASHBACKS!!!!!
Aaarrrgggg! PSSD! Post SSA Stress Disorder ... I suffer from it too.
<grin/>
david
--
IBM i on Power -- For when you can't afford to be out of business.
--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/java400-l.
--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at
http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.