Retrieve Job Lock (QWCRJBLK) thread ID

pts.
Tags:
AS/400
RPGLE
Does anyone know how I would get the thread ID of another job in order to retrieve the job lock info? This is the fifth parameter of QWCRJBLK. I will be using the QUSLOBJ API to retrieve all jobs on the system and then want to determine certain locks on those jobs. QUSLOBJ does not appear to provide the thread info for the jobs that it retrieves.

Answer Wiki

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

I’m not at office, so, I can not check my answer. But, the api that is equal to RTVJOBA (forgot the exact name) can retrieve the ID of any job from jobuser+jobname+jobnumber.

The Thread indicator field in the JIDF0100 Format used to specify the JOB can be set to a value of 3 which will cause this api to retrieve not only the lock information for the intial thread but all other active threads of this job that have locks on objects.

Discuss This Question: 1  Reply

 
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
  • TomLiotta
    Does anyone know how I would get the thread ID of another job... Jobs don't have "thread IDs". Threads have thread IDs. That's why Lanceholmes suggested using 3 for the thread indicator. When you use a thread indicator value of 3, you must specify a thread ID of binary zeros. Review the Retrieve Thread Attribute (QWTRTVTA) API. Note how it describes 'Thread identifier':
    • A value that uniquely identifies a thread within a job. If a thread identifier is specified, a thread indicator must also be specified. If the thread indicator is not 0, this field must contain hexadecimal zeros.
    Tom
    125,585 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