My guess is you've got CCSID conversion issues.

According to the javadocs, the constructor AS400Text(int) is deprecated.
You should use AS400Text(int, AS400). That constructor will use the CCSID
of the AS/400 system you are connected to.

Marshall Dunbar
DPS, Inc.

Ewout N Boter <ewout.boter@xxxxxxxxxx>
Sent by: java400-l-bounces@xxxxxxxxxxxx
09/28/2007 10:19 AM
Please respond to
Java Programming on and around the iSeries / AS400


ProgramParameter does not pass value correctly - revisited

A week ago, I posted the below message. Unfortunately, I did not get a
reply. Today, I picked up this problem again. I have done all kinds of
experiments, but again to no avail. I am afraid I will start the weekend
feeling very frustrated. (I'm in Europe, so it's somewhat later here, and
the weekend is about to start, which should normally make me happy.) I
repeat my previous e-mail, hoping this time someone can provide a

Have a good weekend! (Ok, after all, I think I will enjoy the weekend


I am very confused. I want to call a service program from Java. The Java
code looks like this:

public boolean login() throws LoginException {

ServiceProgramCall sPGMCall = null;
AS400 system = null;
AS400Text txtCnv = new AS400Text(10);

try {
ProgramParameter[] parameterList = new
parameterList[0] = new
system = new AS400(auth_server, user, password);
sPGMCall = new ServiceProgramCall(system);
QSYSObjectPathName fullSrvPgmName = new
QSYSObjectPathName("%LIBL%", "ALSRVWRP", "SRVPGM");
if ( != true) {
AS400Message[] messageList =

I copied this setup (defining an AS400Text object, and using method
toBytes on that object to define the parameter) from numerous pages on the

internet. However, when I do a debug on service program ALSRVWRP, all I
see is gibberish (some ASCII characters way out of the normal range).

What on earth is wrong with this code?


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