MAPPUT
This MAPPUT command makes a request to
pack or concatenate variables from a specified Data Mapping, defined
by the MAPDEF command, into a single variable.
Format
| Call Name | DB/DC | DBCTL | DCCTL | DB Batch | TM Batch |
|---|---|---|---|---|---|
| MAPPUT | X | X | X | X | X |
Usage
The mapname variable name specifies the data mapping to use, a 1- to 16-character case-independent name. The buffer variable name is the REXX variable that will contain the resulting value.
Map names can also be
specified in the REXXTDLI call in place of variable names to be fetched
or read. This step is called an implicit MAPPUT and
lets you avoid the explicit MAPPUT call. To indicate
that a Map name is being passed in the DL/I call, precede the name
with an asterisk (*), for example, 'ISRT IOPCB *OUTMAP'.
MAPGET and MAPPUT calls,
whether they be explicit or implicit.Address REXXTDLI
'GHU DBPCB SegVar SSA1' /* Read segment */
If RC¬=0 Then Signal BadCall /* Check for failure */
Address REXXIMS 'MAPGET DBMAP SegVar' /* Decode Segment */
DBM_Total = DBM_Total + Deposit_Amount /* Adjust Mapped Variable */
Address REXXIMS 'MAPPUT DBMAP SegVar' /* Encode Segment */
'REPL DBPCB SegVar' /* Update Database */
If RC¬=0 Then Signal BadCall /* Check for failure */Address REXXTDLI
'GHU DBPCB *DBMAP SSA1' /* Read and decode segment if read */
If RC¬=0 Then Signal BadCall /* Check for failure */
DBM_Total = DBM_Total + Deposit_Amount /* Adjust Mapped Variable */
'REPL DBPCB *DBMAP' /* Update Database */
If RC¬=0 Then Signal BadCall /* Check for failure */MAPPUT, such as a Map field
defined larger than the variable's contents, then the field is truncated.
If the variable's contents are shorter than the field, the variable
is padded: - Character (C)
- Padded on right with blanks
- Character (V)
- Padded on right with zeros
- Numeric (B,Z,P)
- Padded on the left with zeros
If a MAP variable does not exist when a MAPPUT is
processed, the variable and its position are skipped. All undefined
and skipped fields default to binary zeros. A null parameter is parsed
normally. Conversion of non-numeric or null fields to numeric field
results in a value of 0 being used and no error.
