On Thu, 24 Feb 2022 at 11:33, Dave Clark <dlcl...@winsupplyinc.com> wrote:
[...]

> IF   RQARG2,EQ,C'N'           GET NEXT
>  IF  FILEOPT,(ON,TM),FILEUPDT  IF OPENED FOR UPDATE
>   MODCB MF=(L,PARMLIST),RPL=(*,FILERPL),OPTCD=(SEQ,FWD,UPD)
>  ELSE
>   IF FILEOPT,(ON,TM),FILESEQU   IF ACCESS IS SEQUENTIAL
>    MODCB MF=(L,PARMLIST),RPL=(*,FILERPL),OPTCD=(SEQ,FWD,NUP)
>   ELSE                          ACCESS IS DIRECT
>    MODCB MF=(L,PARMLIST),RPL=(*,FILERPL),OPTCD=(SEQ,FWD,NSP)
>   ENDIF
>  ENDIF
> ELSE
>
[...]

I would avoid MODCB like the plague. It has not been significantly updated
for decades, and can't even do many of the things you'd probably want. On
top of that, there are performance issues (though probably not huge) with
calling an external routine to do what you can do directly yourself. MODCB
was a nice idea, but the implementation was never up to the theory.

As I see while writing this, just doing it yourself by updating IFGRPL
fields has already been suggested. I agree. The thing to keep in mind is
validating the input so that what you change in the RPL is not invalid or
inconsistent. (In theory MODCB should take care of this, but I don't think
it'll produce a message or return code sufficient to make the problem
clear.) You can try to validate as you go (e.g. in your code above but
without the MODCBs), or you can do a validation pass first, and only when
you're sure you have a correct set of things to do, do them.

Tony H.

Reply via email to