DateConvert Simple Form

Syntax

DATECONVERT { TODAYNUMBER | TODATE | TOALPHA } 
variable [ GS status]

Parameters

DateConvert can be abbreviated as DC.

Description

The simple form of the DateConvert logic command converts the Glb.Total built-in segment attribute as either the source or destination of a relative day number, based upon the fixed date of January 1, 1957. If a base year other than 1957 is required, the DateConvert complex form should be used. The DateConvert simple form does not provide correct conversions for dates from the year 2057 (more than 100 years after the base year).

Failure behavior

If the date is invalid, the Glb.Status built-in segment attribute is set to "*****". Use the GS command option to direct the result to a variable. Error testing should be used whenever the DateConvert logic command is invoked.

Restrictions

The following restrictions apply to the simple form of the DateConvert logic command:

Example

This example converts Birth_Date into a relative day number. The result is stored in the Glb.Total built-in segment attribute, and the value of the GS command option in SDError.

DateConvert ToDayNumber Birth_Date GS SDError