- Issue a message with two inserts where the first insert is known
at assembly time and the second is an 8-character name not known at
assembly time.
The code is as follows.
*************************************************************
* Issue a message with two inserts *
*************************************************************
SYSSTATE ARCHLVL=1 * save regs, get dynamic storage, chain saveareas,
MVC MGB_MsgIVal(L'Insert2Val),MyMod Insert value
DROP 3
ST 3,MGB_Inserts+4 Save insert address
HZSFMSG REQUEST=CHECKMSG,MGBADDR=TheMGBAddr, *
RETCODE=LRETCODE,RSNCODE=LRSNCODE, *
MF=(E,FMSGL)
DROP 2
*
* Place code to check return/reason codes here
*
* free dynamic storage, restore regs
BR 14
MyMod DC CL8'MYMODULE'
* Area for first insert
Insert1Area DS 0H
Insert1Len DC AL2(L'Insert1Val)
Insert1Val DC C'This is the first insert'
LTORG ,
HZSZCONS , Return code information
HZSMGB , Insert mapping
DYNAREA DSECT
LRETCODE DS F
LRSNCODE DS F
* Area for 2 inserts (HZSMGB_LEN accounts for one, so
* we add one more "length of MGB_Inserts")
TheMGBAddr DS A
TheMGBArea DS CL(HZSMGB_LEN+1*L'MGB_Inserts)
* Area for second insert
Insert2Area DS 0H
Insert2Len DS CL(L'MGB_MsgInsertD_Header)
Insert2Val DS CL(L'MyMod)
HZSFMSG MF=(L,FMSGL),PLISTVER=MAX
DYNAREA_LEN EQU *-DYNAREA