UPDTMPB — Update a message parameter block for substitution data

Description

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.

Environment

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

Programming requirements

You must include the mapping macro CNLMMPB.

Restrictions

None.

Input register information

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.

Output register information

When control returns to the caller, the general purpose registers (GPRs) contain:
Register
Contents
0
Reason code
1
Used as a work register by system
2-13
Unchanged
14
Used as a work register by system
15
Return code

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.

Performance implications

None.

Syntax

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  
   

Parameters

The parameters are explained as follows:

MPBPTR=mpb addr
specifies the address or a register containing the address of the MPB to be modified.
,MPBLEN=mpb len addr
specifies the address or a register containing the address of the length of the area addressed by MPBPTR.
,SUBOOFST=new/changed blk offset addr
specifies the address of the area or a register into which UPDTMPB returns the value of the offset from the start of the MPB to the new or changed substitution block. A substitution block contains all the information that you need to format substitution data. It consists of a token field, token length, substitution length, token type, and substitution data.
,SUBCOFST=existing blk offset addr
specifies the address of the offset or a register containing the offset from the start of the MPB to the existing substitution block that UPDTMPB is to update. If you do not specify SUBCOFST, UPDTMBP will build a new substitution block.
,TOKEN=token name addr
specifies the address of the area or a register pointing to the area containing the substitution token name.
,TOKLEN=token length addr
specifies the address of the area or a register containing the length of the TOKEN field. If you do not specify TOKLEN, UPDTMPB uses, as a default, the length of the TOKEN field in the DSECT mapping. You must specify TOKLEN if you use register notation for the TOKEN keyword.
,TOKTYPE=token type addr
specifies the address of the area or a register containing the 1-byte token type. This field can have the following values and meanings:
Value Meaning
0 text
1 date
2 time
3 day of week
,SUBSDATA=sub data addr
specifies the address of the area or a register pointing to the area containing the substitution data.

If TOKTYPE is 0, SUBSDATA can contain any text with a length defined SUBSLEN.

If TOKTYPE is 1, SUBSDATA must be eight bytes long and in the format yyyymmdd, where:
  • yyyy is the year number, expressed as a 4-digit EBCDIC string in the range 0000 to 9999.
  • mm is the month number, expressed as a 2-digit EBCDIC string in the range 01 to 12.
  • dd is the day number, expressed as a 2-digit EBCDIC string in the range 01 to 31.
If TOKTYPE is 2, SUBSDATA must be twelve bytes long in the format hhmmssdddddd, where:
  • hh is the hours in a 24-hour clock, expressed as a 2-digit EBCDIC string in the range 00 to 23.
  • mm is the minutes, expressed as a 2-digit EBCDIC string in the range 00 to 59.
  • ss is the seconds, expressed as a 2-digit EBCDIC string in the range 00 to 59. EBCDIC blanks are considered zeros.
  • dddddd is the decimal seconds, expressed as a 6-digit EBCDIC string in the range 000000 to 999999. EBCDIC blanks are considered zeros.

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.

,SUBSLEN=sub data length addr
specifies the address of the area or a register pointing to the area containing the length of the substitution data. If you do not specify SUBSLEN, UPDTMPB uses, as a default, the length of the SUBSDATA field in the DSECT mapping. You must specify SUBSLEN if you use register notation for the SUBSDATA parameter.

Return and reason codes

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.

Example

Build and update an MPB for a message that contains substitution data for the third day of the week.
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