|
From: java400-l-request@xxxxxxxxxxxx
Subject: JAVA400-L Digest, Vol 9, Issue 20
To: java400-l@xxxxxxxxxxxx
Date: Tue, 15 Feb 2011 12:00:08 -0600
Send JAVA400-L mailing list submissions to
java400-l@xxxxxxxxxxxx
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.midrange.com/mailman/listinfo/java400-l
or, via email, send a message with subject or body 'help' to
java400-l-request@xxxxxxxxxxxx
You can reach the person managing the list at
java400-l-owner@xxxxxxxxxxxx
When replying, please edit your Subject line so it is more specific
than "Re: Contents of JAVA400-L digest..."
Today's Topics:
1. RE: How i use a AS400Array class? (Clapham, Paul)
2. How i use a AS400Array class? (Jason Abreu)
----------------------------------------------------------------------
message: 1
date: Mon, 14 Feb 2011 11:54:33 -0800
from: "Clapham, Paul" <pclapham@xxxxxxxxxxxxx>
subject: RE: How i use a AS400Array class?
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.
PC2
-----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:
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.
--
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,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.
------------------------------
message: 2
date: Tue, 15 Feb 2011 09:01:47 -0500
from: Jason Abreu <jason.abreu@xxxxxxxxxxxxxxxxxxxx>
subject: How i use a AS400Array class?
Why are you using so many AS400Arrays to begin with?
You are creating many different AS400Arrays with a length of 50, but
only ever populating the first element.
Does your RPG program expect 50 occurrences of every parameter you're
calling it with?
Jason Abreu
Abreu Innovations, Inc.
jason.abreu@xxxxxxxxxxxxxxxxxxxx
http://www.abreuinnovations.com/
On 2/14/2011 4:55 AM, marior wrote:
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.
------------------------------
--
This is the Java Programming on and around the IBM i (JAVA400-L) digest list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/java400-l.
End of JAVA400-L Digest, Vol 9, Issue 20
****************************************
As an Amazon Associate we earn from qualifying purchases.
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.