Software AG Products 2.4.1 | Reference Guide | Programming Considerations | Date and Time Format Conversion Routines
 
Date and Time Format Conversion Routines
Adabas Pre-Compiler provides four routines for converting the Date and Time format fields into date and time in a readable form.
A Date format field is generated in the record buffer as a packed field with 7 digits. A Time format field is generated as a packed field with 13 digits. The values in these fields are meaningless for the programmer and therefore the conversion routines are necessary.
You must run these routines manually.
The following routines are available:
PFRDATE
This routine converts a Date format into a numeric field.
It accepts two parameters:
Parameter
Description
N-DATE (N8)
8-digit number in the format DDMMYYYY.
DATE (D)
The packed field which contains the date.
The routine converts the date in the packed field and returns the correct value in the first parameter.
PTODATE
This routine converts a numeric field into a Date format.
It accepts two parameters:
Parameter
Description
N-DATE (N8)
8-digit number in the format DDMMYYYY.
DATE (D)
The packed field which contains the date.
The routine converts the number in the first parameter into a Date format and returns it in the second parameter.
PFRTIME
This routine converts a Time format into a numeric field with the date and another numeric field with the time.
It accepts three parameters:
Parameter
Description
N-DATE (N8)
8-digit number in the format DDMMYYYY.
N-TIME (N7)
7-digit number in the format HHMMSSS.
TIME (T)
The packed field which contains the time.
The routine converts the time in the third parameter and returns the date in the first parameter and the time in that date in the second parameter.
PTOTIME
This routine converts a numeric date and a numeric time within that date into a Time format.
It accepts three parameters:
Parameter
Description
N-DATE (N8)
8-digit number in the format DDMMYYYY.
N-TIME (N7)
7-digit number in the format HHMMSSS.
TIME (T)
The packed field which contains the time.
The routine converts the date in the first parameter and the time in the second parameter into a Time format field and returns it the third parameter.