Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Submit a jcl from rexx and then resume the rexx program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Submit a jcl from rexx and then resume the rexx program
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

Senior Member


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

PostPosted: Tue Jun 08, 2010 6:51 pm    Post subject: Reply to: Submit a jcl from rexx and then resume the rexx pr
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: 8617
Location: Back in jolly old England

PostPosted: Tue Jun 08, 2010 6:55 pm    Post subject: Re: Reply to: Submit a jcl from rexx and then resume the rex
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    Post subject:
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: 8617
Location: Back in jolly old England

PostPosted: Tue Jun 08, 2010 7:48 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10374
Location: italy

PostPosted: Tue Jun 08, 2010 7:55 pm    Post subject: Reply to: Submit a jcl from rexx and then resume the rexx pr
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

Moderator Team Head


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

PostPosted: Tue Jun 08, 2010 7:58 pm    Post subject: Reply to: Submit a jcl from rexx and then resume the rexx pr
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    Post subject:
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

Senior Member


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

PostPosted: Wed Jun 09, 2010 5:43 am    Post subject: Reply to: Submit a jcl from rexx and then resume the rexx pr
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    Post subject: Thank you Pedro
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
This topic is locked: you cannot edit posts or make replies. Rexx to Grab ISMF Information. upendrasri All Other Mainframe Topics 16 Sun Nov 26, 2017 12:35 am
No new posts Rexx to send an email without SMTP Se... upendrasri All Other Mainframe Topics 12 Sun Nov 19, 2017 7:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us