View previous topic :: View next topic
|
Author |
Message |
ashishwach
New User
Joined: 07 Nov 2008 Posts: 19 Location: India
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
ashishwach
New User
Joined: 07 Nov 2008 Posts: 19 Location: India
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Use a combination of OUTTRAP, STATUS, "TSO PROFILE NOWTPMSG" & LISTBC.
O. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
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 |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
Why do you need JCL at all? Just call your program from Rexx! |
|
Back to top |
|
|
ashishwach
New User
Joined: 07 Nov 2008 Posts: 19 Location: India
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
LISTDS is an autorized command. You need to consult your security guys.
O. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
ashish,
I had already posted a code for this requirement in this forum. I shall search and post it. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Try using the TSOEXEC command:
Code: |
Address TSO "TSOEXEC LISTD '"PDS4"' MEMBERS" |
|
|
Back to top |
|
|
|