|
See if the following link helps. http://www-919.ibm.com/developer/java/devkit/rzaham73.htm#HDRRZAHA-UJPI I have to admit I haven't tried invoking a Qshell command with it, but from the documentation, it would seem you could do exactly as your example shows. -----Original Message----- From: java400-l-bounces@midrange.com [mailto:java400-l-bounces@midrange.com] On Behalf Of Urbanek, Marty Sent: Friday, February 07, 2003 6:58 AM To: 'java400-l@midrange.com' Subject: runtime.exec() How do I use runtime.exec() on iSeries? I've read several web articles but I still don't undertand and can't get it to work. Let's say I want to do "ls >mylist.txt". Runtime rt = Runtime.getRuntime(); Process proc = rt.exec("ls >mylist.txt"); int exitVal = proc.waitFor(); System.out.println("Process exitValue: " + exitVal); This prints out an exit value of zero, but the output file is not created and a spool file is created with a CEE0020: Message . . . . : This job is about to end. Cause . . . . . : The job is being terminated because the job is capable of having multiple threads and the application has issued an exit(), abort() or their equivalent APIs, an exception has occurred and is not being handled, or a return from main() has occurred in a program that runs in a *NEW Activation Group. Do I have to tell it to run qshell? I guess what I am asking is whether the commands I submit to exec() have to be CL commands or qshell commands. Thanks, -Marty _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/java400-l or email: JAVA400-L-request@midrange.com 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.