IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to check a JOB is runnning or not in REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Velmurugan_j

New User


Joined: 04 Aug 2005
Posts: 49

PostPosted: Thu Jan 31, 2008 10:46 am
Reply with quote

How to check whether the JOB is runnning or not if yes how to kill that job...using a rexx...
Back to top
View user's profile Send private message
HappySrinu

Active User


Joined: 22 Jan 2008
Posts: 194
Location: India

PostPosted: Thu Jan 31, 2008 10:57 am
Reply with quote

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
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Jan 31, 2008 11:38 am
Reply with quote

Search the forum for batch SDSF. There are many examples.

O.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jan 31, 2008 12:57 pm
Reply with quote

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
View user's profile Send private message
Velmurugan_j

New User


Joined: 04 Aug 2005
Posts: 49

PostPosted: Fri Feb 01, 2008 10:16 am
Reply with quote

i want to kill the job from rexx
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Feb 01, 2008 1:04 pm
Reply with quote

If the objective is to canel a job,
what difference does it make what You are using to do it ??
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Feb 01, 2008 1:26 pm
Reply with quote

ES - exactly the same question has wandered across my mind

Velmurugan_j - Is this a requirement or a whim ?
Back to top
View user's profile Send private message
Velmurugan_j

New User


Joined: 04 Aug 2005
Posts: 49

PostPosted: Fri Feb 01, 2008 5:17 pm
Reply with quote

it is a requirement.....
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Feb 01, 2008 5:54 pm
Reply with quote

If it must be REXX, then it must be REXX icon_confused.gif

Take a search through the forum for SDSF under REXX
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Fri Feb 01, 2008 6:27 pm
Reply with quote

or use the "CONSOLE" command...
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Fri Feb 01, 2008 7:27 pm
Reply with quote

in rexx try something like

Code:
_x=outtrap("jobstate.",1,"noconcat")       
address tso "status" _job                 
Back to top
View user's profile Send private message
Velmurugan_j

New User


Joined: 04 Aug 2005
Posts: 49

PostPosted: Mon Feb 04, 2008 2:49 pm
Reply with quote

but how to purge or kill the job thru rexx....
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Feb 05, 2008 1:13 pm
Reply with quote

I repeat: look for "batch sdsf" in previous posts.

O.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Feb 05, 2008 1:18 pm
Reply with quote

or as a second alternative, as already said, look ath the "CONSOLE" command:D
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Feb 05, 2008 4:29 pm
Reply with quote

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?


icon_question.gif
Back to top
View user's profile Send private message
Velmurugan_j

New User


Joined: 04 Aug 2005
Posts: 49

PostPosted: Tue Feb 05, 2008 4:51 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Feb 05, 2008 4:55 pm
Reply with quote

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
View user's profile Send private message
Velmurugan_j

New User


Joined: 04 Aug 2005
Posts: 49

PostPosted: Tue Feb 05, 2008 5:44 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Feb 05, 2008 5:47 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Feb 05, 2008 6:32 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Feb 05, 2008 11:35 pm
Reply with quote

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. . . icon_confused.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top