|
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:
try
{
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 (pgm.run() != 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);
}
}else{
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: " + ???????);
sistem.disconnectService(AS400.COMMAND);
}
So , how do I define this Array fields in JAVA and how I get value from RPG?
Thanks in advanced.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.