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: 8704
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: 217
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: 1292
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 Can we call QMF proc from REXX ? batu544 CLIST & REXX 6 Fri Aug 03, 2018 11:03 am
No new posts REXX CGI - Hello World vasanthz All Other Mainframe Topics 4 Fri Jul 13, 2018 3:53 am
This topic is locked: you cannot edit posts or make replies. Rexx code to find greater then symobl... Bharath Vikraman CLIST & REXX 8 Tue May 29, 2018 9:40 am
No new posts Trap the jcl error message or maxcc i... ankita agarwal CLIST & REXX 5 Fri May 18, 2018 2:08 pm
No new posts Rexx command to open an another text ... Bharath Vikraman PC Guides & IT News 7 Sat May 12, 2018 4:34 pm

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