Previous Topic: COPYDD CommandNext Topic: CREATE Command


Timestamp DEF Statement-

CA Datacom Datadictionary and CA Datacom Reporting Facility supports printing individual fields that make up an SQL TIMESTAMP.

When the Reporting Facility requests a view of a table containing an SQL TIMESTAMP column, CA Datacom Datadictionary provides the SQL TIMESTAMP with a breakdown of simple fields that can be individually processed by the Reporting Facility. Currently, the Reporting Facility can only process the SQL TIMESTAMP as a single, binary-formatted field with a length of ten.

For example, the following SQL DDL statement defines a table containing an SQL TIMESTAMP (Column named MESSAGE_DATE):

CREATE TABLE SHORT_MESSAGE   (MESSAGE_ID      INTEGER,  
                              RECIPIENT_NAME  CHAR(32), 
                              MESSAGE_TEXT    CHAR(100),
                              MESSAGE_DATE    TIMESTAMP,
                              SENDER_NAME     CHAR(32)  
                             );                         

A Reporting Facility definition generated for this table by CA Datacom Datadictionary looks like the following before Version 14.0:

LOAD        SHORTMSG                            
DEF SYSUSR-SHORT_MESSAGE             301-483 X  
DEF MESSAGE_ID-NULL                  301-301 X  
DEF MESSAGE_ID                       302-305 B  
DEF RECIPIENT_NAME-NULL              306-306 X  
DEF RECIPIENT_NAME                   307-338 X  
DEF MESSAGE_TEXT-NULL                339-339 X  
DEF MESSAGE_TEXT                     340-439 X  
DEF MESSAGE_DATE-NULL                440-440 X  
DEF MESSAGE_DATE                     441-450 B  
DEF SENDER_NAME-NULL                 451-451 X  
DEF SENDER_NAME                      452-483 X

The same table definition now displays as follows:

LOAD        SHORTMSG                           
DEF SYSUSR-SHORT_MESSAGE             301-483 X 
DEF MESSAGE_ID-NULL                  301-301 X 
DEF MESSAGE_ID                       302-305 B 
DEF RECIPIENT_NAME-NULL              306-306 X 
DEF RECIPIENT_NAME                   307-338 X 
DEF MESSAGE_TEXT-NULL                339-339 X 
DEF MESSAGE_TEXT                     340-439 X 
DEF MESSAGE_DATE-NULL                440-440 X 
DEF MESSAGE_DATE                     441-450 B 
DEF MESSAGE_DATE-CC                  441-441 B 
DEF MESSAGE_DATE-YY                  442-442 B 
DEF MESSAGE_DATE-MM                  443-443 B 
DEF MESSAGE_DATE-DD                  444-444 B 
DEF MESSAGE_DATE-HH                  445-445 B 
DEF MESSAGE_DATE-MI                  446-446 B 
DEF MESSAGE_DATE-SS                  447-447 B 
DEF MESSAGE_DATE-TS                  448-448 B 
DEF MESSAGE_DATE-HS                  449-449 B 
DEF MESSAGE_DATE-MS                  450-450 B 
DEF SENDER_NAME-NULL                 451-451 X 
DEF SENDER_NAME                      452-483 X 

Each byte of the SQL TIMESTAMP is named using the name selected in the COPYDD statement or the –UTL LANGUAGE statement and includes one of the following three-character suffixes:

-CC Century

-YY Year

-MM Month

-DD Day of the month

-HH Hour of the day

-MI Minute of the hour

-SS Second of the minute

-TS Tenths of a second

-HS Hundredths of a second

-MS Thousandths of a second

Note: This functionality is only invoked for the definitions generated if the requested language is DR. A COBOL, PL1, or assembler copybook for the same table would not be expanded.