Advertisement

06.22.2008 at 11:08PM PDT, ID: 23506690
[x]
Attachment Details

how to get return array from rpg program ?

Asked by vikasbapat in IBM Websphere Application Server, Programming for iSeries / AS400, Java Application Servers

Hi

I have created a rpg program that returns 2 parameter 1 is the id and another one is list of array, when I called this program I passed two programparameter from my java code  (see the code below) but when i checked what value would be return it is returned only first value of array. how will i get all array values ?

please suggest me regarding this issues I amn't so much aware on java & AS400.


 try
         {
               
          ProgramParameter[] parmList = new ProgramParameter[2];

          AS400Text p1 = new AS400Text(10);
        AS400Text p2 = new AS400Text(30);
         try
          {
                  parmList[0] = new ProgramParameter(10);
                  parmList[1] = new ProgramParameter(30);
                parmList[0].setParameterType(ProgramParameter.PASS_BY_REFERENCE);
                 parmList[1].setParameterType(ProgramParameter.PASS_BY_REFERENCE);
                 
                 parmList[0].setInputData(p1.toBytes("Pune"));
                 parmList[1].setInputData(p2.toBytes(" "));

          }
          catch(Exception ex)
          {
          }
               
               ProgramCall pgm = new ProgramCall(o);
               pgm.setProgram("/QSYS.LIB/XXX/XXX.PGM",parmList);

         if (pgm.run())
          {
                     
               byte s[] =  parmList[1].getOutputData(); // HERE I got only first value of returning array.
             
               parmList[1].getOutputDataLength();
               
                   //String sts = ((String) (new AS400Text(10,o).toBytes(s[0])));
             }
             else
             {
                   AS400Message[] messageList = pgm.getMessageList();
                  for (int msg = 0; msg < messageList.length; msg++) {
                 
                  }
             }
              
                     
              }
         catch(Exception ex)
         {
               AS400Message[] messageList = null;
         }
         finally
             {
               o.disconnectAllServices();
             }
      }Start Free Trial
[+][-]06.23.2008 at 02:14AM PDT, ID: 21844543

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.23.2008 at 03:43AM PDT, ID: 21844881

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.23.2008 at 09:44AM PDT, ID: 21847991

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.23.2008 at 11:00AM PDT, ID: 21848613

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.23.2008 at 11:05PM PDT, ID: 21852819

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.24.2008 at 01:51AM PDT, ID: 21853535

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: IBM Websphere Application Server, Programming for iSeries / AS400, Java Application Servers
Sign Up Now!
Solution Provided By: murphey2
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.08.2008 at 02:09PM PDT, ID: 21958286

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.09.2008 at 04:53AM PDT, ID: 21962493

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]08.29.2008 at 12:15PM PDT, ID: 22348412

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]09.02.2008 at 06:45PM PDT, ID: 22373406

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628