MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Solving Infinite loop in REXX..

 
Post new topic   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Nila
Beginner


Joined: 26 Dec 2002
Posts: 20
Topics: 8
Location: Chennai, India

PostPosted: Thu Jan 02, 2003 4:49 am    Post subject: Solving Infinite loop in REXX.. Reply with quote

Wish you all a very happy New Year..

How to control infinite loop problem in REXX.
Suppose if we are using some JCL code we can put TIME parameter in the jobcard itself. Is there any other way to control timing in REXX EXEC?
_________________
Cheers Nila..
Back to top
View user's profile Send private message
[bond]
Beginner


Joined: 31 Dec 2002
Posts: 28
Topics: 6

PostPosted: Thu Jan 02, 2003 6:55 am    Post subject: Reply with quote

you could do well by taking care while coding the program ! ... hmmm ... if you want to control the time of execution then press attention key while the rexx program is executing and enter 'hi' afterwards. that will terminate it.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Jan 02, 2003 7:22 am    Post subject: Reply with quote

Bond,
Your solution would apply for a foreground execution. HI, meaning, Halt Interpretation, would halt the interpretation. (REXX is generally executed in interpretative mode.)

Nila,
You must take care the case of an infinite loop in the program itself as Bond says. Yes, TIME parameter can be one way of controlling infinite loop problem.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Thu Jan 02, 2003 7:30 am    Post subject: Reply with quote

Nila,
Another thing that you could do is,
Code:
 z = time('E')

as the starting line in the body of the loop and code the same as the penultimate line in the body of line. Test the value of z as the last line in the body of loop to set a flag. You can use that flag to end the loop.

time('E') gives the elapsed time between two time('E') commands.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Nila
Beginner


Joined: 26 Dec 2002
Posts: 20
Topics: 8
Location: Chennai, India

PostPosted: Thu Jan 02, 2003 11:04 pm    Post subject: Reply with quote

Hi Cogito, Bond
Thank you for the responses.
Now I can control the infinite loop problem.
_________________
Cheers Nila..
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Jan 03, 2003 4:10 am    Post subject: Reply with quote

Same as in my earlier post.

Test the value of z; in a loop or in any part of the EXEC. If it is beyond the limit you have decided, then exit the EXEC.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Jan 03, 2003 4:52 am    Post subject: Reply with quote

Ravi,
Honestly, I fail to understand your question. Could you kindly elaborate your requirement? Maybe, I could more info then.
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Jan 03, 2003 5:27 am    Post subject: Reply with quote

Ravi,
So, what you want to do is, limit the foreground execution time of a REXX EXEC. Am I right? IF yes, then testing the elapsed time is the only way I can think of.

Quote:
Is there any similar thing such that the time of exection can be restricted. i.e., before executing the acutal REXX program(pgm1) limit the time with some TSO command as EXECUTIL...


Sorry, Ravi. But, I am at a loss. I do not unerstand it.

You are right when you say that a COBOL program executed via REXX wil be out of our control.
Quote:
Where as in a JCL if the TIME exceeds the given cpu min's or seconds.. it abends with S322..


Here, you are not being fair! Smile Because, you are comparing JCL (batch background) to foreground execution!
_________________
ALL opinions are welcome.

Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Back to top
View user's profile Send private message
Premkumar
Moderator


Joined: 28 Nov 2002
Posts: 77
Topics: 7
Location: Chennai, India

PostPosted: Fri Jan 03, 2003 5:44 am    Post subject: Reply with quote

Sorry, I believe there is no point in dragging further.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group