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
 
Looping REXX - unable to interrupt

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
RAVISANKAR07

New User


Joined: 05 Dec 2017
Posts: 1
Location: chennai

PostPosted: Wed Dec 06, 2017 12:38 pm    Post subject: Looping REXX - unable to interrupt
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: 8747
Location: Welsh Wales

PostPosted: Wed Dec 06, 2017 1:07 pm    Post subject:
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: 251
Location: Denmark

PostPosted: Wed Dec 06, 2017 3:01 pm    Post subject:
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: 1303
Location: Israel

PostPosted: Thu Dec 07, 2017 8:32 pm    Post subject:
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    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 How to process gdg in rexx program wh... pkmurali CLIST & REXX 11 Thu Dec 13, 2018 10:08 am
No new posts Need advise in calling DFSORT from REXX ajithajt CLIST & REXX 9 Thu Nov 29, 2018 10:50 am
No new posts Rexx on amod 24 shahaf CLIST & REXX 19 Thu Nov 29, 2018 1:07 am
No new posts Will this code extract 1 byte from fi... pkmurali CLIST & REXX 8 Sat Nov 10, 2018 11:13 pm
No new posts Error reading file in REXX module ashek15 CLIST & REXX 3 Wed Oct 24, 2018 4:50 am

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