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
ProgramParameter[1];
parameterList[0] = new
ProgramParameter(txtCnv.toBytes(check_program));
AS400.setPasswordExpirationWarningDays(-1);
system = new AS400(auth_server, user, password);
sPGMCall = new ServiceProgramCall(system);
QSYSObjectPathName fullSrvPgmName = new
QSYSObjectPathName("%LIBL%", "ALSRVWRP", "SRVPGM");
sPGMCall.setProgram(fullSrvPgmName.getPath(),
parameterList);
sPGMCall.setProcedureName("AUTHORIZED_PGM_WRP");
sPGMCall.setReturnValueFormat(ServiceProgramCall.RETURN_INTEGER);
if (sPGMCall.run() != true) {
AS400Message[] messageList =
sPGMCall.getMessageList();
[......]
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).
This mailing list archive is Copyright 1997-2026 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.