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



Hi All,

I am attempting this for the first time and ran into problems . As long a 
Struct is not involved, i am able to pass and receive parameters, but when i 
try to pass a structure to the RPG program, I get an error saying 
Caught PcmlException Exception :: com.ibm.as400.data.PcmlException: The number 
of indices required is 1. The number of indices specified is 0. Processing 
<data> element 'WISWRP02.selectedbol'. com.ibm.as400.data.PcmlException: The 
number of indices required is 1. The number of indices specified is 0. 
Processing <data> element 'WISWRP02.selectedbol'. at 
com.ibm.as400.data.PcmlData.setValue(PcmlData.java:480) at 
com.ibm.as400.data.PcmlDocument.setValue(PcmlDocument.java:582) at 
com.ibm.as400.data.PcmlDocument.setValue(PcmlDocument.java:574) at 
com.ibm.as400.data.ProgramCallDocument.setValue(ProgramCallDocument.java:1095) 
at CallRPGwiswrp02.main(CallRPGwiswrp02.java:64) 

Please let me know where i am going wrong.

Thanks in Advance
Jaywanth


Here's my Java code
===============
 AS400 sys = new AS400("1.1.1.1","","");

  AS400DataType[] myStruct = { new AS400Text(7), new AS400Text(10)};
  
  ProgramCallDocument pcml;
  try
  {
   
   pcml = new ProgramCallDocument(sys, "wiswrp02.pcml");
  
    Object[] inData = { "1132865", "          "};
   
   AS400Structure myConverter = new AS400Structure(myStruct);
   byte[] input = myConverter.toBytes(inData);
   
   pcml.setValue("WISWRP02.custname","ABC LTD.");
   pcml.setValue("WISWRP02.selectedcount","1"); 
   pcml.setValue("WISWRP02.selectedbol",input);
   pcml.setValue("WISWRP02.message","");




Here's my PCML
==============
<pcml version="1.0">
 <struct name="bollist">
  <data name="recid" type="char" length="7" />
  <data name="storagedate" type="char" length="10" />  
 </struct>
 
 <struct name="paysummary">
  <data name="bolno" type="char" length="10" />
  <data name="chargeamt" type="char" length="15" />
  <data name="recid" type="char" length="7" />
  <data name="shiprepdate" type="char" length="10" />
  <data name="storagetodate" type="char" length="10" /> 
 </struct>

 <struct name="paydetail">
  <data name="recid" type="char" length="7" />
  <data name="chargedescription" type="char" length="20" />
  <data name="valueofcharge" type="char" length="15" />
 </struct>

 
 <program name="WISWRP02" path="/QSYS.LIB/QGPL.LIB/WISWRP02.PGM">
  <data name="custname" type="char" length="40" usage="inputoutput"/>    
  <data name="selectedbol" type="struct" struct="bollist" usage="inputoutput"
   count="selectedcount"/> 
  <data name="selectedcount" type="int" length="2" usage="inputoutput"/>    
  <data name="message" type="char" length="90" usage="inputoutput"/>    
  <data name="paymentsummary" type="struct" struct="paysummary" 
usage="inputoutput"/> 
  <data name="paymentdetails" type="struct" struct="paydetail" 
usage="inputoutput"/> 
  <data name="dtlrecordcount" type="int" length="2" usage="inputoutput"/>    
  <data name="totalcharge" type="char" length="15" usage="inputoutput"/>    
   </program>
</pcml>

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.