|
public static boolean submitBatchJob(String strProg, List strParms) {
boolean isSuccess = false;
try {
AS400 iSeries = new AS400(serverIP, userName, userPassword);
CommandCall ccNewCmd = new CommandCall(iSeries);
String strCmd = new String("CALL PGM(COLO/" + strProg + ") PARM(");
for (int i=0; i < strParms.size(); i++) {
String strParm = (String)strParms.get(i);
strCmd += "'" + strParm + "'";
if (i != strParms.size() - 1) {
strCmd += " ";
}
}
strCmd += ")";
//Modify Job Library List. Not sure what to do here.
Job cmdJob = ccNewCmd.getServerJob();
isSuccess = ccNewCmd.run(strCmd);
AS400Message[] messageList = ccNewCmd.getMessageList();
cmdMessages = new ArrayList();
for (int i=0; i < messageList.length; i++) {
cmdMessages.add(messageList[i].getText());
}
iSeries.disconnectAllServices();
} catch (Exception e) {
cmdMessages.add(e.getMessage());
}
return isSuccess;
}
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.