G.Gaunt
10-03-2002, 09:15 AM
Keith if you use /COPY QSYSINC/QRPGLESRC,QUSEC and you want an error indictor on CALL, then put QUSBPRV=0 before CALL.
Guest.Visitor
10-03-2002, 11:23 AM
We need to create a program which will display the status of a particular job, which I will call DATALINK here and which runs in its own subsystem. If the DATALINK is not active, the user will be able to start it, and if it is active but hung up, we'd like to be able to see that as well. I'm trying to find a way to retrieve the job's status. Searching the forum, I found a similar questsion posed back in 1999 (found here: Chris Ringer "Retrieve Job Status" 9/9/99 6:49am (/mc?50@175.koVMfHb6dae.1@.f01cd4c/2&phpMyAdmin=MzvdqLOMiN7HL4yz2OU82BJvkG9) ), there were two responses. One suggested a data area create by DATALINK when it starts and destroyed when it ends. A simple CHKOBJ command would then tell us the job was running, assuming it hadn't ended abnormally previously. The second response suggests using the 'QUSRJOBI' API, which seems the better option. So here's my problem. When I test my program (See relevant code attached. Note that I'm hard coding API parameters for the time being), when I pass '*' as the job name, it returns the status of my job just fine. But when I place DATALINK in the JobName parameter and blank the rest of the PmJobName data structure, the API returns CPF3C58 - "Job name specified is not valid" in teh QUSEC parameter. So the first problem is, how do I specify the job name? When I look at the DATALINK job and include the User name and Job number, I don't get the error, but there are a few different users who may start the job, so we can't hard code that or the job number. The API can also use the "Internal Job Identifier" created by the list job API, QUSLJOB. Would this help us? The second problem has to do with error handling. Since the job may not exist, I would expect an error condition to return from the API. Following the example in the IBM "System API Programming" manual, I code an error trapping indicator (I use *IN93 and not %error for display conditioning). However, in the errors mentioned above, the program returns from the API call without setting on *IN93 (same result when I tried %error), sets the VJobStatus field to the value of the relevent field in the data structure returned from the API, which is blank, and skips to the EndSr statement. All seems fine, but when the program reaches the EndSr statement, the program issues message "MCH3601 - Pointer not set for location referenced." I added conditioning by the QUSJS01 field as shown, and the VJobStatus field now gets set to '*error", but the program still blows up at the EndSr statement. Adding the LeaveSr opcode only causes the program to blow at that statement instead of the EndSr. Help!! Keith Engle <hr width=50 align=left>Code ('http://www.mcpressonline.com/mc/showcode@@.6ae3fd0a')
Guest.Visitor
10-03-2002, 11:23 AM
Thanks! That's done the job. Missed that in the code examples. I'm still looking for how to call the API without knowing the user and job number. Keith Engle
B.Morris
10-03-2002, 12:54 PM
kengle wrote: > ... I'm still looking for how to call the API without knowing the user and job number. > Keith, the QUSLJOB (List Jobs) API might be what you need. You could then search the resulting list for just the jobname.
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.