AMT Help Files

Dates

By clicking the Dates node for the Application options, the following screen will be displayed:

 

Option Description

Shifting time frame

This value can be used by AMT-COBOL to determine the century digits (CC) of year-definitions, to be added when only the last two digits for the year are specified.

The deviation between the current year (YY) and the shifting time frame determines the "splitting point". If the last year digits (YY) are specified but the century digits (CC) are omitted in a datevalue, and the year value is equal to or higher than the splitting point value, the century digits is set to "19". Otherwise, the century digits is be set to "20".

Shifting time frame is the default behaviour for new applications, to use a different method you can set 'Century start year' or choose a different SI-century behaviour than the default 'Don't use as input only set' (see below)

Example:
If the shifting time frame is set to 50 and the current year is 2019, the splitting point is set to 69. This means that conversion of 6 digit dates (DDMMYY) to 8 digit dates (DDMMCCYY) is as follows:

The YY values from 69 to 99 leads to CCYY values of 1969 to 1999 and the YY values of 00 to 68 leads to CCYY values of 2000 to 2068.

Century start year

If this setting is given a value other than 0, it overrules the option Shifting time frame functionality.

Just like the Shifting time frame option, this value can be used by AMT-COBOL to determine the century digits (CC) of year-definitions, to be added when only the last two digits for the year are specified.

Unlike the Shifting time frame option, which calculates the "splitting point" from the current year, the Century start year option keeps the "splitting point" at a fixed year.
If the last year digits (YY) are specified but the century digits (CC) are omitted in a datevalue, and the year value is equal to or higher than the splitting point value, the century digits is set to "19". Otherwise, the century digits is set to "20".

Century start year is used if the SI-century behaviour is set to 'Don't use as input only set' (see below)

Example:
If the century start year is set to 57, the splitting point is 57. This means that conversion of 6 digit dates (DDMMYY) to 8 digit dates (DDMMCCYY) is as follows: 

The YY values from 57 to 99 leads to CCYY values of 1957 to 1999 and the YY values of 00 to 56 leads to CCYY values of 2000 to 2056.

Si-century behaviour

The following rules apply for si-century when the Dateresult date is set without supplying the century digits (e.g. Dateresult.yymmdd := 990218)

  • Don't use as input only set: The century of Dateresult is set according to the rules of the 'Shifting time frame' or 'Century start year' value when no century is supplied (see above). Si-Century is set to the calculated Dateresult century.
     
    Example: if the current year is 2019 and shifting time frame is set to 80, the "splitting point" of the shifting time frame is calculated as 99. For Dateresult.yymmdd := 990218 the calculated date is 19990218 and si-century is set to 19. If 400 days are then added to the previous Dateresult by using Dateresult.daynum := Dateresult.daynum + 400 , the century rolls over, making the calculated date 20000324 and si-century holds the value 20.

  • Use on input and set: The century of Dateresult is set using Si-Century as input century when no century is supplied. Si-Century is set to the calculated Dateresult century.

    Example: if si-century := 19 and Dateresult.yymmdd := 990218 , the calculated date is 19990218 and si-century still has 19 as its value. If 400 days are then added to the previous Dateresult by using Dateresult.daynum := Dateresult.daynum + 400, the century rolls over making the calculated date 20000324 and si-century holds the value 20.

  • Use on input and don't set: The century of Dateresult is set using Si-Century as input century when no century is supplied. Si-Century remains unchanged after calculating the Dateresult.

    Example
    : if si-century := 19 and 
    Dateresult.yymmdd := 990218 , the calculated date is 19990218 and si-century has 19 as value. If 400 days are added to the previous Dateresult by using Dateresult.daynum := Dateresult.daynum + 400 , the century rolls over, making the calculated date 20000324 but si-century still holds the value 19.

Revert to legacy century behavior

Important! Please exercize caution when enabling this option because it could cause unexpected behavior. It is recommended to only enable this option if it was advised by Avanade's customer support.

By default, if a DateResult format contains century digits (for example: ccyymmdd), its century value is set to 00 when no century value is provided. Enable this option to set the value to the current century instead.

Valid date range

Lowest year value for the date range. If a year value (ccyy) is lower than the value that is specified here, the dateresult function sets RESOK to false and return the date of today.

Highest year value for the date range. If a year value (ccyy) is higher than the value that is specified here, the dateresult function sets RESOK to false and return the date of today.

Allow 1 digit as day/month/year for formats with a "-" inside

Only if enabled, it is possible to indicate the day/month/year with a single digit in formats with a "-" inside.

Use regional server setting for

If any of these options are enabled, AMT-COBOL uses the Windows date descriptions instead of the values that are specified in the Date day literals and/or the Date month literals panel. AMT-COBOL then uses the regional settings as they are specified on the machine where the Application or Report server are running.

Day names

The literals that must be used by AMT-COBOL to indicate the day name. These values are only used if the option "(Use Regional of the server) for long day names" is disabled.

long month names
short month names

The literals that must be used by AMT-COBOL to indicate the month name. The Long name values are only used if the option "(Use Regional of the server) for long month names" is disabled. The Short name values are only used if the option "(Use Regional of the server) for short month names" is disabled.

 

Week Numbers

Option Description
Use ISO 8601 standard

If enabled, the calculation of weeknumbers is based on the ISO 8601 standard.

If disabled, the calculation is the same as for specific Unisys mainframe environments that consider:

  • The first day of the year (1-1-<CCYY>) always to be the first day of week 1.
  • Every new weeknumber to start on a Sunday.

 

Database date formats

In this section the format of the Database DateTime types can be changed. The Date elements CCYY (Century and Year), MM (Month) and DD (Day), can be arranged in the order of your choosing and separated by either a dash (-), dot (.), space ( ) or a colon (:). The Time elements, HH (Hours), MM (Minutes), DD (Day), can be separated by either a dash (-), dot (.), space ( ) or a colon (:).

warning Changing date types or date formats to an other date type, date format, or to any other type, while having data in them, causes the data to become invalid.

Option Description
Date Enter a date format. Default: CCYY.MM.DD
DateTime Enter a date & time format. Default: CCYY-MM-DD HH:MM:SS[.NNNNNNNNNNNN]
Time Enter a time format. Default: HH:MM:SS[.NNNNNNNNNNNN]