× 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.



Hello everybody,

I don't understand my problem!
I wrote a JAVA program using the ProgramCall class and calls a simple
RPG program that fills the input/output parameter (table of 30
characters) with "Coucou" and write once in a file of the AS400

My program looks like any program using a program call.

When I execute my JAVA program, it seems to be blocked when the method
run is executed
if(pgm.run()!=true)
The parameter passed by reference was not modified and the file on the
AS400 is empty.  Moreover, i can't see the job in the jobs list.

Please can you help me?
Thanks

import com.ibm.as400.access.*;
import com.ibm.as400.vaccess.*;

public class rpg_program_call{
    public static void main(String [] args){

    /* Init AS400 Connection */
        AS400 system=new AS400("hsotname","user","password");
        ProgramParameter [] param = new ProgramParameter[1];

        try{
        /* Data */
        byte [] bytes=new byte[30];

        param[0]=new ProgramParameter(bytes);
        param[0].setParameterType(ProgramParameter.PASS_BY_REFERENCE);

     /* Init Program Call */
        ProgramCall pgm = new
ProgramCall(system,"/QSYS.LIB/MYLIB.LIB/TEST.PGM",param);
        if(!system.isConnected(AS400.COMMAND)){
            system.connectService(AS400.COMMAND);
        }

     /* Beginning */
          if(pgm.run()!=true){
               /* Failed */
               System.out.println("Failed");
               AS400Message [] msgList=pgm.getMessageList();
               for(int i=0;i<msgList.length;i++){
                  System.out.println(i+":"+msgList[i].getText());
               }
          }
          else{
             /* Congratulations */
               System.out.println("Successful");

          }
        }catch(Exception e){
               System.out.println(e.getMessage());
               }
        system.disconnectService(AS400.COMMAND);
     }
}



_____________________________________________________________
Etudiant: Wanadoo t'offre le Pack eXtense Haut Débit soit 150,92 euros 
d'économies !
Et pour 1 euro de plus, reçois le CD-ROM du jeu Dark Age of Camelot
+ 1 mois de jeu en réseau offert !
Clique ici : http://www.ifrance.com/_reloc/mail.etudiant




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-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.