View previous topic :: View next topic
|
Author |
Message |
RAVISANKAR07
New User
Joined: 05 Dec 2017 Posts: 2 Location: chennai
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
@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 |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 734 Location: Denmark
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
|