Go to Home Page
Questions?
Call 1-800-572-5517
 
  Go to Home Page  
  See all products
  See price schedules
  See manuals, tutorials, articles
  Download a free 30-day trial
  See user testimonials
  About Pacific Systems Group
 
  Welcome Rocket Software MXI Users - Learn about Spectrum SMF Writer for MXI
  Choose Spectrum Writer to add 4GL to your product
  Report Writer Speedup Tips Article

Data Types for Date Fields


Return to "Working with Dates".

There are many ways that a date field can be represented in an input record. A data type describes exactly how a particular field's data is stored within an input record. A field's data type is defined to Spectrum Writer with the TYPE parm in its FIELD statement.

Here are some examples of TYPE parms in FIELD statements:

FIELD: AMOUNT TYPE(NUM) LENGTH(6) DECIMAL(2)
FIELD: PACKED-SALARY TYPE(PACKED) LENGTH(4) DECIMAL(2)
FIELD: INDEX TYPE(BIN) LENGTH(1)
FIELD: SALES-DATE TYPE(YYMMSS)
FIELD: PACKED-JULIAN-START-DATE TYPE(P-YYDDD)
FIELD: SALES-TIME TYPE(HHMMSS)

The following chart show the data types that Spectrum Writer supports for date fields. The charts also show the acceptable abbreviations and alternate spellings for the data types.

DATA TYPE DESCRIPTION (See Note 1) LENGTH
MM–DD–YY MM/DD/YY date in character format (with slashes or other delimiters). (2) Leading zeros are optional in day and month.
Example: C'12/31/96' and C'12.31.96' are Dec. 31, 1996.
Example: C'1/2/96 ' and C' 1/2/96' are Jan. 2, 1996.
8
MM–DD–YYYY MM/DD/YYYY date in character format (with slashes or other delimiters). (2) Leading zeros are optional in day and month.
Example: C'12/31/1996' and C'12.31.1996' are Dec. 31, 1996.
Example: C'1/2/1996 ' and C' 1/2/1996'. are Jan. 2, 1996.
10
MMDDYY MMDDYY date in character format.
Example: C'123196' is Dec. 31, 1996.
6
MMDDYYYY MMDDYYYY date in character format.
Example: C'12311996' is Dec. 31, 1996.
8
DD–MM–YY DD/MM/YY date in character format (with slashes or other delimiters). (2) Leading zeros are optional in day and month.
Example: C'31/12/96' and C'31.12.96 ' are Dec. 31, 1996.
Example: C'2/1/96 ' and C' 2/1/96' are Jan. 2, 1996.
8
DD–MM–YYYY DD/MM/YYYY date in character format (with slashes or other delimiters). (2) Leading zeros are optional in day and month.
Example: C'31/12/1996' and C'31.12.1996' are Dec. 31, 1996.
Example: C'2/1/1996 ' and C' 2/1/1996' are Jan. 2, 1996.
10
DDMMYY DDMMYY date in character format.
Example: C'311296' is Dec. 31, 1996.
6
DDMMYYYY DDMMYYYY date in character format.
Example: C'31121996' is Dec. 31, 1996.
8
YYYY–MM–DD YYYY/MM/DD date in character format (with slashes or other delimiters). (2)
Example: C'1996/12/31' and C'1996.12.31' are Dec. 31, 1996.
Example: C'1/2/1996 ' and C' 1/2/1996' are Jan. 2, 1996.
10
YYMMDD YYMMDD date in character format.
Example: C'961231' is Dec. 31, 1996.
6
YYYYMMDD YYYYMMDD date in character format.
Example: C'19961231' is Dec. 31, 1996.
8
YYYY–DD–MM YYYY/DD/MM date in character format (with slashes or other delimiters). (2)
Example: C'1996/31/12' and C'1996.31.12' are Dec. 31, 1996.
Example: C'1996/2/1 ' and C' 1996/2/1' are Jan. 2, 1996.
10
YYDDD YYDDD Julian date in character format.
Example: C'96366' is Dec. 31, 1996.
5
YYYYDDD YYYYDDD Julian date in character format.
Example: C'1996366' is Dec. 31, 1996.
7
H–MMDDYY MMDDYY date in hexadecimal (BCD) format.
Example: X'123196' is Dec. 31, 1996.
3
H–MMDDYYYY MMDDYYYY date in hexadecimal (BCD) format.
Example: X'12311996' is Dec. 31, 1996.
4
H–DDMMYY DDMMYY date in hexadecimal (BCD) format.
Example: X'311296' is Dec. 31, 1996.
3
H–DDMMYYYY DDMMYYYY date in hexadecimal (BCD) format.
Example: X'31121996' is Dec. 31, 1996.
4
H–YYMMDD YYMMDD date in hexadecimal (BCD) format.
Example: X'961231' is Dec. 31, 1996.
3
H–YYYYMMDD YYYYMMDD date in hexadecimal (BCD) format.
Example: X'19961231' is Dec. 31, 1996.
4
H–YYDDD YYDDD Julian date in hexadecimal (BCD) format.
Example: X'096366' is Dec. 31, 1996.
3
H–YYYYDDD YYYYDDD Julian date in hexadecimal (BCD) format.
Example: X'01996366' is Dec. 31, 1996.
4
P–MMDDYY MMDDYY date in packed format.
Example: X'0123196C' is Dec. 31, 1996.
4
P–MMDDYYYY MMDDYYYY date in packed format.
Example: X'012311996C' is Dec. 31, 1996.
5
P–DDMMYY DDMMYY date in packed format.
Example: X'0311296C' is Dec. 31, 1996.
4
P–DDMMYYYY DDMMYYYY date in packed format.
Example: X'031121996C' is Dec. 31, 1996.
5
P–YYMMDD YYMMDD date in packed format.
Example: X'0961231C' is Dec. 31, 1996.
4
P–YYYYMMDD YYYYMMDD date in packed format.
Example: X'019961231C' is Dec. 31, 1996.
5
P–YYDDD YYDDD Julian date in packed format.
Example: X'96366C' is Dec. 31, 1996.
3
P–YYYYDDD YYYYDDD Julian date in packed format.
Example: X'1996366C' is Dec. 31, 1996.
4
P–CYYDDD Packed Julian date with century digit (as used in SMF records).
Example: X'0096366C' is Dec. 31, 1996.
Example: X'0196366C' is Dec. 31, 2096.
4
STCKDATE Spectrum Writer extracts the date portion of the date–time value stored by the IBM STCK machine instruction (CPU timer units since 00:00:00 1/1/1900 GMT). Spectrum Writer automatically converts the STCK value from GMT to local time. For more details, see the STCKADJ parm in the OPTIONS statement (page 575). 8
ABSDATE Spectrum Writer extracts the date portion of a CICS ABSTIME date–time value (8-byte packed number of milliseconds since 00:00:00 1/1/1900). 8
DATEEXIT Spectrum Writer will call a user–written exit program to obtain a date value. The exit program must return a 4–byte date in X'YYYYMMDD' format. N/A
Notes:
(1) The CENTURY parm (in an OPTIONS statement) determines whether YY–type dates are 19YY or 20YY.
(2) Any non–numeric character is accepted as the delimiter character.

Return to "Working with Dates".

Copyright 2024.
Pacific Systems Group.
All rights reserved.


Spectrum Writer 4GL - the economical alternative to SAS, Easytrieve, DYL-280...

Home | Products | Prices | Documentation | 30-Day Trials | Customer Reviews | Company
Send Your Comments or Questions