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
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.