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
--
int.ext: 91078
direct:
(937) 531-6378
home:
(937) 751-3300
Winsupply Group Services
3110 Kettering Boulevard
Dayton, Ohio 45439 USA
(937) 294-5331
*********************************************************************************************
This email message and any attachments is for use only by the named
addressee(s) and may contain confidential, privileged and/or proprietary
information. If you have received this message in error, please
immediately notify the sender and delete and destroy the message and all
copies. All unauthorized direct or indirect use or disclosure of this
message is strictly prohibited. No right to confidentiality or privilege
is waived or lost by any error in transmission.
*********************************************************************************************