Page 1 of 1

what is this date format WS-DATE-CCYYMMDD

Posted: Wed May 11, 2005 9:52 am
by pongal
Hi,
I dont have any knowledge about cobol date formats like WS-DATE-CCYYMMDD.
I have seen one date field values in DB2 table with datatype Date like this
10683 (1997-03-31)
9658 (1994-06-10)

Here i am not understanding the format of the date value above mentioned.

My task is, i need to first convert this into US Date format and compare with current date by writing DB2 SQL Query.
I should not place this query in DS , but some experts might have commited this kind of scenario.

Thanks in advance.....

Posted: Wed May 11, 2005 10:25 am
by chulett
It's not a "COBOL date format". It's a date, yes. It's from a COBOL program, yes. But it's nothing magical. :?

WS_DATE_CCYYMMDD is just a variable name from Working Storage. It implies that the format of the date would be 8 digits in YYYYMMDD format. The 'CC' just stands for 'Century'. So, as an example, the first date mentioned below would look like 19970331 in this format.

I would suggest you verify this by inspecting the actual data.

Getting it into DB2 is a whole 'nuther kettle of fish.

Posted: Wed May 11, 2005 10:35 am
by pongal
Thanks chulett
but the prefix number 10683 in 10683 (1997-03-31) stands for what ?
how can i correlate 10683 with 1997-03-31 ?

Posted: Wed May 11, 2005 10:49 am
by chulett
That's the DB2 part. From what I've read on the forum (I'm an 'Oracle Guy') DB2 requires the date to be sent to it in internal format, so that number represents the number of days past some zero point.

Search the forum for something like 'DB2' and 'internal'. I know Ken has mentioned this 'gotcha' more than once, so filtering on an Author of kcbland might help narrow the net. [waves at Ken] :wink: