DTEXP3Subroutine {COBOL}

Purpose:

Expand 6-digit date in yymmdd (year-month-day) format to 8-digits with 4-digit year.

Usage:

Date expansion prior to use in date comparisons, calculations, display, and additional formatting, especially in terms of obtaining a 4-digit year (for Y2K accuracy, etc.).

Calling Sequence:

 
 

CALL 'DTEXP3' USING

INP-YYMMDD

INP-MMCHK

INP-DDCHK

   

INP-ZEROS

INP-NINES

INP-SPACE

   

OUT-YYERR

OUT-MMERR

OUT-DDERR

   

OUT-CCYYMMDD

   
 

Where:

 

INP-YYMMDD

X(06)

<INP>

=

Input date mask [YYMMDD];

 

INP-MMCHK

X(01)

<INP>

=

Check option for mm
N=No,
Y=Yes;

 

INP-DDCHK

X(01)

<INP>

=

Check option for dd
N=No,
Y=Yes (general non-calendar),
C=Yes (per-calendar);

 

INP-ZEROS

X(04)

<INP>

=

Allow all zeroes
ZEOK = yes
ZENO = no, treat as error;

 

INP-NINES

X(04)

<INP>

=

Allow all nines
NIOK = yes
NINO = no, treat as error;

 

INP-SPACE

X(04)

<INP>

=

Allow all spaces
SPOK = yes
SPNO = no, treat as error;

 

OUT-YYERR

9(01)

<OUT>

=

YY Validity Results
(0=OK >0=ERR);

 

OUT-MMERR

9(01)

<OUT>

=

MM Validity Results
(0=OK >0=ERR);

 

OUT-DDERR

9(01)

<OUT>

=

DD Validity Results
(0=OK >0=ERR);

 

OUT-CCYYMMDD

X(08)

<OUT>

=

Expanded date [CCYYMMDD].

Detailed Functions:

 
 

1.

First performs date-validity check on each component of the input date (checks actual calendar); If input date in error, returns individual error codes and does not perform addition functions.

 

2.

Exands year (YY) to 4-digits (CCYY) – 00-49 expands to 2000-2049.

Comments:

See "copyproc" inserts "WS-DATES" (declarations) and "98-WINDOW" (procedures) for further details of how this Y2K expansion process works.

 

See also the "Y2K Compliance COBOL Programmer’s Reference Manual".

{End}