what is this date format WS-DATE-CCYYMMDD

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
pongal
Participant
Posts: 77
Joined: Thu Mar 04, 2004 4:46 am

what is this date format WS-DATE-CCYYMMDD

Post 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.....
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pongal
Participant
Posts: 77
Joined: Thu Mar 04, 2004 4:46 am

Post 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 ?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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:
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply