Dataloader/MP Reference Manual

Table Of Contents
Creating a Customized Version of DataLoader/MP
DataLoader/MP Reference Manual424148-003
5-15
Data Conversion
The syntax for this procedure follows:
DTLExternalToInternalDatetime
This procedure converts a character string containing a date and time to the internal
form suitable for processing by SQLCI LOAD.
The syntax for this procedure follows:
SQLCI LOAD requires date-time data in an 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 an SQLCI LOAD.
There are many external formats of dates and times, so there is no one conversion
procedure that 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 NonStop SQL/MP, of the following form:
YYYY-MM-DD:HH:MM:SS.MSSSSS
where
The input string need not contain all of 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 preceding
date-time format then call this procedure to convert that to the internal format.
void DTLEBDCICToASCII( char* EBCDIC, long Len );
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