• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

[HELPED] Retrieve "Real" Job Attributes?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [HELPED] Retrieve "Real" Job Attributes?

    Hi,

    We use the Valence login method, but with Kerberos, and our users' jobs run under their own System i userids.

    I have an app making an AJAX call to an RPG pgm that runs some business logic, creates a spool file and then, via QCMDEXC , runs a command to convert the spool file to a pdf file on the IFS. (SPL2STMF) This command requires a Job#, UsrPrf, and Job Name to identify the appropriate spool file for conversion. Problem is... when I retrieve these attributes from the program status data structure within the pgm, it's pulling the QTMHHTTP user and number associated with the VALENCE job rather than the job attributes that are associated with the generation of the spooled file.

    I have code that I routinely use to identify the "real" user via the vvUtility_getSessVar procedure so I can get the user but I don't know how to get the Job# and Job Name to populate the rest of the SPL2STMF command.

    I don't want to do a SBMJOB for the spool file program because, after the file (PDF) is created on the IFS, I'm pulling it up in a window on the front end for the user to view so I really need the front end to wait to make sure the file was created before I try to display it.

    I'm wondering if I'm going about this the wrong way... any suggestions?

    Thanks!
    Eva

  • #2
    Hi Eva,

    I wouldn't expect the job number and job name to vary from what's in the SDS. The job user, of course, would be different, and you can get that by just using the inz(*USER) trick within a procedure. See details on that in this old post.

    Does that help?

    -Rob

    Comment


    • #3
      Rob,

      You're right, of course, about the job name and number... and reading the info in the old post gave me a better understanding of how it all works.

      I was still baffled, however, because the spooled file was getting created under a job called QPRTJOB (rather than the Valence job). Additional research showed that QPRTJOB "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."

      A bit more research led me to this nifty little API called QSPRILSP which gives me the ability to retrieve everything I ever wanted to know about the last spooled file that was created. Got what I needed! Thanks for igniting the spark!

      Eva

      Comment


      • #4
        Good to know -- thanks for posting that tid-bit. We both learned something here!

        Comment

        Working...
        X