|
*_MOVE_* just an excerpt from the Code400 help : <snip> The MOVE and MOVEL operation codes can be used to move Date, Time and Timestamp data type fields. The following combinations are allowed for the MOVE and MOVEL operation codes: o Date to Date o Time to Time o Timestamp to Timestamp o Date to Timestamp o Time to Timestamp (sets micro-seconds to 000000) o Timestamp to Date o Timestamp to Time o Date to Character or Numeric o Time to Character or Numeric o Timestamp to Character or Numeric o Character or Numeric to Date o Character or Numeric to Time o Character or Numeric to Timestamp Factor 1 must be blank if both the source and the target of the move are Date, Time or Timestamp fields. If factor 1 is blank, the format of the Date, Time, or Timestamp field is used. 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. Any valid format may be specified. See Date Data Type, Time Data Type, and Timestamp Data Type. Keep in mind the following when specifying factor 1: o Time format *USA is not allowed for movement between Time and numeric fields. o The formats *LONGJUL, *CYMD, *CMDY, and *CDMY, and a special value *JOBRUN are allowed in factor 1. (For more information, see Externally defined date formats and separators.) o A zero (0) specified at the end of a format (for example *MDY0) indicates that the character field does not contain separators. o A 2-digit year format (*MDY, *DMY, *YMD, *JUL and *JOBRUN) can only represent dates in the range 1940 through 2039. A 3-digit year format (*CYMD, *CMDY, *CDMY) can only represent dates in the range 1900 through 2899. An error will be issued if conversion to a 2- or 3-digit year format is requested for dates outside these ranges. o When MOVE and MOVEL are used to move character or numeric values to or from a timestamp, the character or numeric value is assumed to contain a timestamp. Factor 2 is required and must be a character, numeric, Date, Time, or Timestamp value. It contains the field, array, array element, table name, literal, or named constant to be converted. The following rules apply to factor 2: o Separator characters must be valid for the specified format. o If factor 2 is not a valid representation of a date or time or its format does not match the format specified in factor 1, an error is generated. o If factor 2 contains UDATE or *DATE, factor 1 is optional and corresponds to the header specifications DATEDIT keyword. o If factor 2 contains UDATE and factor 1 entry is coded, it must be a date format with a 2-digit year. If factor 2 contains *DATE and factor 1 is coded, it must be a date format with a 4-digit year. The result field must be a Date, Time, Timestamp, numeric, or character variable. It can be a field, array, array element, or table name. The date or time is placed in the result field according to its defined format or the format code specified in factor 1. If the result field is numeric, separator characters will be removed, prior to the operation. The length used is the length after removing the separator characters. When moving from a Date to a Timestamp field, the time and microsecond portion of the timestamp are unaffected, however the entire timestamp is checked and an error will be generated if it is not valid. When moving from a Time to a Timestamp field, the microseconds part of the timestamp is set to 000000. The date portion remains unaffected, but the entire timestamp will be checked and an error will be generated when it is not valid. If character or numeric data is longer than required, only the leftmost data (rightmost for the MOVE operation) is used. Keep in mind that factor 1 determines the length of data to be moved. For example, if the format of factor 1 is *MDY for a MOVE operation from a numeric date, only the rightmost 6 digits of factor 2 would be used. <snip> Rolf --------------------------- Dipl.Inf.(FH) Rolf P Mittag Leipziger Str. 50 D-69214 Eppelheim Fon: +49 (6221) 76 78 60 Fax: +49 (6221) 76 80 26 eMl: rm@r-m-e-d-v.de +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.