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

Submit a jcl from rexx and then resume the rexx program


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

New User


Joined: 23 Dec 2009
Posts: 5
Location: United States

PostPosted: Tue Jun 08, 2010 6:16 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Jun 08, 2010 6:51 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jun 08, 2010 6:55 pm
Reply with quote

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
View user's profile Send private message
sudhakarhv

New User


Joined: 23 Dec 2009
Posts: 5
Location: United States

PostPosted: Tue Jun 08, 2010 7:38 pm
Reply with 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.

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jun 08, 2010 7:48 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jun 08, 2010 7:55 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Tue Jun 08, 2010 7:58 pm
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Jun 08, 2010 7:58 pm
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Jun 09, 2010 5:43 am
Reply with quote

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
View user's profile Send private message
sudhakarhv

New User


Joined: 23 Dec 2009
Posts: 5
Location: United States

PostPosted: Sat Jul 17, 2010 12:03 am
Reply with quote

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
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 Using API Gateway from CICS program CICS 0
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
Search our Forums:

Back to Top