|
Thanks for the responses. Setting the QIBM_QSH_CMD_OUTPUT variable and calling calling QSH directly instead of calling JAVA directly worked great. Because I needed to do processing based on the JAVA exit status, I also added the QIBM_QSH_CMD_ESCAPE_MSG='Y' environment variable. Now, I think the behaviour is exactly what I want. I also added the necessary code to save and restore the environment variables I change in my CL program just in case the user had them setting. The other methods suggested don't seem to work. I tried several variations of MONMSG but I don't think the message is actually returned to the calling CL program until after the terminal session has ended. I think the OVRDBF of STDERR and STDOUT may work when calling from RPG but not in my case. Magne Kofoed <magne@xxxxxxxxx> Sent by: To java400-l-bounces Java Programming on and around the @midrange.com iSeries / AS400 <java400-l@xxxxxxxxxxxx> cc 08/30/2005 08:34 AM Subject Re: OUTPUT parameter on JAVA command not valid in CL program Please respond to Java Programming on and around the iSeries / AS400 <java400-l@midran ge.com> Hi, I use QSHELL and add environment variable when I want to skip the qshell output screen. CHGCURDIR DIR('/jar/score') CHGVAR VAR(&JAVA) VALUE('java + -Djava.version=1.4 -classpath + .:/QIBM/ProdData/Java400/jdk14/l+ ib/IBMiSeriesJSSE.jar:jt400.jar:/qibm/prod+ data/java400/jt400ntv.jar + RunAS400Score ' *BCAT &DQ + *BCAT &PNR *BCAT &TYPE) ADDENVVAR ENVVAR('QIBM_QSH_CMD_OUTPUT') VALUE('NONE') MONMSG CPFA980 QSH CMD(&JAVA) RMVENVVAR ENVVAR('QIBM_QSH_CMD_OUTPUT') MONMSG CPF0000 Regards, Magne Date: Tue, 30 Aug 2005 09:05:51 -0400 From: Todd Allen <tballen@xxxxxxxxxx> Add To Address Book Subject: Re: OUTPUT parameter on JAVA command not valid in CL program To: Java Programming on and around the iSeries / AS400 <java400-l@xxxxxxxxxxxx> Monitor for message JVA0122 with a MONMSG command in your CL program. PierceJ@xxxxxxxxxxxxxxxx wrote: > I am trying to call a Java program from a CL program. I am able to > successfully call the Java program, but the shell doesn't go away until the > user hits enter. I want the Java program to behave as if called with the > OUTPUT(* *CONTINUE) parameter on the JAVA call. However, when calling Java > from CL, this parameter is not allowed. I have successfully redirected all > my java i/o using the os400.stdout and os400.stderr properties. I would > rather not have to submit my Java program to batch and then wait in my CL > program using some other means to avoid this behaviour. > > Any ideas? > -- This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/java400-l or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.
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.