|
|
The SWSAPRCV FunctionRelated Topics
The REXX-language SWSAPRCV built-in function can be used to continue receiving message output from an IMS transaction (i.e. multi-segment output messages). Once you receive a non-zero return code, the IMS conversation is deallocated and the transaction is complete. In the case of conversational IMS transactions, the non-zero return code will indicate that their is no more data to receive. Upon return from the call, the following Rexx variables are populated with data:
SWSAPRCV SyntaxThe general form for a REXX-language invocation of SWSAPRCV is:
rc = SWSAPRCV("Connection Type", ,
"Conversation ID", ,
"Partner LU Name")
SWSAPRCV Examples
/*-------------------------------------------------------------*/
/* initialize some system values */
/*-------------------------------------------------------------*/
address SWSSEND
imsappc = 'P390.P392AIMS'
imstran = 'NEONDISP'
parms = ''
/*-------------------------------------------------------------*/
/* Retrieve more data from the IMS transaction */
/*-------------------------------------------------------------*/
rc = SWSAPRCV('ims',APPC.CONVID,imsappc)
/*-------------------------------------------------------------*/
/* parse the output into usable variables */
/*-------------------------------------------------------------*/
pars.msg = substr(APPC.OUTBUFF.1,1,79)
pars.page = substr(APPC.OUTBUFF.1,80,2)
pars.index = substr(APPC.OUTBUFF.1,82,2)
pars.scroll = substr(APPC.OUTBUFF.1,84,150)
pars.area = substr(APPC.OUTBUFF.1,234,380)
pars.len = 380
pars.data = ''
do i = 1 to 10
pars.part.i = substr(pars.area,4,15)
pars.desc.i = substr(pars.area,19,20)
pars.len = pars.len - 38
pars.area = substr(pars.area,39,pars.len)
pars.data = pars.data||' '||pars.part.i||pars.desc.i
end
|