JobList

You can use JobList class to list AS/400 jobs. With the JobList class, you can retrieve the following:

Use the getJobs() method to return a list of AS/400 jobs A triangle that signals the beginning of new information for this releaseor getLength() method to return the number of jobs retrieved with the last getJobs(). An upsidedown triangle that signals the end of the new information for this release

The following example lists all active jobs on the system:

                       // Create an AS400 object. List the
                       // jobs on this AS/400.
     AS400 sys = new AS400("mySystem.myCompany.com");

                       // Create the job list object.
     JobList jobList = new JobList(sys);

                       // Get the list of active jobs.
     Enumeration list = jobList.getJobs();

                       // For each active job on the system
                       // print job information.
     while (list.hasMoreElements())
     {
         Job j = (Job) list.nextElement();

         System.out.println(j.getName() + "." +
                            j.getUser() + "." +
                            j.getNumber());
     }


[ Legal | AS/400 Glossary ]