0 pts.
 How do I retrieve the JOB/USER/NBR for a spoolfile generated by a GUI program?
I have a GUI program which HAS to run interactively that generates a spoolfile. The HTTP job (Which is what I correctly retrieved using RTVJOBA & QUSRJOBI)is: Job: VOI User: QTMHHTTP Number: 303484 But the job that my spoolfile has is: Job: QPRTJOB User: <My user ID> Number: 303384 Does anyone know how to retrieve THIS latter JOB/USER/NBR?

Software/Hardware used:
ASKED: November 8, 2005  7:37 AM
UPDATED: November 18, 2009  7:19 AM
  Help
 Approved Answer - Chosen by TomLiotta

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.

Hope it helps

Jonathan

ANSWERED:  Nov 8, 2005  8:52 PM (GMT)  by TomLiotta

 
Other Answers:

I suggest that you use rtvjoba OR qusrjobi, not both in the same time.
Try with WRKUSRJOB command, read help for this command, and it will work.
(Some similar things work for me with WRKUSRJOB)

====================================================

You probably want to use the <a href=”http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/apis/QSPRILSP.htm”>Retrieve Identity of Last Spooled File Created (QSPRILSP) API</a>.

But you might want to clarify the contradiction in your question. You started with <i>”I have a GUI program”</i> and immediately contradicted it with <i>”which HAS to run interactively”</i>. If it’s GUI, it won’t also be interactive. At least, it won’t be interactive from the iSeries perspective.

So, if it “has” to be, well, it won’t be.

Tom

Last Wiki Answer Submitted:  November 18, 2009  7:19 am  by  TomLiotta   108,300 pts.
Latest Answer Wiki Contributors:  Dalibor   10 pts.
To see other answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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)

 0 pts.

 

I apoligize in advance if this isn’t the right way to answer replies; but unfortunately I think I need some more input for the former two replies:

——————————————————-
I guess I wasn’t specific; I tried to use RTVJOBA, then I tried to use QUSRJOBI; they both came back with the actual Job information. (Job: VOI; User: QTMHHTTP; Number: 303484)

I also tried to do a WRKJOB on the HTTP job, but couldn’t find anything to tell me where that spoolfile was going.

———————————————————-
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?

 0 pts.

 

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

 0 pts.