Assuming a numeric 6-byte date in YYMMDD format, and a date data field in any format, you would move the numeric to the date field thus:*YMD move YYMMDD DatefieldWhere YYMMDD is your numeric field, and Datefield is the date data type. Dave
Assuming a numeric 6-byte date in YYMMDD format, and a date data field in any format, you would move the numeric to the date field thus:*YMD move YYMMDD DatefieldWhere YYMMDD is your numeric field, and Datefield is the date data type. Dave
Can I use the same technique to move from a date field to a numeric field?
I wish to use the RPGIV opcodes ADDDUR and SUBDUR to manipulate dates, however, the legacy files on my system hold dates in standard numeric fields. I presume its possible to move the numeric date into a 'proper' date field which I can then do whatever with. Could somebody post an example or two please? Also, can you tell me at the same time whether I can use the same process to put the date back into a numeric field i.e. when updating the file. Thanks in anticipation
Yes. The ILE RPG manual (reference guide) lays it all out for you under the MOVE opcode documentation. Dave