Dave,

I used MODCB extensively in the past and it served me well.

The case you're describing may make that approach rather unwieldy.

As suggested before, you might consider using the mapping macro
(IFGRPL if I recall correctly off the top of my head) and address the RPL
fields and masks directly.

The drawback is that you will have to know and understand the
layout and workings of the RPL. You're skipping all sanity checks
that MODCB would implement for you.
Also, if anything changes in the RPL structure, your program will
at least need to be re-assembled.

It is up to you to guesstimate how much of a risk that poses to you ...

Kind regards,
Abe Kornelis
===========




Op 24/02/2022 om 17:33 schreef Dave Clark:
>         This isn't strictly an Assembler question -- more of a "How to 
> Modify a VSAM RPL Efficiently in Assembler" type of question.  But...
>
>         The reason I say "efficiently" is because of the dynamic nature of 
> this external assembler REXX function I am working on. Unlike a high-level 
> compiler that knows what is needed before a particular READ request and 
> can create a single MODCB RPL request at that point, I have a nested IF 
> situation before my GET request that is a bit of a nightmare to say the 
> least and is a program size hog to say the most.
>
>         In particular, I have 18 MODCB RPL requests just before my GET 
> request.  This is because the caller may have requested an OPEN and then a 
> READ request that has the following different option combinations.
>
> Call RXVSAMIO ddname, 'OPEN'
>                       <, 'INPUT'|'UPDATE'|'OUTPUT'|'APPEND'|'RESET'
>                       <, 'SEQUENCE'|'RANDOM'|'DYNAMIC' > >;
>
> Call RXVSAMIO ddname, 'READ'
>                       <, 'NEXT'|'PREV'
>                         |'RBA'|'KEY' <, 'EQUAL'|'GTEQ' > >;
>
>         I asked this question on the VSE listserve and got the hint to use 
> the MF=(L,...) and MF=(E,...) macro parameters to separate configuration 
> of the parameter list from the execution of that parameter list.  That 
> helped a bit to reduce the program size.  However, each MODCB MF=(L,...) 
> request still generates its own in-line parameter list template (ACES) 
> that "wastes" 20 to 22 bytes before using another 10 bytes to copy the 
> 16-byte ACES to the dynamic storage parameter list area I have provided. 
> And that's just the 18 combinations that I have before the GET request -- 
> not to mention a similar (though smaller) nested IF before the POINT 
> request.
>
>         So, finally, here is the question...  Is there some assembler 
> technique to further reduce the storage requirements of the following 
> sequence of instructions?  For example...  Is there some way to build the 
> OPTCD value in a separate string and then pass it to a single iteration of 
> the MODCB MF=(L,...) invocation?
>
> 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 
>  IF  RQARG2,EQ,C'K'           GET BY KEY 
>   IF RQARG3,EQ,C'G'            GTEQ 
>    IF FILEOPT,(ON,TM),FILESEQU  IF ACCESS IS SEQUENTIAL 
>     IF FILEOPT,(ON,TM),FILEUPDT  IF OPENED FOR UPDATE 
>      MODCB MF=(L,PARMLIST),RPL=(*,FILERPL), 
>      OPTCD=(KEY,KGE,SEQ,FWD,UPD) 
>     ELSE 
>      MODCB MF=(L,PARMLIST),RPL=(*,FILERPL), 
>      OPTCD=(KEY,KGE,SEQ,FWD,NUP) 
>     ENDIF 
>    ELSE                         ACCESS IS DIRECT 
>     IF FILEOPT,(ON,TM),FILEUPDT  IF OPENED FOR UPDATE 
>      MODCB MF=(L,PARMLIST),RPL=(*,FILERPL), 
>      OPTCD=(KEY,KGE,DIR,FWD,UPD) 
>     ELSE 
>      MODCB MF=(L,PARMLIST),RPL=(*,FILERPL), 
>      OPTCD=(KEY,KGE,DIR,FWD,NSP) 
>     ENDIF 
>    ENDIF 
>   ELSE                         EQUAL 
>    IF FILEOPT,(ON,TM),FILESEQU  IF ACCESS IS SEQUENTIAL 
>     IF FILEOPT,(ON,TM),FILEUPDT  IF OPENED FOR UPDATE 
>      MODCB MF=(L,PARMLIST),RPL=(*,FILERPL), 
>      OPTCD=(KEY,KEQ,SEQ,FWD,UPD) 
>     ELSE 
>      MODCB MF=(L,PARMLIST),RPL=(*,FILERPL), 
>      OPTCD=(KEY,KEQ,SEQ,FWD,NUP) 
>     ENDIF 
>    ELSE                         ACCESS IS DIRECT 
>     IF FILEOPT,(ON,TM),FILEUPDT  IF OPENED FOR UPDATE 
>      MODCB MF=(L,PARMLIST),RPL=(*,FILERPL), 
>      OPTCD=(KEY,KEQ,DIR,FWD,UPD) 
>     ELSE 
>      MODCB MF=(L,PARMLIST),RPL=(*,FILERPL), 
>      OPTCD=(KEY,KEQ,DIR,FWD,NSP) 
>     ENDIF 
>    ENDIF 
>   ENDIF 
>  ELSE 
>   IF RQARG2,EQ,C'P'           GET PREV 
>    IF  FILEOPT,(ON,TM),FILEUPDT  IF OPENED FOR UPDATE 
>     MODCB MF=(L,PARMLIST),RPL=(*,FILERPL),OPTCD=(SEQ,BWD,UPD)
>    ELSE 
>     IF FILEOPT,(ON,TM),FILESEQU   IF ACCESS IS SEQUENTIAL 
>     MODCB MF=(L,PARMLIST),RPL=(*,FILERPL),OPTCD=(SEQ,BWD,NUP)
>     ELSE                          ACCESS IS DIRECT 
>     MODCB MF=(L,PARMLIST),RPL=(*,FILERPL),OPTCD=(SEQ,BWD,NSP)
>     ENDIF 
>    ENDIF 
>   ELSE                        GET BY RBA 
>    IF FILEOPT,(ON,TM),FILESEQU  IF ACCESS IS SEQUENTIAL 
>     IF FILEOPT,(ON,TM),FILEUPDT  IF OPENED FOR UPDATE 
>      MODCB MF=(L,PARMLIST),RPL=(*,FILERPL), 
>      OPTCD=(ADR,SEQ,FWD,UPD) 
>     ELSE 
>      MODCB MF=(L,PARMLIST),RPL=(*,FILERPL), 
>      OPTCD=(ADR,SEQ,FWD,NUP) 
>     ENDIF 
>    ELSE                         ACCESS IS DIRECT 
>     IF FILEOPT,(ON,TM),FILEUPDT  IF OPENED FOR UPDATE 
>      MODCB MF=(L,PARMLIST),RPL=(*,FILERPL), 
>      OPTCD=(ADR,DIR,FWD,UPD) 
>     ELSE 
>      MODCB MF=(L,PARMLIST),RPL=(*,FILERPL), 
>      OPTCD=(ADR,DIR,FWD,NSP) 
>     ENDIF 
>    ENDIF 
>   ENDIF 
>  ENDIF 
> ENDIF 
> PUSH ACONTROL 
> ACONTROL FLAG(NOPAGE0) 
> MODCB MF=(E,PARMLIST)         MODIFY THE RPL 
> POP  ACONTROL 
> IF   R15,(NZ,LTR),R15         IF FAILED 
>  MVC MACRO,=CL8'MODCB/R'       INDICATE OPERATION PERFORMED
>  ST  R0,SAVE_R0                SAVE REGISTER 0 
>  OI  OPTFLAG,CTLBLKF           SIGNAL ERROR IN CTLBLK 
>  BAS R5,SHOWRESN               PASS BACK RTN AND RSN CODES 
>  LHI R5,16                     SET RETURN CODE 
>  B   RETERR                    GO RETURN ERROR 
> ENDIF                         ENDIF 
>
>
> Sincerely,
>
> Dave Clark

Reply via email to