Fields in a smart date format can easily be compared to identify the number of days lapsed between the two points in time. In the example below, a temporary field is created to determine the age of an employee at the time of their retirement. The new field, AGE, is created by subtracting the employee's birth date from the effective date of their retirement and dividing the resulting number of days by 365.
Example using the COMPUTE command:
TABLE FILE SP
COMPUTE AGE/I5 = (SP:EFFDATE-SP:BRTHDATE)/365;
WHERE SP:TRANCODE EQ 'S70' OR 'S71'
Related Topic: Smart Dates
Last Updated: January 2, 2004