ODBC4x
Classes Table Definitions
  Classes are used to define the format of special string or numeric data types; e.g., date values require special formatting. The class option can be used to convert to and from the SQL date format (YYYY-MM-DD) to the format of the date field stored in ProvideX files. The maximum length for a date field is 30 characters.

Since there are no rules on date formatting, separate keywords are available to assist the driver converting data to and from the SQL date format. Use keywords in the CLASS field to define a date in a Data Dictionary definition. Use CLASS= in an INI definition.

Date Formats The syntax for a date definition appears as follows:

DATE[keywords]

DATE with no optional keywords defaults to YYYYMMDD.

BIN Binary value; e.g., DATE-BIN-YYMMDD = BIN(990101,4)
-PACK Packed numeric; e.g., DATE-PACK-YYMMDD = PCK(990101)
-BCD Binary packed decimal; e.g., DATE-BCD-YYMMDD = ATH(STR(990101))
-JUL Julian date. The default base year is 1970. The default year can be overridden by adding a new base year in the format -YYYY. For example, a base year of 0 zero would be represented as DATE-JUL-0000.
-UNKNOWN Date value is processed as a string, without formatting and validation. This is provided for debugging purposes as the ODBC driver will report an error if a date string fails to convert to an SQL date.
*MAS90 Special packed date format compatible with Sage MAS 90 and Sage MAS 200.
*SSI Infor Global Solutions FACTS packed date.
-AAMMDD
-KKMMDD
AA or KK are special cases of YY. The first time a K or A is encountered and there have been no Y’s then:
  • If the first character is greater than or equal to A, the year is 200 + ASC(data$) - ASC('A'); otherwise, the year is 190 + ASC(data$) - ASC('0') or zero. All subsequent occurrences of A are treated as Y.
  • If the first character is K , the year is 190 + ASC(data$) - ASC('0'). All subsequent occurrences of K are treated as Y.
 
Example:

The INI field definitions for dates in a DATE_data record appear as follows:

[DATE_data]
Date_1=String,len=8,class=DATE-YYYYMMDD
Date_2=String,len=8,class=DATE-YY-MM-DD
Date_3=String,len=4,class=DATE-BCD-JUL
Date_4=String,len=4,class=DATE-PACK-YYYYMMDD

Right Justified data The format for right-justified data appears as follows:

RIGHT[nnn]

where nnn is the decimal value of the fill character. If a fill value is not supplied, then the fill defaults to a space (decimal 32).