× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



It sounds like you want to call RPG programs from Java. You don't need to know how to program the RPG to do this, just what the parameters are - here is something from a white paper on this:
==================================================
Program Calls


The IBM Toolbox for Java ProgramCall class uses the host server ProgramCall driver to call any iSeries program object. This is an easy way to access existing programs. For relatively long-running programs, such as print routines or batch processing, use the ProgramCall class. However, because this call is relatively expensive (from a system resource point of view) as compared to an RPG-to-RPG program call, the ProgramCall class should not be used for frequently called small programs.

Java Native Interface (JNI)

JNI is a low-level, platform-independent, architected interface that initially worked only for ILE/C and ILE/C++. At V4R4, the RPG and COBOL runtimes were made thread-safe, which now allows JNI-to-RPG and JNI-to-COBOL procedures in service programs as well. In V5R1, RPG has added enhancements to make it easier to use JNI. The JVM uses JNI to define native methods that complete the implementation of the JVM. (We do not expect application writers to make heavy use of JNI.) Native programs can be accessed by first defining a native method in Java and then by using the JNI functions. When calling a native method in Java, the program is running on a Java thread. Therefore, the developer must be aware of the thread-safe features of the programming language and system APIs that the existing application is using. All the service program procedures that are called, as well as all the code that is called by those procedures, must also be thread-safe ? this includes CL commands. (For more detail on using JNI with RPG and COBOL, reference the online guides mentioned at the end of this document for tips and restrictions).

Java APIs

The Java API for calling another program is runtime.exec(). This will start a new job for the called program.
==================================================
There is a JAVA-L mailing list similar to this that could be helpful, also one on RPG. Go to www.midrange.com and poke around.


HTH
Vern

At 02:49 PM 9/8/2004, you wrote:
-----Original Message-----
From: wdsci-l-bounces@xxxxxxxxxxxx
[mailto:wdsci-l-bounces@xxxxxxxxxxxx]On Behalf Of Mike Troxclaire
Sent: Wednesday, September 08, 2004 1:59 PM
To: wdsci-l@xxxxxxxxxxxx
Subject: [WDSCI-L] (no subject)

Hello,

Sorry to contact you this way but I am stuck with a problem and was
wondering if you guys may be able to point me in the right direction. I am a
Java programmer and I am trying to learn RPG so that I can call RPG
modules/applications from my Java classes. I am a novice to "green screen"
and have never dealt with it but I understand that to do what I want to do I
can do it using WDSC/CODE/400/VisualAge RPG. I have all these wonderful
tools at my disposal but I do not know where to start as I have never
programmed in RPG before. I would be extremely thankful for any advice that
you may have for me. Thanks again.

Thanks,

Mike.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.