View previous topic :: View next topic
|
Author |
Message |
Jairam21
New User
Joined: 31 Jan 2008 Posts: 5 Location: USA
|
|
|
|
Hi,
I do have a question on CICS Task Number .
I want to know how to find if the task is still running/active. I need to check this in the CICS-COBOL program (Not using CEMT commnad on the CICS screen).
I have a task number stored in database and I want to check if this task is still active or not.
Please let me know and appreciate your help and time.
Thanks
Jairam |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I have a task number stored in database and I want to check if this task is still active or not. |
How did the task number get into the database? Might it be possible to make a mark in the same row when the task ends (using something similar to whatever put the task number in the database in the first place)?
I suggest that because trying to find a task across one or more CICS regions from within an application program may take more work than is feasible. The way we did things like this ages ago was to "chase control blocks" and find what we needed. This meant writing in assembler and was vulnerable to system upgrades when "things change". |
|
Back to top |
|
|
Jairam21
New User
Joined: 31 Jan 2008 Posts: 5 Location: USA
|
|
|
|
Thanks for your response.
Once the task completes successfully (means program) I will delete it from the database. At the start of the transaction the Program will insert the task number.
I tried using INQUIRE supplying the task number from table and I am getting response code as 00000091 where i don't what this repsonse code means.
If this task number processing involved assembler level coding, then I will drop this idea in my program functionality.
Thanks |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Probably the easiest to use, would be to issue -
Code: |
03 WS-TASK-NBR PIC S9(07) COMP-3.
EXEC CICS INQUIRE TASK(WS-TASK-NBR) NOHANDLE END-EXEC.
IF EIBRESP = DFHRESP(TASKIDERR)
PERFORM TASK-NOT-RUNNING
ELSE
IF EIBRESP NOT = DFHRESP(NORMAL)
PERFORM SOME-OTHER-ERROR
END-IF
END-IF.
|
I'm assuming that WS-TASK-NBR contains the task-nbr in question.
However, if your shop standards don't allow you to specify the Translator (NOT Compile) Option "SP" (System Programmer), then you wouldn't be able to use this.
Keep in mind that if you're in an MRO and/or CICSPLEX environment and the task is running in a different region, you'd have to specify the REMOTESYSTEM parameter, which is essentially the SYSID of the target region.
HTH....
Regards,
Bill |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
you'd have to specify the REMOTESYSTEM parameter, which is essentially the SYSID of the target region |
Would this also need to be put into the database to be available to the code that checks if the task is still running? |
|
Back to top |
|
|
Jairam21
New User
Joined: 31 Jan 2008 Posts: 5 Location: USA
|
|
|
|
Thanks for your replies guys. I will code it as given by Bill and will test it.
I will update the forum once I am done with the testing.
Appreciate your timely help.
Jairam |
|
Back to top |
|
|
|