Data Type Conversion

These are the rules for data conversion:

Conversion

Change

U to C

No change

C to U

No change

I, L or N to C or R

The number is converted to a left-justified decimal representation The minus sign (−) and decimal point (.) characters are included if necessary.

If the resulting character does not fit, it is truncated

C or U to I, L or N

The character string is read as a number. If there is a minus sign anywhere in the string, it is read as a negative number. The first occurrence of a full stop (.) or comma (,) is interpreted as a decimal point

Characters other than these are ignored:
,.-0123456789

D to I, L or N

The date is converted to the number of days since 01.03.1980

I, L or N to D

The number is interpreted as the number of days since 01.03.1980

D to C or U

The date is converted to a number (D to I as above), and then the number to a string (I to C as above)

C to U or D

The character string is first converted to a number (C to I as above), and then the number to a date (I to D as above)

Y to I, L or N

TRUE is converted to 1, and FALSE to 0

I, L or N to Y

0 is converted to a FALSE value, and any other number to a TRUE value

Y to C or U

The value is converted to a number (Y to I as above), then to a number character string (I to C as above)

C or U to Y

The character string is converted to a number (C to I as above), and the number to a Yes/No value (I to Y as above)

If a field contains a null value, it is converted to the null value of the new data type.