DataLoader/MX Reference Manual (G06.24+)

Creating a Customized Version of DataLoader/MX
DataLoader/MX Reference Manual525872-002
5-15
Data Conversion
The syntax is:
SQLCI LOAD/COPY require date-time data in a unique internal format. Moreover, the
conversion is complex. Therefore, this procedure is particularly useful for a user exit
doing date conversion that is eventually destined for SQLCI LOAD/COPY.
There are many external formats for dates and times, so no one conversion procedure
processes all formats. For this reason, this procedure accepts as input date and time
strings, formatted according to the same rules as apply to date-time literals in SQL/MX,
of the form:
YYYY-MM-DD:HH:MM:SS.MSSSSS
where
The input string need not contain all these fields. You need only as many contiguous
fields as are necessary to make the input unambiguous. For example, 1943-11-29 is
acceptable because it could be only YYYY-MM-DD, but 01:01 is not because the value
could be DD:HH or HH:MM or MM:SS and is therefore ambiguous.
If the input file contains a date or time in another format, convert it to the date-time
format (YYYY-MM-DD) and call this procedure to convert that to the internal format.
The value returned by this procedure indicates the outcome of the conversion, where
an error condition is indicated by:
If none of these errors occur, the result is a positive number composed of seven bits
indicating which of the seven possible components were actually present, as follows:
short DTLExternalToInternalDatetime
(
char* ExternalDateTime,
long long* InternalDateTime
);
YYYY is year, from 0001 through 9999
MM is month, from 1 or 01 through 12
DD is day, from 1 or 01 through 31
HH is hour, from 0 or 00 through 23
MM is minute, from 0 or 00 through 59
SS is second, from 0 or 00 through 59
MSSSSS is microsecond, from 0 through 999999
-1 The input is syntactically incorrect.
-2 The input is ambiguous.
-3 The day or date does not exist (for example, the 30th of
February).