Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

How to use PCML in JAVA?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Guest's Avatar
    Guest replied
    How to use PCML in JAVA?

    wanted to know about, how to send some commands to java server -(java server specify ip,port of AS400) through java client programe

    Leave a comment:


  • hlw400@yahoo.com
    replied
    How to use PCML in JAVA?

    I am new to PCML. Is there any book about it? I have searched amazon.com and IBM on-line library but could not hit any. By the way, is there someone who would kindly give me an example of JAVA program that using PCML? Thanks in advance Henry

    Leave a comment:


  • yoshir99
    replied
    How to use PCML in JAVA?

    Hi Is it possible to use PCML to return as result set or record set or an array that would represent a result set. And how would I go about doing it

    Leave a comment:


  • Guest's Avatar
    Guest replied
    How to use PCML in JAVA?

    I was wondering if I can get your email address to get your expertise on RPG/Java/PCML?

    Leave a comment:


  • hlw400@yahoo.com
    replied
    How to use PCML in JAVA?

    Thank you very much, David. I am trying to pass data between JSP and RPG/COBOL programs. Basically, I donot want to use Java to recode existing RPG/COBOL programs. I am using either Java program call or stored procedures now.

    Leave a comment:


  • Guest's Avatar
    Guest started a topic How to use PCML in JAVA?

    How to use PCML in JAVA?

    Henry, Here is a simple example to get you started. What are you trying to accomplish?
           /** * Program Call Example * @author: David Morris */ package pcml; import com.ibm.as400.data.ProgramCallDocument; import com.ibm.as400.data.PcmlException; import com.ibm.as400.access.AS400; import com.ibm.as400.access.AS400Message; import com.ibm.math.BigDecimal; public class ProgramCallExample { public ProgramCallExample() { } public static void main(String[] argv) { AS400 as400System; ProgramCallDocument pcd; boolean rc = false; String msgId; String msgText; String command = new String("dspjob output(*print)"); BigDecimal length = new BigDecimal(command.length()); System.setErr(System.out); as400System = new AS400(); try { // Remove comment on following line for more logging // com.ibm.as400.data.PcmlMessageLog.setTraceEnabled(  true); pcd = new ProgramCallDocument(as400System, "qcmdexc"); // Set parameter values pcd.setValue("qcmdexc.command", command); pcd.setValue("qcmdexc.length", length); // Call program rc = pcd.callProgram("qcmdexc"); // If error on call return messages if (rc == false) { AS400Message[] msgs = pcd.getMessageList("qcmdexc"); for (int m = 0; m < msgs.length; m++) { msgId = msgs[m].getID(); msgText = msgs[m].getText(); System.out.println(msgId + " - " + msgText); } System.out.println("Error on call to QCMDEXC"); System.exit(0); } } catch (PcmlException e) { System.out.println(e.getLocalizedMessage()); e.printStackTrace(); System.out.println("Unexpected error on call to QCMDEXC"); System.exit(0); } System.exit(0); } }
    David Morris
Working...
X