MAPGET
The MAPGET
command is a request to parse
or convert a buffer into a specified data mapping previously defined
with the MAPDEF
command.
Format
Call Name | DB/DC | DBCTL | DCCTL | DB Batch | TM Batch |
---|---|---|---|---|---|
MAPGET | X | X | X | X | X |
Usage
The mapname variable name specifies the data mapping to use. It is a 1- to 16-character case-independent name. The buffer variable name is the REXX variable containing the data to parse.
Map names can also be specified
in the REXXTDLI calls in place of variable names to be set or written.
This step is called an implicit MAPGET
. Thus, the
explicit (or variable dependent) MAPGET
call can
be avoided. To indicate that a Map name is being passed in place of
a variable in the DL/I call, precede the name with an asterisk (*),
for example, 'GU IOPCB *INMAP'
.
Examples
Address REXXTDLI 'GU DBPCB SegVar'
If RC=0 Then Signal BadCall /* Check for failure */
Address REXXIMS 'MAPGET DBMAP SegVar'/* Decode Segment */
Say VAR_CODE /*Can now access any Map Variable */
Address REXXTDLI 'GU DBPCB *DBMAP' /* Read and decode segment if read*/
If RC=0 Then Signal BadCall /* Check for failure */
Say VAR_CODE /* Can now access any Map Variable*/
If
an error occurs during a MAPGET
, message DFS3172I
is issued. An error could occur when a Map is defined that is larger
than the input segment to be decoded or during a data conversion error
from packed or zoned decimal format. The program continues, and an
explicit MAPGET
receives a return code 4. However,
an implicit MAPGET
(on a REXXTDLI call, for example)
does not have its return code affected. Either way, the failing variable's
value is dropped by REXX.