View previous topic :: View next topic
|
Author |
Message |
Velmurugan_j
New User
Joined: 04 Aug 2005 Posts: 49
|
|
|
|
How to check whether the JOB is runnning or not if yes how to kill that job...using a rexx... |
|
Back to top |
|
|
HappySrinu
Active User
Joined: 22 Jan 2008 Posts: 194 Location: India
|
|
|
|
not sure of the answer but i guess you can use RC keyword to check jobs output.
to kill a job i guess u can enter CA7 through rexx and use cancel command
know answer is vague just try to give some idea.. |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Search the forum for batch SDSF. There are many examples.
O. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Quote: |
to kill a job i guess u can enter CA7 through rexx and use cancel command |
Why not just enter the command directly into the OS ? |
|
Back to top |
|
|
Velmurugan_j
New User
Joined: 04 Aug 2005 Posts: 49
|
|
|
|
i want to kill the job from rexx |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
If the objective is to canel a job,
what difference does it make what You are using to do it ?? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
ES - exactly the same question has wandered across my mind
Velmurugan_j - Is this a requirement or a whim ? |
|
Back to top |
|
|
Velmurugan_j
New User
Joined: 04 Aug 2005 Posts: 49
|
|
|
|
it is a requirement..... |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
If it must be REXX, then it must be REXX
Take a search through the forum for SDSF under REXX |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
or use the "CONSOLE" command... |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
in rexx try something like
Code: |
_x=outtrap("jobstate.",1,"noconcat")
address tso "status" _job |
|
|
Back to top |
|
|
Velmurugan_j
New User
Joined: 04 Aug 2005 Posts: 49
|
|
|
|
but how to purge or kill the job thru rexx.... |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
I repeat: look for "batch sdsf" in previous posts.
O. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
or as a second alternative, as already said, look ath the "CONSOLE" command:D |
|
Back to top |
|
|
acevedo
Active User
Joined: 11 May 2005 Posts: 344 Location: Spain
|
|
|
|
so the question is:
check if a job is running, in rexx, and if it's running then, in rexx, purge it.
I have, basically, 2 doubts about it:
1-why in rexx?
2-why the job is running?, or in other words, insted of purge why don't you study the way of not submitting it?
|
|
Back to top |
|
|
Velmurugan_j
New User
Joined: 04 Aug 2005 Posts: 49
|
|
|
|
My tool is fully developed in rexx
so before submitting my JCL i need to check whether any previous job(same jcl) is running or not
if it is running i need to calcel it or purge it and then submit the new JCL |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Just curious,
what assumption makes You believe that the preceding job is the wrong one and has to be canceled/purged
You might be canceling/purging a good job and submit a wrong one |
|
Back to top |
|
|
Velmurugan_j
New User
Joined: 04 Aug 2005 Posts: 49
|
|
|
|
its not an assumption. to cancel the job because it is wrong one..
we should be having only one running job for that..
so we need to purge the job if it ryunning to run this job.. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
why waste resources by canceling a job and submitting a new one
just do not submit the new one,
or since the job has the same name let jes2/3 take care of it by delaying the execution |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
here is a snippet to find out about a job givn a job name
Code: |
/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
Trace "O"
Parse upper arg jobname
_rc = outtrap("status.")
Address TSO "STATUS "jobname
_rc = outtrap('off')
do i = 1 to status.0
say right(i,2) status.i
End
Exit
|
invoke it by option 6 of ispf f or a native tso screen with "$status jobname"
or by any ispf command line by "TSO $status jobname" |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I suspect that i'm just confused, but what business process is supported by canceling a running job if my "job to be submitted" is already running? How was it submitted? What kind of file/database inconsistencies might be introduced by canceling?
How is such a process approved (management review, peer review, technical review, etc)? On my systems, it would not be allowed. . . Again, maybe i'm just confused. . . |
|
Back to top |
|
|
|