Outlining propagation behavior
This section describes how to work with alphanumeric- and numeric-type propagation.
Rules: The X characters to propagate in the original field to be propagated must be present in the new propagated field.
- There may be other characters in the field to be propagated.
- There may be other characters in the propagated field.
- The field to propagate must contain X characters to be propagated.
- The propagated field cannot be smaller than the number of characters to be propagated and must keep all the characters to be propagated.
The alphanumeric type of propagation ‘C’ must follow 5 characters (making up a code).
The instructions, as shown in the table below, use the operation codes RPG MOVEL (allocated on the left) and MOVE (allocated on the right).
A(5) = Alphanumeric of 5.
P(5) = Packed numeric on 5.
Field to propagate and field format | Propagated field | Instruction | Result field format and propagation | Y/N |
---|---|---|---|---|
RPCOD A(5) ‘C4c’ | WPCOD A(5) | MOVEL RPCOD WPCOD | ‘C4c’ | Y |
WPCOD A(5) ‘C4c’ | XPCOD A(5) | MOVEL XPCOD WPCOD | ‘C4c’ | Y |
RPCOD A(5) ‘C4c’ | APZON A(8) | MOVEL RPCOD APZON | ‘C4c3.’ | Y |
RPCOD A(5) ‘C4c’ | BPZON A(8) | MOVE RPCOD BPZON | ‘3.C4c’ | Y |
RPCOD A(5) ‘C4c’ | CPZON A(4) | MOVEL RPCOD CPZON | ‘C3c’ | N |
RPCOD A(5) ‘C4c’ | DPZON P(5) | MOVEL RPCOD DPZON | ‘C4c’ | Y |
RPCOD A(5) ‘C4c’ | EPZON P(8) | MOVE RPCOD EPZON | ‘…C4c’ | Y |
Whether the propagated field is alphanumeric or numeric, the characters are propagated in a precise manner without reduction or enlargement of the number of propagated characters.
Rules: A minimum number of characters to propagate, present in the original field to be propagated, must be present in the new propagated field (but not always the first ones).
If the propagated field is declared as a numeric field, we can consider that the entire field is propagated.
- There may be other characters in the field to be propagated (if it is alphanumeric).
- All the characters in the field to propagate are to be propagated (if it is numeric).
- There may be other characters in the propagated field (if it is alphanumeric).
- All the characters in the propagated field are related to the letter (if it is numeric).
- The field to be propagated contains at least the minimum number of characters to be propagated.
- The propagated field contains at least the minimum number of characters to propagate.
The alphanumeric type of propagation ‘R’ must follow a numeric field with a length varying between the different fields (but having at least 3 characters).
The instructions, as shown in the table below, use the operation codes RPG MOVEL (allocated on the left) and MOVE (allocated on the right) and Z-ADD numeric allocation.
Field to propagate and field format | Propagated field | Instruction | Result field format and propagation | Y/N |
---|---|---|---|---|
RPVAL P(5) ‘R4r’ | WPVAL P(5) | MOVEL RPVAL WPVAL | ‘R4r’ | Y |
RPVAL P(5) ‘R4r’ | XPVAL P(7) | Z-ADD RPVAL XPVAL | ‘R6r’ | Y |
RPVAL P(5) ‘R4r’ | YPVAL P(4) | Z-ADD YPVAL RPVAL | ‘R3r’ | Y |
RPVAL P(5) ‘R4r’ | ZPVAL P(2) | Z-ADD RPVAL ZPVAL | ‘Rr’ | N |
RPVAL P(5) ‘R4r’ | APVAL A(7) | MOVE RPVAL APVAL | ‘..R4r’ | Y |
RPVAL P(5) ‘R4r’ | BPVAL A(4) | MOVEL RPVAL BPVAL | ‘R3r’ | Y |
APVAL A(7) ‘..R4r’ | CPVAL A(10) | MOVEL APVAL CPVAL | ‘..R4r3.’ | Y |
APVAL A(7) ‘..R4r’ | DPVAL P(7) | MOVEL APVAL DPVAL | ‘R6r’ | Y |
When the propagated field is numeric, it is considered as propagated on all of its characters (digits in this case).