On Thu, 19 Jan 2017, at 15:26, Paul Gilmartin wrote:

> Relevant code:
> 
> trace Err
> address 'MVS'
> /* Allocate to create file.  */
> say  BPXWDYN( "ALLOC FI(INOUTDD) recfm(V,B) lrecl(999) blksize(1111)" ,
>     "filedata(text) path('/tmp/"userid()"/testru')" ,
>     "pathopts(ORDWR,OCREAT,OTRUNC) pathmode(SIRUSR,SIWUSR)" ,
>     "REUSE msg(2)" )
> /* Populate INOUTDD */
> do I = 1 to 50
>    OutRec.I = 'Record' right( I, 3 ) copies( 'x', I ) 'TSOREXX' ,
>        'more stuff';  end
> 'execio  3 DISKW INOUTDD (finis stem OutRec.'
> 
> /* Allocate to process file.  */
> say  BPXWDYN( "ALLOC FI(INOUTDD) recfm(V,B) lrecl(999) blksize(1111)" ,
>     "filedata(text) path('/tmp/"userid()"/testru')" ,
>     "pathopts(ORDWR)               pathmode(SIRUSR,SIWUSR)" ,
>     "REUSE msg(2)" )
> call Show 'Before'

Your output shown below shows that the file contains three records, but
you've not told us
how the 'Show' function works.  Presumably it read the file... but did
it close it afterwards?
If not the read pointer would presumably be at the last record of the
file now... so I'd expect
the "execio 1 diskru"... in the net block of code to fail, because
you're already at EOF.

Having said that I know nothing at all about use of rexx with unix
files.

I'm curious though, how in this code:


> readcnt = 0                           /* Initialize rec read cntr     */
> updtcnt = 0                           /* Initialize rec update cntr   */
> error = 0                             /* Initialize flag              */
> EOF = 0                               /* Initialize flag              */
> say; say 'Updating ------------------'
> do while (EoF=0 & error=0)            /* Loop while more records and
>                                          no error */
>   "execio 1 DISKRU INOUTDD (STEM inrec."     /* Read a record         */


you'd expect the   EOF  or  error  flags ever to get changed.


-- 
Jeremy Nicoll - my opinions are my own.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to