The following example shows how to use date and time callable services to convert a date to a different format and do a simple calculation with the formatted date.
CALL CEEDAYS USING dateof_hire, 'YYMMDD', doh_lilian, fc. CALL CEELOCT USING todayLilian, today_seconds, today_Gregorian, fc. COMPUTE servicedays = today_Lilian - doh_Lilian. COMPUTE serviceyears = service_days / 365.25.
The example above uses the original date of hire in the format YYMMDD to calculate the number of years of service for an employee. The calculation is as follows: