Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to check a JOB is runnning or not in REXX
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: How to check a JOB is runnning or not in REXX
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: 195
Location: India

PostPosted: Thu Jan 31, 2008 10:57 am    Post subject: Reply to: How to check a JOB is runnning or not in REXX
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: 2360
Location: Israel

PostPosted: Thu Jan 31, 2008 11:38 am    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jan 31, 2008 12:57 pm    Post subject:
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    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Feb 01, 2008 1:04 pm    Post subject: Reply to: How to check a JOB is runnning or not in REXX
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: 8593
Location: Back in jolly old England

PostPosted: Fri Feb 01, 2008 1:26 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Fri Feb 01, 2008 5:54 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Feb 01, 2008 6:27 pm    Post subject: Reply to: How to check a JOB is runnning or not in REXX
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    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Tue Feb 05, 2008 1:13 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Feb 05, 2008 1:18 pm    Post subject: Reply to: How to check a JOB is runnning or not in REXX
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Feb 05, 2008 4:55 pm    Post subject: Reply to: How to check a JOB is runnning or not in REXX
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Feb 05, 2008 5:47 pm    Post subject: Reply to: How to check a JOB is runnning or not in REXX
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Feb 05, 2008 6:32 pm    Post subject: Reply to: How to check a JOB is runnning or not in REXX
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us