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

Job submitted thru Rexx.. to stop execution tll completion


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

New User


Joined: 07 Nov 2008
Posts: 19
Location: India

PostPosted: Wed Nov 26, 2008 11:52 am
Reply with quote

Hi All..
I am submitting a few jobs using Rexx..But I want that until the first job gets completed...code should not execute further..
Say in Line 10, I am submitting a job, now I want that until that job gets submitted.. it should not proceed further...how can I achieve this??
One way may be to get MaxCC of job in a variable and until that variable is being populated (i.e it holds MaxCC of that job), DO FOREVER loop can be used..
Pls help with some better way...I don;t think it to be a good way..
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Nov 26, 2008 11:58 am
Reply with quote

Search the forum foe the word "sleep". There are some example.

By the way, it is considered a bad practice to hold your REXX while waiting for a job.

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

New User


Joined: 07 Nov 2008
Posts: 19
Location: India

PostPosted: Wed Nov 26, 2008 12:03 pm
Reply with quote

Let me explain you the whole scenario..
I am trying to submit one job for several members...
meaning to say..that job's SYSIN contains the PDSname(<MemberName>)
Now, I need to edit that job's SYSIN every time for each Member so that it gets edited and then I can submit that job...
So, for editing I am using its DISP = OLD...
Now, until the first job gets completed, it won't open the dataset again to edit it...so I want that Rexx should wait for execution until the first job gets completed..
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Nov 26, 2008 12:07 pm
Reply with quote

Use a combination of OUTTRAP, STATUS, "TSO PROFILE NOWTPMSG" & LISTBC.

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

Global Moderator


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

PostPosted: Wed Nov 26, 2008 12:12 pm
Reply with quote

ofer71 wrote:
Search the forum foe the word "sleep". There are some example.
By the way, it is considered a bad practice to hold your REXX while waiting for a job.
O.

Please pay attention to the comment above.

You can end up with a locked terminal for most of the day while waiting for things to happen which are beyond your control.

Please think of an alternative method of doing this, for instance multiple copies of the same job each using a different sysin member.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Wed Nov 26, 2008 10:21 pm
Reply with quote

Not sure I understand the scenario, but it looks like you are editing the SYSIN file then submitting a file that references it.

I agree with Expat that this is not being done efficiently.

If you already have easy access to the SYSIN, I have a suggestion. I think you should submit job with SYSIN DD * and include the sysin data, rather than refer to it by name.

Or possibly, edit all of your SYSIN members before submitting any jobs.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Thu Nov 27, 2008 2:19 am
Reply with quote

Why do you need JCL at all? Just call your program from Rexx!
Back to top
View user's profile Send private message
ashishwach

New User


Joined: 07 Nov 2008
Posts: 19
Location: India

PostPosted: Thu Nov 27, 2008 12:23 pm
Reply with quote

Thanks for all your valuable suggestion..
As per expat, I copied same JCL to different members and submitted jobs for all of them..
Now, what happens is each job submitted creates a member in an output dataset..so, if I submitted, say 10 jobs, 10 members (one corr. to each) will get created in output datasets..Now, when I am trying to retrieve the members of that datasets in same rexx code, it is giving me an error message..

263 *-* "LISTD '"PDS4"' MEMBERS"
+++ RC(-20) +++

But if I am running the same code (i.e. just to retrieve the members of the output dataset created) in a different Rexx, it's running fine..
pls help
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Nov 27, 2008 1:41 pm
Reply with quote

LISTDS is an autorized command. You need to consult your security guys.

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

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Fri Nov 28, 2008 1:03 pm
Reply with quote

ashish,

I had already posted a code for this requirement in this forum. I shall search and post it.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Nov 28, 2008 1:14 pm
Reply with quote

Try using the TSOEXEC command:
Code:

Address TSO "TSOEXEC LISTD '"PDS4"' MEMBERS"
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 Compile Several JCL JOB Through one r... CLIST & REXX 4
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
Search our Forums:

Back to Top