|
If you need to wait on the Job's completion, then why don't you call it instead of submitting it? That way, your Java code will wait until the program is finished, and then it will continue processing. If you want to know how to do this, just let me know, and I'll post it. ---------------------------------------------------------------------- Chris DeLashmutt Senior R&D Analyst LeasePlan USA 1165 Sanctuary Pkwy., Alpharetta, GA 30004 Phone: 678-202-8695 Fax: 678-566-8551 ---------------------------------------------------------------------- Ashish Kulkarni <kulkarni_ash1312@y To: java400-l@xxxxxxxxxxxx ahoo.com> cc: Sent by: Subject: Running job in batch from java java400-l-bounces@m idrange.com 10/13/2003 12:05 PM Please respond to Java Programming on and around the iSeries / AS400 Hi I have a job which is submitted on AS400 in batch from java, So I have to write a java class which will submit this job and then wait till the job is over on AS400, This is my code which keeps in loop checking for status // code to call a CL job and get the submitted job number here Job myJob = new Job(as400, jobNumber, jobUser, newJobNum); String jobStatus = myJob.getStatus(); System.out.println("Job status before " + jobStatus); while (!jobStatus.equals("*ACTIVE")) { myJob = new Job(as400, jobNumber, jobUser, newJobNum); jobStatus = myJob.getStatus(); } this job runs for about 5 min, and I think that if I keep on running this loop for 5 min it will consume a lot of server resources, so I want to write a program which will sleep for 1 min before checking the job status. Can anyone provide me some clue or code on how to do it Ashish __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com _______________________________________________ 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.