Do you have a problem? If so, it would help if you told us what it was. You know... tell us about error messages if there were any, tell us what happened and what you expected to happen, that sort of thing.


-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of marior
Sent: February 14, 2011 01:55
To: java400-l@xxxxxxxxxxxx
Subject: How i use a AS400Array class?

Hi everyone,

I'm newer in Java, but I have a big doubt, after I call a RPG program with AS400Packeddecimal and AS400Text with successful I try with AS400Array Class and with this I don´t have success.

So as anybody use this class and how?

I let here my example of RPG source:

D pncli s 9 0 dim(50)

D pnome s 40 dim(50)

D pnbalc s 4 0 dim(50)

D pndata s 8 0 dim(50)

D pnhora s 6 0 dim(50)

C *entry plist

C parm pncli

C parm pnome

C parm pnbalc

C parm pndata

C parm pnhora

And my java begin, I thing is wrong definition:



String msgId, msgText;

ProgramParameter[] parmList = new ProgramParameter[5];

String parme1 ="";

AS400PackedDecimal x1=new AS400PackedDecimal(9,0);

AS400Array nume1 =new AS400Array(x1,50);

AS400Text y1=new AS400Text(40);

AS400Array txt1 =new AS400Array(y1,50);

AS400PackedDecimal x2=new AS400PackedDecimal(4,0);

AS400Array nume2 =new AS400Array(x2,50);

AS400PackedDecimal x3=new AS400PackedDecimal(8,0);

AS400Array nume3 =new AS400Array(x3,50);

AS400PackedDecimal x4=new AS400PackedDecimal(6,0);

AS400Array nume4 =new AS400Array(x4,50);

parmList[0] = new ProgramParameter(nume1.toBytes(x1));

parmList[1] = new ProgramParameter( txt1.toBytes(y1));

parmList[2] = new ProgramParameter(nume2.toBytes(x2));

parmList[3] = new ProgramParameter(nume3.toBytes(x3));

parmList[4] = new ProgramParameter(nume4.toBytes(x4));

ProgramCall pgm = new ProgramCall(sistem,"MYLIBRARY","MYPROGRAM.PGM",parmList);

if ( != true) {

AS400Message[] messageList = command.getMessageList();

for (int i = 0; i < messageList.length; i++) {

msgId = messageList[i].getID();

msgText = messageList[i].getText();

System.err.println(msgId + " - " + msgText);



System.out.println("Output Num.Clie: " + ??????);

System.out.println("Output Nome: " + ???????? );

System.out.println("Output Balcao: " + ??????);

System.out.println("Output Data.: " + ????????);

System.out.println("Output Hora: " + ???????);



So , how do I define this Array fields in JAVA and how I get value from RPG?

Thanks in advanced.
This is the Java Programming on and around the IBM i (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at

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-2021 by 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.