• Subject: Call RPG from Java using ToolBox - run on PC and fail on AS400
  • From: "Bruce Jin" <brucej@xxxxxxxxxxxxxxxxxxxx>
  • Date: Wed, 17 Jan 2001 15:36:15 -0600


I wrote a simple java program to call a simple RPG program. The RPG program
is called TEST1 and it has no *ENTRY PLIST in it.  The code is listed below.
The java class runs OK on PC (it prompts system, name user, password). The
RPG is called correctly. The output on the VAJ console is like this:

AS400 obj created...
pgm.run() = true
Call completed.

When I copied this class to AS400 and run it in Qshell, the class ran but
the call failed and I get the following output:

> java CallRPG2
   AS400 obj created...
   error=java.lang.NullPointerException: parameterList
   Call completed.

Any ideas?
TIA. Bruce

import com.ibm.as400.access.*;

class CallRPG2 {

    public static void main(java.lang.String[] args) {

   boolean pgmrun;

   AS400 as400 = new AS400();
   System.out.println("AS400 obj created..." );

   ProgramCall pgm = new ProgramCall(as400);
     pgm.setProgram(QSYSObjectPathName.toPath("BRUCELIB", "TEST1",
     pgmrun = pgm.run();
     System.out.println("pgm.run() = " + pgmrun);
     if (pgmrun != true)  {
      AS400Message[] msgList = pgm.getMessageList();
        for (int i=0; i<msgList.length; i++)

 } catch (Exception e) {
  System.out.println("error=" + e);

 System.out.println("Call completed." );


| This is the JAVA/400 Mailing List!
| To submit a new message, send your mail to JAVA400-L@midrange.com.
| To subscribe to this list send email to JAVA400-L-SUB@midrange.com.
| To unsubscribe from this list send email to JAVA400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner: joe@zappie.net

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2022 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.