To build a message parameter block (MPB), you must issue both BLDMPB and UPDTMPB. BLDMPB initializes the MPB, and UPDTMPB adds one substitution token to the MPB each time you issue it. Issue UPDTMPB once for each substitution token in the message.
You can also use UPDTMPB to replace or change the value of a particular substitution token in an existing MPB. See z/OS MVS Programming: Assembler Services Guide for more information on using UPDTMPB.
The requirements for the caller are:
Environmental factor | Requirement |
---|---|
Minimum authorization: | Problem state and any PSW key |
Dispatchable unit mode: | Task or SRB |
Cross memory mode: | PASN=HASN=SASN or PASN¬=HASN¬=SASN |
AMODE: | 24- or 31-bit |
ASC mode: | Primary |
Interrupt Status: | Enabled for I/O and external interrupts |
Locks: | No locks held |
Control parameters: | Not applicable |
You must include the mapping macro CNLMMPB.
None.
Before issuing the UPDTMPB macro, the caller does not have to place any information into any register unless using it in register notation for a particular parameter, or using it as a base register.
Some callers depend on register contents remaining the same before and after issuing a service. If the system changes the contents of registers on which the caller depends, the caller must save them before issuing the service, and restore them after the system returns control.
None.
The UPDTMPB macro is written as follows:
Syntax | Description |
---|---|
name | name: Symbol. Begin name in column 1. |
␢ | One or more blanks must precede UPDTMPB. |
UPDTMPB | |
␢ | One or more blanks must follow UPDTMPB. |
MPBPTR=mpb addr | mpb addr: RX-type address or register (2) - (12). |
,MPBLEN=mpb length addr | mpb length addr: RX-type address or register (2) - (12). |
,SUBOOFST=new/changed blk offset addr | new/changed blk offset addr: RX-type address or register (2) - (12). |
,SUBCOFST=existing blk | existing blk offset addr: RX-type address or register (2) - 12). |
offset addr | |
,TOKEN=token name addr | token name addr: RX-type address or register (2) - (12). |
,TOKLEN=token length addr | token length addr: RX-type address or register (2) - (12). |
,TOKTYPE=token type addr | token type addr: RX-type address or register (2) - (12). |
,SUBSDATA=sub data addr | sub data addr: RX-type address or register (2) - (12). |
,SUBSLEN=sub data length | sub data length addr: RX-type address or register (2) - (12). |
addr | |
The parameters are explained as follows:
Value | Meaning |
---|---|
0 | text |
1 | date |
2 | time |
3 | day of week |
If TOKTYPE is 0, SUBSDATA can contain any text with a length defined SUBSLEN.
If TOKTYPE is 3, SUBSDATA must be one byte long in the format d, where d is the day number, expressed as a 1-digit EBCDIC string in the range 1 to 7. The days are defined in parmlib member CNLcccxx. Day 1 is Sunday, 2 is Monday, and so on.
When UPDTMPB completes, register 15 contains one of the following hexadecimal return codes:
Hexadecimal Return Code | Meaning |
---|---|
00 | Processing completed successfully. |
0C | Processing unsuccessful. See reason codes. |
When UPDTMPB completes, register 0 contains one of the following hexadecimal reason codes:
Hexadecimal Return Code | Hexadecimal Reason Code | Meaning |
---|---|---|
00 | 00 | Successful processing. |
0C | 33 | There is insufficient storage in the MPB. |
0C | 35 | The value for TOKLEN is either zero or negative. |
0C | 36 | The value for SUBSLEN is negative. |
0C | 37 | The TOKTYPE value is not valid. |
0C | 38 | SUBCOFST is not valid. |
0C | 3B | The MPB acronym is not valid. |
BLDMPBA CSECT
BLDMPBA AMODE 31
BLDMPBA RMODE ANY
STM 14,12,12(13)
BALR 12,0
USING *,12
ST 13,SAVE+4
LA 15,SAVE
ST 15,8(13)
LR 13,15
***********************************************************************
* OBTAIN WORKING STORAGE AREA *
***********************************************************************
GETMAIN RU,LV=STORLEN,SP=SP230
LR R4,R1
*
***********************************************************************
* CREATE MPB HEADER SECTION *
***********************************************************************
*
BLDMPB MPBPTR=(R4),MPBLEN=MPBL,MSGID=MSGID, X
MSGIDLEN=MIDLEN
*
***********************************************************************
* ADD SUBSTITUTION DATA TO MPB *
***********************************************************************
*
LR R2,R4
A R2,MPBL
USING VARS,R2
*
UPDTMPB MPBPTR=(R4),MPBLEN=MPBL,SUBOOFST=VARS, X
TOKEN=TOKN,TOKLEN=TOKL,TOKTYPE=TOKT, X
SUBSDATA=SDATA,SUBSLEN=SDATAL
*
*
***********************************************************************
* FREE STORAGE AREA *
***********************************************************************
*
FREEMAIN RU,LV=STORLEN,SP=SP230,A=(4)
*
L 13,SAVE+4
LM 14,12,12(13)
BR 14
***********************************************************************
MPBL DC A(MPBLEN)
MSGID DC CL10'MSGID2'
MIDLEN DC A(MIDL)
TOKN DC CL3'DAY'
TOKL DC F'3'
TOKT DC CL1'3'
SDATA DC CL1'3'
SDATAL DC A(SDL)
SAVE DC 18F'0'
SP230 EQU 230
STORLEN EQU 256
SDL EQU 6
MIDL EQU 6
MPBLEN EQU (MPBVDAT-MPB)+(MPBMID-MPBMSG)+(MPBSUB-MPBSB)+MIDL+SDL
R1 EQU 1
R2 EQU 2
R4 EQU 4
***********************************************************************
DSECT
CNLMMPB
VARS DSECT
VARSAREA DS CL24
VARSLEN EQU *-VARS
END BLDMPBA