The MOVE operation transfers characters from factor 2 to the result
field. Moving starts with the rightmost character of factor 2.
When moving Date, Time or Timestamp data,
factor 1 must be blank unless either the source or the target is a
character or numeric field.
Otherwise, factor 1 contains the date or time format compatible
with the character or numeric field that is the source or target of
the operation. For information on the formats that can be used see Date Data Type, Time Data Type, and Timestamp Data Type.
If the source or target is a character field, you may optionally
indicate the separator following the format in factor 1. Only separators
that are valid for that format are allowed.
If factor 2 is *DATE or UDATE and the result is a Date field, factor
1 is not required. If factor 1 contains a date format it must be compatible
with the format of *DATE or UDATE as specified by the DATEDIT keyword
on the control specification.
When moving character, graphic, UCS-2, or numeric
data, if factor 2 is longer than the result field, the excess
leftmost characters or digits of factor 2 are not moved. If the result
field is longer than factor 2, the excess leftmost characters or digits
in the result field are unchanged, unless padding is specified.
You cannot specify resulting indicators if the result field is
an array; you can specify them if it is an array element, or a non-array
field.
If factor 2 is shorter than the length of the result field, a P
specified in the operation extender position causes the result field
to be padded on the left after the move occurs.
Float numeric fields and literals are not allowed as Factor 2 or
Result-Field entries.
If CCSID(*GRAPH : IGNORE) is specified or assumed for the module,
MOVE operations between UCS-2 and graphic data are not allowed.
When moving variable-length character, graphic,
or UCS-2 data, the variable-length field works in exactly the
same way as a fixed-length field with the same current length. A MOVE operation does not change the length of a variable-length
result field. For examples, see Figures Figure 5 to Figure 10. The
graphic literals in this examples are not valid graphic literals.
See Graphic Format for more information.
The tables which appear following the examples, show how data is
moved from factor 2 to the result field. For further information on
the MOVE operation, see Move Operations or Conversion Operations.
Table 1. Moving a Character Field to a Date-Time
Field. Factor 1 specifies the format of the Factor 2 entry
Factor 1
Entry
Factor 2
(Character)
Result
Field
Value
DTZ Type
*MDY-
11-19-75
75/323
D(*JUL)
*JUL
92/114
23/04/92
D(*DMY)
*YMD
14/01/28
01/28/2014
D(*USA)
*YMD0
140128
01/28/2014
D(*USA)
*USA
12/31/9999
31.12.9999
D(*EUR)
*ISO
2036-05-21
21/05/36
D(*DMY)
*JUL
45/333
11/29/1945
D(*USA)
*MDY/
03/05/33
03.05.33
D(*MDY.)
*CYMD&
121 07 08
08.07.2021
D(*EUR)
*CYMD0
1210708
07,08,21
D(*MDY,)
*CMDY.
107.08.21
21-07-08
D(*YMD-)
*CDMY0
1080721
07/08/2021
D(*USA)
*LONGJUL-
2021-189
08/07/2021
D(*EUR)
*HMS&
23 12 56
23.12.56
T(*ISO)
*USA
1:00 PM
13.00.00
T(*EUR)
*EUR
11.10.07
11:10:07
T(*JIS)
*JIS
14:16:18
14.16.18
T(*HMS.)
*ISO
24.00.00
12:00 AM
T(*USA)
Blank
1991-09-14-13.12.56.123456
1991-09-14-13.12.56.123456
Z(*ISO)
*ISO
1991-09-14-13.12.56.123456
1991-09-14-13.12.56.123456
Z(*ISO)
Table 2. Moving a Numeric Field to a Date-Time
Field. Factor 1 specifies the format of the Factor 2 entry
Factor 1
Entry1
Factor 2
(Numeric)
Result
Field
Value
DTZ Type
*MDY
111975
75/323
D(*JUL)
*JUL
92114
23/04/92
D(*DMY)
*YMD
140128
01/28/2014
D(*USA)
*USA2
12319999
31.12.9999
D(*EUR)
*ISO
20360521
21/05/36
D(*DMY)
*JUL
45333
11/29/1945
D(*USA)
*MDY
030533
03.05.33
D(*MDY.)
*CYMD
1210708
08.07.2021
D(*EUR)
*CMDY
1070821
21-07-08
D(*YMD-)
*CDMY
1080721
07/08/2021
D(*USA)
*LONGJUL
2021189
08/07/2021
D(*EUR)
*USA
*DATE (092195)3
1995-09-21
D(*JIS)
Blank
*DATE (092195)3
1995-09-21
D(*JIS)
*MDY
UDATE (092195)3
21.09.1995
D(*EUR)
*HMS
231256
23.12.56
T(*ISO)
*EUR
111007
11:10:07
T(*JIS)
*JIS
141618
14.16.18
T(*HMS.)
*ISO
240000
12:00 AM
T(*USA)
Blank4
19910914131256123456
1991-09-14-13.12.56.123456
Z(*ISO)
Note:
A separator of zero (0) is not allowed in factor 1 for movement
between date, time or timestamp fields and numeric classes.
Time format *USA is not allowed for movement between time and
numeric classes.
For *DATE and UDATE, assume that the job date in the job description
is of *MDY format and contains 092195. Factor 1 is optional and will
default to the correct format. If factor 2 is *DATE, and factor 1
is coded, it must be a 4-digit year date format. If factor 2 is UDATE,
and factor 1 is coded, it must be a 2-digit year date format.
For moves of timestamp fields, factor 1 is optional. If it is
coded it must be *ISO or *ISO0.
Table 3. Moving a Date-Time Field to a
Character Field
Factor 1
Entry
Factor 2
Result Field
(Character)
Value
DTZ Type
*JUL
11-19-75
D(*MDY-)
75/323
*DMY-
92/114
D(*JUL)
23-04-92
*USA
14/01/28
D(*YMD)
01/28/2014
*EUR
12/31/9999
D(*USA)
31.12.9999
*DMY,
2036-05-21
D(*ISO)
21,05,36
*USA
45/333
D(*JUL)
11/29/1945
*USA0
45/333
D(*JUL)
11291945
*MDY&
03/05/33
D(*MDY)
03 05 33
*CYMD,
03 07 08
D(*MDY&);
108,03,07
*CYMD0
21/07/08
D(*DMY)
1080721
*CMDY
21-07-08
D(*YMD-)
107/08/21
*CDMY-
07/08/2021
D(*USA)
108-07-21
*LONGJUL&
08/07/2021
D(*EUR)
2021 189
*ISO
23 12 56
T(*HMS&);
23.12.56
*EUR
11:00 AM
T(*USA)
11.00.00
*JIS
11.10.07
T(*EUR)
11:10:07
*HMS,
14:16:18
T(*JIS)
14,16,18
*USA
24.00.00
T(*ISO)
12:00 AM
Blank
2045-10-27-23.34.59.123456
Z(*ISO)
2045-10-27-23.34.59.123456
Table 4. Moving a Date-Time Field to a
Numeric Field
Factor 1
Entry
Factor 2
Result Field
(Numeric)
Value
DTZ Type
*JUL
11-19-75
D(*MDY-)
75323
*DMY-
92/114
D(*JUL)
230492
*USA
14/01/28
D(*YMD)
01282014
*EUR
12/31/9999
D(*USA)
31129999
*DMY,
2036-05-21
D(*ISO)
210536
*USA
45/333
D(*JUL)
11291945
*MDY&
03/05/33
D(*MDY)
030533
*CYMD,
03 07 08
D(*MDY&);
1080307
*CMDY
21-07-08
D(*YMD-)
1070821
*CDMY-
07/08/2021
D(*USA)
1080721
*LONGJUL&
08/07/2021
D(*EUR)
2021189
*ISO
23 12 56
T(*HMS&);
231256
*EUR
11:00 AM
T(*USA)
110000
*JIS
11.10.07
T(*EUR)
111007
*HMS,
14:16:18
T(*JIS)
141618
*ISO
2045-10-27-23.34.59.123456
Z(*ISO)
20451027233459123456
Table 5. Moving Date-Time Fields to Date-Time
Fields. Assume that the initial value of the timestamp is 1985-12-03-14.23.34.123456.
Factor 1
Factor
2
Result
Field
Value
DTZ Type
Value
DTZ Type
N/A
1986-06-24
D(*ISO)
86/06/24
D(*YMD)
N/A
23 07 12
D(*DMY&);
23.07.2012
D(*EUR)
N/A
11:53 PM
T(USA)
23.53.00
T(*EUR)
N/A
19.59.59
T(*HMS.)
19:59:59
T(*JIS)
N/A
1985-12-03-14.23.34.123456
Z(*ISO.)
1985-12-03-14.23.34.123456
Z(*ISO)
N/A
75.06.30
D(*YMD.)
1975-06-30-14.23.34.123456
Z(*ISO)
N/A
09/23/2234
D(*USA)
2234-09-23-14.23.34.123456
Z(*ISO)
N/A
18,45,59
T(*HMS,)
1985-12-03-18.45.59.000000
Z(*ISO)
N/A
2:00 PM
T(*USA)
1985-12-03-14.00.00.000000
Z(*ISO)
N/A
1985-12-03-14.23.34.123456
Z(*ISO.)
12/03/85
D(*MDY)
N/A
1985-12-03-14.23.34.123456
Z(*ISO.)
12/03/1985
D(*USA)
N/A
1985-12-03-14.23.34.123456
Z(*ISO.)
14:23:34
T(*HMS)
N/A
1985-12-03-14.23.34.123456
Z(*ISO.)
02:23 PM
T(*USA)
Table 6. Moving a Date field to a Character
field. The result field is larger than factor 2. Assume
that Factor 1 contains *ISO and that the result field is defined as
D Result_Fld 20A INZ('ABCDEFGHIJabcdefghij')
Operation
Code
Factor
2
Value of Result Field
after move operation
Value
DTZ Type
MOVE
11 19 75
D(*MDY&);
'ABCDEFGHIJ1975-11-19'
MOVE(P)
11 19 75
D(*MDY&);
' 1975-11-19'
MOVEL
11 19 75
D(*MDY&);
'1975-11-19abcdefghij'
MOVEL(P)
11 19 75
D(MDY&);
'1975-11-19 '
Table 7. Moving a Time field to a Numeric
field. The result field is larger than factor 2. Assume
that Factor 1 contains *ISO and that the result field is defined as
D Result_Fld 20S INZ(11111111111111111111)
Operation
Code
Factor
2
Value of Result Field
after move operation
Value
DTZ Type
MOVE
9:42 PM
T(*USA)
11111111111111214200
MOVE(P)
9:42 PM
T(*USA)
00000000000000214200
MOVEL
9:42 PM
T(*USA)
21420011111111111111
MOVEL(P)
9:42 PM
T(*USA)
21420000000000000000
Table 8. Moving a Numeric field to a Time
field. Factor 2 is larger than the result field. The highlighted
portion shows the part of the factor 2 field that is moved.
Operation
Code
Factor 2
Result
Field
DTZ Type
Value
MOVE
11:12:13:14
T(*EUR)
12.13.14
MOVEL
11:12:13:14
T(*EUR)
11.12.13
Table 9. Moving a Numeric field to a Timestamp
field. Factor 2 is larger than the result field. The highlighted
portion shows the part of the factor 2 field that is moved.