Spool file attributes in LANSA for Web jobs

Date: Archived
Product/Release: LANSA for Web
Abstract: Spool files have different attributes in LANSA for WEB
Submitted By: Pablo Piccioli

LANSA for Web uses an IBM® API called QWTSETP, which changes the job attributes and then hardcodes any interactive output to a jobname QPRTJOB with a different job number. Basically, because the Web server and the jobs usually run under different profiles, it is the AS/400, which actually uses the QPRTJOB name for the interactive spool files.

There is only one QPRTJOB for each user, and all spool files for this user are placed in this job. These QPRTJOB jobs are system jobs that are active for 24 hours and are not deleted, even by an IPL. If one already exists, all output is placed in the existing one; otherwise a new one is created.

Any job, be it a LANSA for WEB one or not, which is changed to run under a different profile, will have it's output directed to here. Also, this will mean that users with the same profile will have their output all here as well.

To get to the spool file, use the values of jobname = QPRTJOB & user = user who is signed on. The spooled file number should be *LAST (or a number: reports are usually named [email protected] and are numbered files from 1.)

For submitted jobs, it is basically the same situation where the output is given a new job number but the jobname is the name of the process that submitted the job. So, use the process name for the job name etc.

The information below is taken from the AS/400 manuals:

Spooled File and Pre-start Job Entry

If a spool file is opened before a pre-start job handles any program start request, the spool file is associated with the pre-start job entry user profile; otherwise it is associated with the current program start request user profile. If the pre-start job entry profile and the current program start request user profile are different, spooled files are spooled under a job with the first part of the three-part job name being QPRTJOB and the second part being the name of the user profile.

Working with a QPRTJOB

A QPRTJOB job is a job that spooled files are associated with when the current job's user name is not the same as the user profile currently running. System jobs can change to run under a user's profile in order for a user to obtain ownership of the spooled file instead of the system job.

For example, a spooled file is sent using the SNDNETSPLF command to user TINA on a different AS/400 system, the file is spooled for job 999999/TINA/QPRTJOB. Spooling the file for this user's job instead of the system job makes sure that user TINA owns the spooled file. Then, when she runs the WRKSPLF command, the spooled file sent to her is shown.

Note: Using SPLFOWN parameter allows you to specify who owns the spooled file.

QPRTJOB jobs are created automatically by the system. There may be more than one QPRTJOB per user on a system. A QPRTJOB can hold a maximum of 9999 spooled files. When a user's QPRTJOB gets full, the system automatically creates a new one for the user. A separate QPRTJOB is created for each user that receives spooled files sent by the SNDNETSPLF command. If the SNDNETSPLF command is used to send users TINA and KEVIN spooled files, there would be jobs named 999999/KEVIN/QPRTJOB and 999999/TINA/QPRTJOB on the receiving system.

QPRTJOB jobs are created and used by a variety of system functions. For example:

  • Using the SNDTCPSPLF or SNDNETSPLF commands to send a spooled file to another user on a different AS/400 system.
  • Sending a spooled file from VM or MVS through a VM/MVS bridge to an AS/400 system.
  • Receiving a spooled file using TCP/IP or the line printer daemon (LPD) process.
  • Using the QSPCRTSP Spool API to create a spooled file for another user.
  • Using the QWTSETP Security API to set the user profile to a different user and then create a new spooled file.
  • Other applications that are running can use the QSPCRTSP and QWTSETP APIs resulting in additional QPRTJOB jobs on the system.


Cleanup of QPRTJOB Jobs

QPRTJOB jobs continue to be reused until they have been inactive more than 24 hours. Inactive means all spooled files for the job have been deleted and no new ones have been received for that user in more than 24 hours. The cleanup is done by the system job QSPLMAINT.