Rexx in Batch Mode - Clarification

IBM's Command List programming language & Restructured Extended Executor

Re: Rexx in Batch Mode - Clarification

Postby enrico-sorichetti » Tue Mar 12, 2013 4:35 am

no it will not ...
unfortunately the code posted is severely flawed

IX is an index ( integer number )
ISFLINE.0 is an integer telling how many ISFLINEs are there
so why compare a <data line> with a number

anyway after the end of the loop IX will contain ISFLINE.0 + 1
and it should raise the NOVALUE condition ... ... ...
the count of the END statements dies not match the number of the DO statements ... ... ...

why use a recursive CALL ... ... ...

wiser to rethink the whole logic

after the SDSF read

Address TSO "EXECIO " isfline.0 " DISKW <ddname> ( STEM ISFLINE. FINIS

will write all the ISFLOG lines without the need for any loop
see here why using the * for the EXECIO write is a BAD PRACTICE

and frankly there are too many errors

describe and understand the logic before staring the coding
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort

These users thanked the author enrico-sorichetti for the post:
Viswanathchandru (Tue Mar 12, 2013 4:37 am)
Global moderator
Posts: 2692
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 138 times

Re: Re: Rexx in Batch Mode - Clarification


Re: Rexx in Batch Mode - Clarification

Postby Viswanathchandru » Tue Mar 12, 2013 4:40 am

Hi Enrico,

Thank you so much for your explanation. Outstanding explanation given in the link that you pointed me to read.

In one sentence "The previous reply clearly shows how I understood the logics" Thanks for throwing light on this.

Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: Rexx in Batch Mode - Clarification

Postby Ed Goodman » Tue Mar 12, 2013 8:15 pm

It seems like what you really meant is

Otherwise, you are testing the content in the current line against the line count of the step.

On top of that, why do you need to loop at all? The DISKW with a * will write all of the lines in one shot.
Ed Goodman
Posts: 342
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: Rexx in Batch Mode - Clarification

Postby Pedro » Tue Mar 12, 2013 9:38 pm


I do not think you ever get passed IX=1. When you call MAIN again, it will start another loop with

which will set IX to 1. It will keep doing so forever and that is why your storage gets exhausted. That is the recursive loop that Enrico mentioned.

Rather than 'ELSE CALL MAIN', you need a RETURN statement so that it goes back to the caller. Every rexx subroutine needs a RETURN statement to get back to its caller.
Pedro Vera
User avatar
Posts: 575
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 41 times


Return to CLIST & REXX


  • Related topics
    Last post