× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Client jobs always print to a job named QPRTJOB. This job is created
once and may be reused over and over. This is the code that I use in a
command that deletes old spool files. You might be able to use it to get
to the jobs. You might try looking for all jobs that are QPRTJOB. You
might find one for the spool file that you created using the job name of
QPRTJOB but having the same job number and user as the job that created
it. I don't know if a new QPRTJOB will get created if you create a new
client job. If it does not, then this breaks.



LOOP3:

DLTSPLF FILE(&SRCMBR) JOB(&JOBNUM/&USER/QPRTJOB) +

SPLNBR(*LAST)

MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(LOOP3_E))

GOTO CMDLBL(LOOP3)

LOOP3_E:

----------------------------------------
Found this online.

As long as you know the name of the spoolfile (SplName) and you go after
the information before printing the next one of that name you can use
the following in a CL retrieving the USER, JOB NUMBER and the SPL NUMBER

RTVSPLFID SPLF(SplName) SPLNBR(*LAST) RTNUSER(&SPUSER) +
RTNJOBNBR(&SPJOBN) RTNSPLNBR(&SPLFNO)

I don't see RTVSPLFID on this AS400, and I see that it's a TAA
productivity tool. I'm pretty low on the upgrading chain of command I'm
afraid, esp if it's something that requires payment. Is there any other
way to retrieve this information?


Bradskk | Nov 8 2005 11:45AM GMT

Sorry about that. We use the RTVSPLFID so much that I didn't even
realize that it was from our old copy of TAATOOLS.


astradyne | Nov 8 2005 8:52PM GMT

QPRTJOB is a job that is automatically created by the system when your
job tries to create a spool file and the job's current user ID is
different to the user ID that the job is running under.

For example, in your GUI application, the HTTP server job starts running
under user QTMHHTTP. When you then logon to the job as, for example,
user JDOE the system recognises that the current user profile has
changed and directs all spooled output to job QPRTJOB/JDOE/nnnnnn.

Each QPRTJOB can hold up to 9999 spool files, after which a new QPRTJOB
job is created for the user. The QPRTJOB remains active and is re-used
until either 9999 spool files are created for the job, or all spool
files for the job have been deleted and there have been no more spool
files written for 24 hours.

I would try using the QUSLJOB (List Jobs) API, specifying a job name of
QPRTJOB/user_id/*ALL and a status of *ACTIVE. This should create an
entry in a user space which you can then interrogate to get the full job
name back.

-------------------------------------------
Found this in manual.

QPRTJOB job

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, if you send a spooled file using the Send Network Spooled File
(SNDNETSPLF) command to user TINA on a different 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 Work with Spooled Files (WRKSPLF) command,
the spooled file sent to her is shown.
Note: Use the SPLFOWN parameter to specify who owns the spooled file.

QPRTJOB jobs are created automatically by the system. There can be more
than one QPRTJOB per user on a system. A QPRTJOB has a default value of
9999 spooled files. That number can be expanded to the maximum of
999,999 by changing the number in the Maximum printer output files
(QMAXSPLF) system value. For more information about the Maximum printer
output files (QMAXSPLF) system value, see the Work Management topic.
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 you use the
SNDNETSPLF command 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 Send TCP/IP Spooled File (SNDTCPSPLF) or SNDNETSPLF
commands to send a spooled file to another user on a different System
i(tm) platform.
* Sending a spooled file from VM or MVS(tm) through a VM/MVS bridge
to a System i platform.
* Receiving a spooled file using TCP/IP or the line printer daemon
(LPD) process.
* Using the Create Spooled File (QSPCRTSP) Spool API to create a
spooled file for another user.
* Using the Set Profile (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.
* Using the UNIX(r) SETGID API to create a spooled file for a
different, current, or group user profile when SPLFOWN is set to
*CURGRPPRF.
* Using the UNIX SETUID API to set the user profile to a different
user and then create a new spooled file for that user.

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 recovery is done by the system job QSPLMAINT.
Parent topic: Spooled files and output queues
Related information
Work management
-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx
[mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of Heu Bor Huey
Sent: Monday, January 05, 2009 4:32 AM
To: java400-l@xxxxxxxxxxxx
Subject: Spooled File Job Number for CPYSPLF

Hi all,

I am trying to do a CPYSPLF (using CommandCall) to a spooled file which
I have written to AS400 using SpooledFileOutputStream and appropriate
writer. Before writing the spooled file, I have used RTVJOBA
(ProgramCall through a CL wrapper) to retrieve the user, job number and
job name. However, when I perform CPYSPLF, it failed because "File
<something> not found in job <xxx/yyy/zzz>". I tried to check out the
spooled file attributes, and it has the job number etc different from
what is retrieved by RTVJOBA.
I have also tried specifying SPLFOWN(*JOB) in CRTPRTF before writing,
but still job number and job name still remains different though user is
the same.

Can I know why is this happening? Is there any way to fix this thing?

Thanks.

BH
--
This is the Java Programming on and around the iSeries / AS400
(JAVA400-L) mailing list To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/java400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.