Use the following as an example for your program.
////////////////////////////////////////////////////////////////////////////////// // // Example using the IBM Toolbox for Java's access class, CommandCall. // // This source is an example of IBM Toolbox for Java "Job List". // ////////////////////////////////////////////////////////////////////////////////// // // The access classes of IBM Toolbox for Java are in the // com.ibm.as400.access.package. Import this package to use the IBM Toolbox for // Java classes. // ////////////////////////////////////////////////////////////////////////////////// import com.ibm.as400.access.*; public class CmdCall { public static void main(String[] args) { // Like other Java classes, IBM Toolbox for Java classes // throw exceptions when something goes wrong. These must // be caught by programs that use IBM Toolbox for Java. try Note 1 { AS400 system = new AS400(); CommandCall cc = new CommandCall(system); Note 2 cc.run("CRTLIB MYLIB"); Note 3 AS400Message[] ml = cc.getMessageList(); Note 4 for (int i=0; i<ml.length; i++) { System.out.println(ml[i].getText()); Note 5 } } catch (Exception e) { e.printStackTrace(); } System.exit(0); } }