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

Looping REXX - unable to interrupt


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

New User


Joined: 05 Dec 2017
Posts: 2
Location: chennai

PostPosted: Wed Dec 06, 2017 12:38 pm
Reply with quote

For the below rexx code,loop is not terminating and its showing bulk ds's.Hence it's difficult to end the loop...
Code:

      DO N=1 FOR LISTCAT.0                           
             IF WORD(LISTCAT.N,1)= "NONVSAM" THEN ,   
             PDSLIST.N= WORD(LISTCAT.N,3)             
         END                                         
                                                     
      DO X=1 TO LISTCAT.0                             
       PDSLIST.X=STRIP(PDSLIST.X)                     
     IF SUBSTR(PDSLIST.X,1,8)="PDSLIST." THEN         
       NOP                                           
       ELSE                                           
       SAY PDSLIST.X                                 
     END                                             
EXIT
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Dec 06, 2017 1:07 pm
Reply with quote

@RAVISANKAR07
And the relevance to the topic that you tagged this onto is ? apart from it being REXX related.
If you have a new problem then start a new topic, not add on to one that was started over 10 years ago. Not only is it clearer to other users but it also saves me the time and effort of splitting it off.

Also, please use the code tags - not difficult as you can see

Code:
[code]
Your stuff here
[/code]


Have you tried the "Esc" key ?

Maybe it's just me, but your use of the same index for two different stems seems waaaaaaaaaay crazy.

Maybe, just maybe if you explain exactly what it is that you are trying to achieve that we can point you in the direction of something on the forum that already exists.
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 448
Location: Denmark

PostPosted: Wed Dec 06, 2017 3:01 pm
Reply with quote

Quote:
DO N=1 FOR LISTCAT.0

Use 'TO' instead of 'FOR'.
I have had situations where the only way to terminate a loop was to cancel the session, but usually the ATTN or PA1 key should do the trick. Sometimes you have to hit the key more than once.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1348
Location: Israel

PostPosted: Thu Dec 07, 2017 8:32 pm
Reply with quote

Why do you need 2 loops for this ?
Code:
      DO X = 1 TO LISTCAT.0
         IF WORD(LISTCAT.X,1) = "NONVSAM" &,
            SUBSTR(WORD(LISTCAT.X,3),1,8) \= "PDSLIST." THEN         
            SAY LISTCAT.X                                 
      END
or
Code:
      DO X = 1 TO LISTCAT.0
         PARSE VAR LISTCAT.X W1 W2 W3 .
         IF W1 = "NONVSAM" & LEFT(W3,8) \= "PDSLIST." THEN         
            SAY LISTCAT.X                                 
      END

Quote:
loop is not terminating and its showing bulk ds's

What is the value of LISTCAT.0 ? Maybe a few hundred lines look like forever, specially if you have to hit ENTER every 32 lines...
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 rexx pgm to create multiple ps file IBM Tools 7
No new posts Mainframe batch Job or REXX to get VT... CLIST & REXX 7
No new posts calling OMEGAMON from REXX CLIST & REXX 3
No new posts Unable to retrieve Datasets Names usi... CLIST & REXX 20
No new posts REXX allocated datasets in JCL CLIST & REXX 9
Search our Forums:

Back to Top