View previous topic :: View next topic
|
Author |
Message |
sudhakarhv
New User
Joined: 23 Dec 2009 Posts: 5 Location: United States
|
|
|
|
Hi all,
I have designed a panel where the user would enter a dataset name(input file).
I have written a rexx program to display the panel. Also in the same program I have submitted a jcl to sort an input file and then i need to use the output file of the jcl in my rexx program again.
Is there any way to find out when job has completed fine and then continue its processing in the rexx program.
I felt that I can use sleep function to wait till the job completes. However, I wanted to know if there is another way of doing this. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Instead of submitting a job, you should be able to allocate the required DD names in your rexx and then call the program. In that way, you can check the return code synchronously. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Pedro wrote: |
Instead of submitting a job, you should be able to allocate the required DD names in your rexx and then call the program. In that way, you can check the return code synchronously. |
Yes, using sort in forground is good, but ...............
1) The file to be sorted is not huge
2) The file to be sorted is not on tape |
|
Back to top |
|
|
sudhakarhv
New User
Joined: 23 Dec 2009 Posts: 5 Location: United States
|
|
|
|
I am actually using a job to sort the input files because i i feel that sorting using a jcl works much faster than writing a rexx program.
And then i need to use the sorted output in the rexx program.
I have also tried to run my rexx in background mode using IKJEFT01 but since I am using some ISPEXEC commands it is throwing me an error. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Search for ISPF and batch to see a lot of discussions about running REXX which uses ISPF facilities in batch. It is not too difficult to achieve. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
You did not give enough info to provide proper advice...
You have basically two options...
1 - quick and dirty , questionable from all points of view,
auditing, resource utilization, performance management(*), time lost sitting in front of a locked screen waiting for a <batch> process to complete
- run everything from a properly written REXX
- for each step ( sort included ) allocate the files and invoke the relatiuve program
2) review the process , asking the user to define all his inputs once and then submit a properly designed batch to run the <whole> process
- the fact that You are using ISPF services will not prevent a <batch> execution
(*) TSO users running <batch> interactively will most usually experience longer elapsed than a corresponding batch
system resources are assigned to TSO to tune the response time to fit the think time, and as such will be given higher priority than general batch processes
assigning to long running - with no terminal interaction - TSO tasks a lower priority than general batch is a way of avoiding cheating
and You would fall in this murky ground |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I agree with what Pedro suggested. It makes no sense to run a sort in the background when you could just run it in the foreground.
But, if it's absolutely necessary to submit a job, why can't you use the TSO STATUS and TSO OUTPUT commands, or SDSF, or some similar product, to determine the job's status? |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
sudhakarhv wrote: |
I have designed a panel where the user would enter a dataset name(input file).
I have written a rexx program to display the panel. Also in the same program I have submitted a jcl to sort an input file and then i need to use the output file of the jcl in my rexx program again.
I am actually using a job to sort the input files because i i feel that sorting using a jcl works much faster than writing a rexx program.
And then i need to use the sorted output in the rexx program.
I have also tried to run my rexx in background mode using IKJEFT01 but since I am using some ISPEXEC commands it is throwing me an error. |
How are you going to display a panel and accept input from the user in background? Forget about mixing foreground and background processing, it does not work well!! |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Quote: |
I am actually using a job to sort the input files because i i feel that sorting using a jcl works much faster than writing a rexx program.
|
I was NOT advocating that you re-invent a sort utility and for you to write it in rexx.
I was advocating that you invoke your normal sort utility, but invoke it from your rexx program running in your TSO session.
Something like:
Code: |
"ALLOC F(SORTIN)..."
"ALLOC F(SORTOUT) . . ."
"CALL 'sys1.sortlib(SORT)'" |
|
|
Back to top |
|
|
sudhakarhv
New User
Joined: 23 Dec 2009 Posts: 5 Location: United States
|
|
|
|
Thank you Pedro.
I actually forgot the option of calling the sort from my rexx program.
It was working for me using your logic.
Thank you very much. |
|
Back to top |
|
|
|