Job Information

5 pts.
Tags:
CL
QUSLJOB
QUSRJOBI
I want to retrieve Job number & user name for a particular job name. I come to know that through 'QUSLJOB'or 'QUSRJOBI' we can retrieve Job number & user name for a given job name.Is it possible ? I tried doing in the system through CL but it retrieves the current job name info running in the program not the job name specfied in the program. Appreciate your help Thanks
ASKED: July 9, 2008  6:52 AM
UPDATED: May 3, 2010  6:53 AM

Answer Wiki

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

You can’t. In order to retrieve any information about a job you have to already know the job number and user name. Both of those APIs you mentioned have to have the qualified job name passed to them in order to retrieve any information about a job.

One way to get this information, though, is to execute a WRKACTJOB to print, copy the spooled file to a work file, and then parse the work file looking for the job name. However, this will only work if the job name is unique.

———————————————————–
Here are the specifics of the QUSLJOB API.

http://publib.boulder.ibm.com/infocenter/iseries/v5r4/topic/apis/qusljob.htm

In the job name section of the the qualified job name, it appears that you could provide the name of the job you’re looking for, and specify *ALL for the user name and job number components. Or, if you are looking for a job name and a specific user name, you should be able to provide those two, and specify *ALL for the job number component. All of the matching jobs would be written to a user space, which you could access (via another API) to find the job(s) that you’re looking for and proceed accordingly with what you want to do.

<b>Qualified job name </b>
<i>INPUT; CHAR(26)
The name of the job to be included in the list. The qualified job name has three parts:

Job name CHAR(10). A specific job name, a generic name, or one of the following special values:

* Only the job that this program is running in. The rest of the qualified job name parameter must be blank.
*CURRENT All jobs with the current job’s name.
*ALL All jobs. The rest of the job name parameter must be specified.

User name CHAR(10). A specific user profile name, a generic name, or one of the following special values:

*CURRENT Jobs with the current job’s user profile.
*ALL Jobs with the specified job name, regardless of the user name. The rest of the job name parameter must be specified.

Job number CHAR(6). A specific job number or the following special value:

*ALL Jobs with the specified job name and user name, regardless of the job number. The rest of the job name parameter must be specified.</i>

Since this API requires a user space, you could create some modular service programs to manage working with a user space, so that you could re-use them with other APIs.

CWC

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

The Retrieve Job Information (QUSRJOBI) API does require a fully-qualified job name, but the List Job (QUSLJOB) API only needs job-name. It doesn’t need user-name nor job-number.

It will return a list of all jobs that have the specified job-name. The list will be in a user space.

Tom

Discuss This Question:  

 
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

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