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.....
what is this date format WS-DATE-CCYYMMDD
Moderators: chulett, rschirm, roy
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.
![Confused :?](./images/smilies/icon_confused.gif)
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.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
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 :wink:](./images/smilies/icon_wink.gif)
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 :wink:](./images/smilies/icon_wink.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers