How do I retrieve the JOB/USER/NBR for a spoolfile generated by a GUI program?

pts.
Tags:
AS/400
Database
DB2 Universal Database
RPG
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?

Answer Wiki

Thanks. We'll let you know when a new response is added.

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

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Bradskk
    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 pointsBadges:
    report
  • Orelalaith
    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 pointsBadges:
    report
  • Bradskk
    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 pointsBadges:
    report
  • astradyne
    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
    370 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following