midrange.com code scratchpad
Name:
Example PCML call
Scriptlanguage:
Java
Tabwidth:
4
Date:
09/25/2018 08:15:53 pm
IP:
Logged
Description:
The user was to lazy to give a description
Code:
  1. import com.ibm.as400.access.AS400;
  2. import com.ibm.as400.data.PcmlException;
  3. import com.ibm.as400.data.ProgramCallDocument;
  4.  
  5. public class PcmlExample {
  6.  
  7.     public static void main(String[] args) {
  8.         AS400 as400;
  9.         ProgramCallDocument pcd;
  10.         String path = "/QSYS.LIB/MYLIB.LIB/MYSRVPGM.SRVPGM";
  11.         as400 = new AS400 ();
  12.         try {
  13.             pcd = new ProgramCallDocument (as400, "myModule");
  14.             pcd.setPath ("MYFUNCTION", path);
  15.             pcd.setValue ("MYFUNCTION.PARM1", "abc");
  16.             boolean rc = pcd.callProgram("MYFUNCTION");
  17.             System.out.println("rc = " + rc);
  18.         } catch (PcmlException e) {
  19.             e.printStackTrace();
  20.         }
  21.     }
  22.  
  23. }
  24.  
© 2004-2019 by midrange.com generated in 0.006s valid xhtml & css