On Wed, 30 Dec 2015 22:25:49 +0000, Ze'ev Atlas <zatl...@yahoo.com> wrote:

>Hi AllI have a Rexx program and here is the relevant snippet:
>THEMEMBER = THEPDS || "(" || MEMBER || ")"       /*say themember */            
>                   "alloc shr file(input) dataset(" THEMEMBER ")"   "execio * 
>diskr input (stem input. finis)"       IF RC \= 0 THEN                         
>            call DIE 'READ MEMBER failed' RC              say member input.0 
>"LINES READ"                  "free file(input)"                               
>"EXECIO" input.0 "DISKW XXOUT (STEM INPUT."      IF RC \= 0 THEN               
>                      call DIE 'WRITE MEMBER failed' RC             
>Originally, I had "EXECIO * DISKW XXOUT (STEM INPUT."  
>but that would work only for members that had statistics (i.e. have been 
>updated).  When I changed the '*' to input.0 it works fine.  Is that a normal 
>behavior?  (I ran on z/OS 2.2! Ze'ev Atlas

According to the TSO REXX Reference, if "*" is used with DISKW and a STEM, then 
stem.0 is ignored and it writes stem. records until it finds either a null 
record or an uninitialized stem value.  For example, it you read a member of a 
PDS into STEM mem. and the member contained 100 records, (mem.0 = 100), then 
you wrote the stem to another member or file with EXECIO * DISKW and (STEM 
MEM., it would write 100 records to the file, (mem.101 is not set).  If you now 
read a PDS member with 90 records into the same stem name, (mem.0 = 90), and 
you wrote it out with EXECIO * DISKW and (STEM MEM., then it would write the 90 
records from the current member and the last 10 records from the previous 
member!  Not good!

It would be best to use "EXECIO" mem.0 "DISKW" instead of "*" or to "Drop mem." 
after the write and before the next read.  If the REXX program is processing a 
lot of members, it may be a good idea to do both, because dropping the stem 
will free up storage.

-- 
Dale R. Smith

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to