PMS Information Systems
Welcome to PMS Information Systems - IBM i (AS/400) Forum !!!

Get Answers for all your queries on IBM i (AS/400).

Wanted to retain the spool file and remove the Job from the system after the jobs ends. How???

Go down

Wanted to retain the spool file and remove the Job from the system after the jobs ends. How???

Post  maran on Thu Jun 13, 2013 12:44 am

Firstly the life cycle of the job.   Jobs go through three main states:

- In JOBQ: the job is queued for processing before execution
- ACTIVE: This is the actual execution phase
- OUTQ: finished executing, but are always connected to the spool job.

The concern is that the jobs are managed in one or more tables (meaning "table", is not SQL table). Per IBM manual  Job tables are internal system objects that are used by the operating system to track all jobs on the system.  The number of entries in  these tables can affect the performance of various operating system IPL steps, commands, and application program interfaces (APIs) that work with jobs. 
Having mentioned that When a job is completed (more spool connected) the item is marked as reusable.

A table is limited to 16MB, so that when a table is full, another is created.

A big disadvantage is that these tables are not really ignore form. So when the system needs to access the list of jobs, it will have to cover all or part of the list. The same when a new job must be created, the system searches for an available position in the table from the beginning.
But as it is not always easy to remove spools (preservation may be important) it is now possible (from V5R2 and V5R4) to "off" spools of their jobs: the spool is retained, but n is no longer connected to a job, thereby freeing up space in the table.
IBM has found that generally most systems have a relatively small number of active jobs but very large numbers of jobs with spooled output. In fact, the number of jobs that have ended with spooled output is often 10 to 100 times the number of active jobs.

Using the QSPLFACN system value and job attribute can be beneficial in keeping down the number of job table entries on the system. If this value is set to *DETACH, when the job ends, the job is removed from the system, and the job table entry is freed. If the value is set to *KEEP (the default), all jobs are kept until their spooled files are all deleted. If running out of job table entries is an issue for you, it is recommended that you set the QSPLFACN (or the job attribute SPLFACN) value to *DETACH.
 For existing spooled files, you can use the Change Job (CHGJOB) command to remove the job without deleting spooled files that you need to keep. Ex CHGJOB JOB (999999/user/job) SPLFACN (* DETACH)
One of the consequences of using *DETACH is that the job log (and other spooled files that the job creates) cannot be found or accessed using the job commands (WRKJOB, CHGJOB, HLDJOB, and so forth). However, with V5R4, there are two methods to find spooled files using the job name:

The WRKJOBLOG command allows users to find both spooled and pending job logs using the job name (including generics). In addition, the WRKJOBLOG allows a date and time range to further subset the list of available job logs. In V6R1, you can use the F13=Delete all key to delete the entire list of job logs that display

Posts : 442
Join date : 2009-07-24

View user profile

Back to top Go down

Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum