Skip to main content

Prestart Jobs and QPRTJOBs

What happens when you generate a spooled file from a prestart job? Where does the output go and is there an easy way to find it?

Dawn May i Can Blog

What happens when you generate a spooled file from a prestart job? Where does the output go and is there an easy way to find it?

When a client connects to a waiting prestart server job, the system swaps to the requesting user profile, which then becomes the job’s current user profile. When the job user profile and the job current user profile are not the same, printed output from that job is associated with a QPRTJOB for the current user profile.

If you generate spooled files under different prestart jobs, all of your spooled output can be found under one QPRTJOB for your user profile. To find the spooled files, simply work with the QPRTJOB for the user profile that generated the output.

When I wrote the blog Watches and Job Log Messages, I created a CL program for my watch program. This program ran in the QSCWCHPS prestart job in subsystem QUSRWRK. I’ll review the output I generated and where that spooled output went.

My program generated three spooled files for review:

1) Displayed the job:

DSPJOB JOB(&JOBNUM/&JOBUSER/&JOBNAME) OUTPUT(*PRINT) OPTION(*ALL)

The QPDSPJOB spooled file was created on output queue QPRINT with my user profile name.

2) Displayed the job log:

DSPJOBLOG JOB(&JOBNUM/&JOBUSER/&JOBNAME) OUTPUT(*PRINT)

The QPJOBLOG spooled file was created on output queue QEZJOBLOG with my user profile name; the user data was the job name (QZDASSINIT).

3) Dumped the job to get all the thread call stacks. 
This requires serving the target job and using the DMPJOB command with a special set of parameters. (I wrote about this support in Display Call Stacks):

STRSRVJOB JOB(&JOBNUM/&JOBUSER/&JOBNAME)
OVRPRTF   FILE(QPSRVDMP) SPLFOWN(*CURUSRPRF)
DMPJOB    PGM(*NONE) JOBARA(*NONE) ADROBJ(*NO)  JOBTHD(*THDSTK)                 ENDSRVJOB

The QPSRVDMP spooled file was created on output queue QEZDEBUG. By default, the QPSRVDMP printer file is defined with the spooled file owner as *JOB; in my first test, the printer output was associated with the ######/QUSER/QSCWCHPS job.  Given my goal of having all my spooled files easy to find, the OVRPRTF was necessary to change the spooled file owner to be the current user profile.  Once that override was in place, all the spooled files generated by my watch program were found under the job ######/DAWNM/QPRTJOB.

As you can see from the spooled output I generated, they all had different spooled file names and they all went to different output queues.  But they all are associated with my QPRTJOB, which makes it easy to find all the output from my watch program.  With WRKJOB JOB(DAWNM/QPRTJOB)OPTION(*SPLF), I can find all three spooled files my watch program generated, along with the output queue in which they can be found.

In general, it’s easier to find your spooled files using Access Client Solutions or Navigator for i.  Both of these interfaces display your printer output by current user profile, regardless of what output queue it is on, or what job created it. And ACS and Navigator do not show all those FIN spooled files found with WRKJOB.

The IBM Support document, Finding and Working with Spooled Files Generated Under a QPRTJOB Job, has additional information on working with QPRTJOBs.