|
|
| Author |
Message |
seenivasakan Currently Banned New User
Joined: 13 May 2007 Posts: 21 Location: Karnataka
|
|
|
|
Greetings.
i have a requirement to create some file using JCL. i coded the jcl in the rexx script and submitted the same. The output of JCL has to be the input for the REXX script.
How i can delay the execution of my rexx script till JCL creates the dataset. Is there any way to check the dataset status?
Regards |
|
| Back to top |
|
 |
References
|
Posted: Wed Apr 09, 2008 4:04 pm Post subject: Re: wait till jcl creates dataset |
 |
|
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 2959 Location: Brussels once more ...
|
|
|
|
Are you doing this in foreground ?
Just think ..... for example, all initiators are in use and your job sits waiting for a couple of hours before it gets processed, and your REXX script is just sitting there looking for a dataset, totally blocking your terminal for any useful purpose.
Why not tag the secondary REXX processing as a step in the batch job ? |
|
| Back to top |
|
 |
seenivasakan Currently Banned New User
Joined: 13 May 2007 Posts: 21 Location: Karnataka
|
|
|
|
Hi Expat,
Thanks for your reply.
Unfortunately, this rexx script has to run in the Foreground. Basically this will get the PDS name(copybook library name) from the user and extracts the members (copybooks) and then a JCL is submitted calling Fileaid to print the Members layout. the layout is captured in a file(JCL Creates)
the above file is taken as a input by Rexx Script.
So any other way to go ahead???????? |
|
| Back to top |
|
 |
feellikeneo
Active User
Joined: 19 Mar 2007 Posts: 77 Location: Chennai
|
|
|
|
Hi Seeni,
Can you try running your REXX script as a next step. Meaning run the JCL in step1 and your rexx macro in step2.
Hope this helps |
|
| Back to top |
|
 |
seenivasakan Currently Banned New User
Joined: 13 May 2007 Posts: 21 Location: Karnataka
|
|
|
|
But input to JCL (Copybook library name) has to be obtained from User through some ISPF panels.
Based on the Library name, members are extracted and given to JCL. the jcl creates some datasets. The dataset has to be used by REXX. |
|
| Back to top |
|
 |
Ashwin_mudikon
New User
Joined: 03 Apr 2007 Posts: 33 Location: Chennai
|
|
|
|
The best option would be to have your second rexx program as the next step in the jcl.
If you want to do it online then after submitting the job, get into a forever loop and use the STATUS command to check the status of the job until it is over. However this is not a good way to do when your job is going to run for a long time. |
|
| Back to top |
|
 |
Marso
Active User
Joined: 13 Mar 2006 Posts: 288 Location: Israel
|
|
|
|
I have rexx programs that run SORT or ISRSUPC without any jcl:
| Code: |
Srt. = ""
Srt.1 = " JOINKEYS FILES=F1,FIELDS=(1,4,A),"
Srt.2 = " INCLUDE=(6,8,CH,EQ,C'"Left(ProgName,8)"')"
Srt.3 = " JOINKEYS FILES=F2,FIELDS=(1,4,A)"
Srt.4 = " REFORMAT FIELDS=(F2:1,5,F2:49,4)"
Srt.5 = " SORT FIELDS=COPY"
"EXECIO * DISKW SYSIN (FINIS STEM Srt."
"ALLOC F(SORTJNF1) DA('"TransTree"') SHR"
"ALLOC F(SORTJNF2) DA('"TransInfo"') SHR"
"ALLOC F(SORTOUT) NEW SPACE(10,5) TRACKS UNIT(SYSDA) REUSE",
"RECFM(F,B) BLKSIZE(450) LRECL(9)"
"CALL *(SYNCSORT)"
"EXECIO * DISKR SORTOUT (FINIS STEM TransList."
"FREE F(SORTJNF1 SORTJNF2)"
"FREE F(SORTOUT)" |
In this example, SYNCSORT is executed synchronuously.
Once the sort finished, the data in SORTOUT is immediately available.
No doubt something like this can be achieved with FileAid. |
|
| Back to top |
|
 |
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 159 Location: Pune
|
|
|
|
There is another way of keeping your REXX exec to wait.
I used it for submitting a job from Rexx exec and made the exec to wait till the job is completed for further processing.
In your case, you can probably use it in this way.
I am sure it is not practically correct. But you can use your own logic for
making your REXX exec wait till something is completed.
Do until SYSDSN(DSNAME) = 'OK'
CALL SYSCALLS('ON')
ADDRESS SYSCALL
"SLEEP" 1
CALL SYSCALLS 'OFF'
END |
|
| Back to top |
|
 |
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 2959 Location: Brussels once more ...
|
|
|
|
Srihari Gonugunta
If you worked for me, you would not be doing so for very long.
If you are happy to sit there waiting for a job to complete with a locked terminal rather than spending that time doing anything else more productive .......................  |
|
| Back to top |
|
 |
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 159 Location: Pune
|
|
|
|
| Hmmm.....true....Sometimes, it is better to wait to get something done...Just don't mind... |
|
| Back to top |
|
 |
|
|