World Integration using JTOpen

BJR

Member
I have a need to call a batch process update (J04110Z) from a java program. I am using IBM's JTOpen libraries and am running into problems.

I have tried using JTOpens ProgramCall as well as CommandCall with no success. I can't imagine I am the only person who has attempted such a thing and am sure I am missing something simple.

I have included my joblog and java source (using CommandCall) below and am hoping someone out there can tell me that I have missed something obvious or done something stupid - such comments imply there is a solutions!

Thanks for your time,

Brent


Here is the JOBLOG:
---------------------------------------
CPF1124 Job 042008/QUSER/QZRCSRVS started on 07/29/08 at 13:49:13 in subsystem QUSRWRK in QSYS. Job entered system on 07/29/08 at 13:49:13.
CPD0912 Printer device QPRINT not found.
CPF1301 ACGDTA for 042008/QUSER/QZRCSRVS not journaled; reason 1.
CPD1672 Job changed successfully; however errors occurred.
CPIAD02 User BREED from client 10.50.2.25 connected to server.
CPD0912 Printer device QPRINT not found.
CPD1672 Job changed successfully; however errors occurred.
CPF2110 Library QSYS2924 not found.
CPF5C61 Client request - run program QSYS/QWCRTVCA.
CPF5C61 Client request - run program QSYS/QUSRJOBI.
CPF5C61 Client request - run program QSYS/QWCRTVCA.
CPF5C62 Client request - run command 'CALL '.
CPF1015 Data area X0028 in *LIBL not found.
CPF1015 Data area X0028 in *LIBL not found.
CPF1015 Data area X0028 in *LIBL not found.
JDE9005 Unable to create data area X0028.
CPF1015 Data area X0028 in *LIBL not found.
CPF9801 Object X98FFD1 in library QTEMP not found.
CPF4028 Open of member F0411Z1 was changed to SEQONLY(*NO).
CPC4001 Member F0411Z1 file F0411Z1 in JDFDATA opened.
CPF4123 Open options ignored for shared open of member F0411Z1.
CPD0030 Command R04111Z in library *LIBL not found.
CPF0001 Error found on R04111Z command.
CPF0006 Errors occurred in command.
CPF1015 Data area X0028 in *LIBL not found.
JDE9005 Unable to create data area X0028.
CPF1015 Data area X0028 in *LIBL not found.
CPF1015 Data area X0028 in *LIBL not found.
JDE9005 Unable to create data area X0028.
CPF1015 Data area X0028 in *LIBL not found.
CPF1015 Data area X0028 in *LIBL not found.
JDE9005 Unable to create data area X0028.
CPF1015 Data area X0028 in *LIBL not found.
CPD4090 Printer device QPRINT not found. Output queue changed to QPRINT in library QGPL.
CPD4090 Printer device QPRINT not found. Output queue changed to QPRINT in library QGPL.
CPD4090 Printer device QPRINT not found. Output queue changed to QPRINT in library QGPL.
CPF1015 Data area X0028 in *LIBL not found.
JDE9005 Unable to create data area X0028.
CPF1015 Data area X0028 in *LIBL not found.
CPF1015 Data area X0028 in *LIBL not found.
JDE9005 Unable to create data area X0028.
CPF1015 Data area X0028 in *LIBL not found.
CPF1015 Data area VTTL@ in *LIBL not found.
CPF1015 Data area X0028 in *LIBL not found.
JDE9005 Unable to create data area X0028.
CPF1015 Data area X0028 in *LIBL not found.
CPF1015 Data area VTTL@ in *LIBL not found.
CPC4002 Member F0411Z1 file F0411Z1 in JDFDATA closed.
CPF5C61 Client request - run program QGY/QGYOLJBL.



And here is the complete source for my test application:
---------------------------------------
package com.amxinc.jtopen.test;

import com.ibm.as400.access.AS400;
import com.ibm.as400.access.AS400Message;
import com.ibm.as400.access.CommandCall;
import com.ibm.as400.access.Job;
import com.ibm.as400.access.JobLog;

import org.apache.log4j.ConsoleAppender;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.apache.log4j.PatternLayout;
import org.apache.log4j.spi.RootLogger;

import java.util.Calendar;
import java.util.Enumeration;


public class Test01 {
private static Logger _log;
private static AS400 _system;

public static void main(String[] args) {
_log = RootLogger.getLogger("Test01");
_log.addAppender(new ConsoleAppender(new PatternLayout("%-5p [%t]: %m%n")));
_log.setLevel(Level.ALL);

_log.trace("Sesson start: " + Calendar.getInstance().getTime().toString());

String sys = args[0];
String user = args[1];
String pass = args[2];

_system = new AS400(sys, user, pass);

CommandCall cc = new CommandCall(_system);
MyAS400Listener myListener = new MyAS400Listener();

try {
StringBuilder sb = new StringBuilder(100);
boolean first = true;

_system.setGuiAvailable(false);
_log.debug("AS400 Release: version " + _system.getVersion() + ", release " + _system.getRelease() + ", modification level " + _system.getModification());

cc.setMessageOption(AS400Message.MESSAGE_OPTION_ALL);
cc.addActionCompletedListener(myListener);
cc.addVetoableChangeListener(myListener);

Job job = cc.getServerJob();
JobLog jl = job.getJobLog();

job.setLoggingLevel(1);
job.setLoggingSeverity(0);
job.setLoggingText(Job.LOGGING_TEXT_SECLVL);
job.setLoggingCLPrograms(Job.LOG_CL_PROGRAMS_YES);

_log.debug("Subsystem: " + job.getSubsystem());
_log.debug("JOB INFO => " + cc.getServerJob().toString());

cc.setCommand("CALL PGM(J04110Z) PARM(P04110Z BJR0001)");

if (!cc.run()) {
_log.error("Error: " + cc.getCommand());

for (AS400Message m : cc.getMessageList()) {
_log.trace("\n--------------------Error Messages--------------------");
_log.error(m.getSeverity() + " " + m.getText() + "(" + m.getHelp() + ")");
_log.trace("--------------------Error Messages--------------------\n");
}
}

Enumeration e = jl.getMessages();

while (e.hasMoreElements()) {
sb.append((first ? "" : "\n") + e.nextElement());
first = false;
}

if (sb.toString().contains("Error")) {
_log.trace("\n--------------------Job Log--------------------");
sb.trimToSize();
System.out.println(sb.toString());
_log.trace("--------------------Job Log--------------------\n");
}

} catch (Exception e) {
_log.error(e);
} finally {
_log.trace("\n--------------------Error Messages--------------------");

for (AS400Message msg : cc.getMessageList()) {
_log.error(msg.getSeverity() + " " + msg.getText());
}

_log.trace("--------------------Error Messages--------------------\n");

_system.disconnectAllServices();
}

_log.trace("Call complete, terminating.");
}
}
 
Brent,
I sent you a reply via private message. Please take a look.

Thanks,
rob
 
hello brent
I'm new in this forum and i'm looking for a tip that could resolve my issue that is similar then yours
Actually, I try to call a cobol batch pgm on iSeries from java using com.ibm.connector.as400.ProgramCallBean & PCML. The call failes and I always get the message error as following (joblog):

"CPF1124 Job 042008/QUSER/QZRCSRVS started on 09/16/09 at 13:49:13 in subsystem QUSRWRK in QSYS. Job entered system on 09/16/09 at 17:40:13.
CPD0912 Printer device QPRINT not found.
....
CPD1672 Job changed successfully; however errors occurred.

Nothing happened, the batch is not called !
...
I see that you received an mp from rob (stryder2000) regarding this issue. Did the mp help you ?
If so could you let me know how ?
If not do you have already solved the issue and how ?
It is very helpful to me if you can give me an answer
Many thanks in advance
van
 
Back
Top