ADELIA |
VADELIA |
SADELIA |
WADELIA |
MADELIA |
(I/B) |
(I/B) (C/S) |
(B) (S) |
(I/B) (C/S) |
(I) (C/S) |
Section for use
All
Syntax
MOVE_ON_RIGHT VarId1 VarId2
MOVE_ON_RIGHT 'Constant' VarId
MOVE_ON_RIGHT *ALL'X' VarId
Description
This instruction is used to:
Move the value of a field to another field, starting on the right side.
Transfer a numeric data item into an alphanumeric field, and vice versa.
Assign timestamp fields.
It can also be used to fill a field with the same character: *ALL 'character'.
Example
MOVE_ON_RIGHT FLD_1 FLD_2 |
||
|
||
* 1. If FLD_1 length is equal to FLD_2 length |
||
* 1.1 alpha to alpha |
FLD_1 = PH4SN |
FLD_2 = AKT4D |
* |
result for |
FLD_2 = PH4SN |
|
|
|
* 1.2 alpha to numeric |
FLD_1 = PH4SN |
FLD_2 = 56784 |
* |
result for |
FLD_2 = 78425- |
|
|
|
* 1.3 numeric to numeric |
FLD_1 = 78425- |
FLD_2 = 56784 |
* |
result for |
FLD_2 = 78425- |
|
|
|
* 1.4 numeric to alpha |
FLD_1 = 78425- |
FLD_2 = AKT4D |
* |
result for |
FLD_2 = 7842N |
|
|
|
* 2. if FLD_1 length is greater than FLD_2 length |
||
* 2.1 alpha to alpha |
FLD_1 = BRWCPH4SN |
FLD_2 = AKT4D |
* |
result for |
FLD_2 = PH4SN |
|
|
|
* 2.2 alpha to numeric |
FLD_1 = BRWCPH4SN |
FLD_2 = 56784 |
* |
result for |
FLD_2 = 78425- |
|
|
|
* 2.3 numeric to numeric |
FLD_1 = 1278425 |
FLD_2 = 56784 |
* |
result for |
FLD_2 = 78425 |
|
|
|
* 2.4 numeric to alpha |
FLD_1 = 1278425 |
FLD_2 = AKT4D |
* |
result for |
FLD_2 = 78425 |
|
|
|
* 3. If FLD_1 length is shorter than FLD_2 length |
||
* 3.1 alpha to alpha |
FLD_1 = PH4SN |
FLD_2 = 123456784 |
* |
result for |
FLD_2 = 1234PH4SN |
|
|
|
* 3.2 alpha to numeric |
FLD_1 = PH4SN |
FLD_2 = 123456784 |
* |
result for 1 |
FLD_2 = 123478425 |
|
|
|
* 3.3 numeric to numeric |
FLD_1 = 1278425 |
FLD_2 = 123456789 |
* |
result for |
FLD_2 = 121278425 |
|
|
|
* 3.4 numeric to alpha |
FLD_1 = 1278425 |
FLD_2 = ACFGPH4SN |
* |
result for |
FLD_2 = AC1278425 |
|
||
|
||
* Example with *ALL |
||
|
||
MOVE_ON_RIGHT *ALL'=' FLD_2 |
||
|
||
* FLD_2 = AKT4D |
result for |
FLD_2 = ===== |