Whenver I do a ProgramCall object and pass parameters, the Java program
just hangs on the run() method. There is nothing to tie up the program it
is trying to run. In fact, here is the CL *PGM it is trying to run:

PGM PARM(&ROLE)
/* Variable declaration */
DCL VAR(&ROLE) TYPE(*CHAR) STG(*AUTO) LEN(10)

RTVRSFDFT SYNCROLE(&ROLE)

ENDPGM

HERE is the Java program.

import java.io.*;
import com.ibm.as400.access.*;

// How to compile and run:
// javac -cp :/QIBM/ProdData/OS400/jt400/lib/jt400Native.jar RSFRole.java
// java -cp :/QIBM/ProdData/OS400/jt400/lib/jt400Native.jar RSFRole
//
public class RSFRole {
public static void main(String args[])
{
byte initial_value = 0;
AS400 system = new AS400("localhost");
AS400Text nametext = new AS400Text(8);

ProgramCall pgm = new ProgramCall(system);
ProgramParameter[] parameterList = new ProgramParameter[1];
parameterList[0] = new ProgramParameter(10);
try {
if (pgm.run("/QSYS.LIB/BEAK.LIB/RSFROLE.PGM", parameterList) !=
true) {
System.err.println("barf.");
// Show the messages (returned whether or not there was an
error.)
AS400Message[] messagelist = pgm.getMessageList();
for (int i = 0; i < messagelist.length; ++i) {
// Show each message.
System.out.println(messagelist[i].getText());
}
}
else {
AS400Text text = new AS400Text(10);

System.out.println(text.toObject(parameterList[0].getOutputData()));
}
}
catch (Exception e) {
System.err.println("barf.");
e.printStackTrace();
}
}
}



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 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.