Pathmaker Programming Guide
Using Date and Time Data Types
Defining Data for a NonStop SQL Pathmaker Application
C–10 067868 Tandem Computers Incorporated
Using Date and Time
Data Types
Date and time data types are supported only in DDL. To use date and time data types
in programs written in programming languages such as COBOL and C, equivalent
data types must be used. The Pathmaker product treats date and time data types as
character fields. The length of each field is the maximum possible date or time string;
dates are in accordance with the Gregorian calendar and times are in accordance with
a 24-hour clock.
The buffer size that the Pathmaker product creates for an SQL date and time data type
is the same as the buffer size produced by an INVOKE of that SQL date and time data
type. Refer to the NonStop SQL manuals for a list of the buffer sizes of SQL date and
time data types.
Here are guidelines for using date and time data types:
For DB requesters, the Pathmaker product will always generate code to create
buffers of the same sizes as those produced by NonStop SQL.
By default, the Pathmaker product will use a 24-hour clock to represent time in DB
and TRNS requesters.
If you want to define your own representation of a DATETIME field, you must use
a TRNS requester.
For example, suppose you want to use the US format to display time data on an
application screen. US format shows time as AM or PM. The standard (24-hour)
representation 17:24.39 would appear:
5:24.39 PM
The SQL data type for time is TIME (or DATETIME HOUR TO SECOND). The
standard length of this field is 8. To display time in US format, you can create a
DDL definition that adds three extra bytes to the length of the field:
DEF USA-TIME PIC X(11).
You would add this DDL definition to:
The IPC Definition screen of the service
The Requester Context screen and the SEND Parameter Definition screen of
the requester
To display the field on the application screen, you can either add it to the Display
Field List (if you are creating a default screen) or add it through the Screen Painter.
Finally, you must add code to the service to manipulate the hour portion of time
along with either AM or PM.