Page 2 of 2

Re: Rexx in Batch Mode - Clarification

PostPosted: Tue Mar 12, 2013 4:35 am
by enrico-sorichetti
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
http://ibmmainframes.com/about60269.html

and frankly there are too many errors

describe and understand the logic before staring the coding

Re: Rexx in Batch Mode - Clarification

PostPosted: Tue Mar 12, 2013 4:40 am
by Viswanathchandru
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.


Regards,
Viswa

Re: Rexx in Batch Mode - Clarification

PostPosted: Tue Mar 12, 2013 8:15 pm
by Ed Goodman
It seems like what you really meant is
IF IX = ISFLINE.0 THEN

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.

Re: Rexx in Batch Mode - Clarification

PostPosted: Tue Mar 12, 2013 9:38 pm
by Pedro
ELSE CALL MAIN   

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

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.