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?
By Dawn May11/16/2018
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:
- 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.
- 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).
- 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):
OVRPRTF FILE(QPSRVDMP) SPLFOWN(*CURUSRPRF)
DMPJOB PGM(*NONE) JOBARA(*NONE) ADROBJ(*NO) JOBTHD(*THDSTK) ENDSRVJOB
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.
Dawn May is an IBM i consultant. She owns Dawn May Consulting, LLC in the Greater Boston area. Dawn is a former IBM senior technical staff member.
See more by Dawn May