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: 8619
Location: Back in jolly old England

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: 186
Location: Switzerland

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: 1252
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 Unable to send mail with SMTP commands harsh.saxena579 JCL & VSAM 10 Tue Dec 12, 2017 1:58 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 unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

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