Page 1 of 1

Date conversion

Posted: Mon Feb 09, 2009 12:42 pm
by gsym
Hi guys,

The source data is coming in from mainframe and when i import the CFD, the columns are in decimal and of format "0207354", "0197356".

When I decoded this, the first 2 character represents the century which is if 02 , then 2007 or if 01 then 1900 . the next 2 characters represents the year in tht century which is 2007 or 1997 and the last 3 represents the day in the year.

Is there a way to use functions to implement this?, as of now i am using stage variables and " if and else conditions" and concatinating it back. I got to do these conversion for almost 100 columns and target is orcale of datatype "Date".

Thanks for your response

Posted: Mon Feb 09, 2009 4:22 pm
by ray.wurlod
Probably worth writing a routine if there are that many.

Used functions to resolve this

Posted: Mon Feb 09, 2009 7:35 pm
by gsym
hey, thaks ray. I used functions to resolve this. actualy stripped first two character and passed back 20 or 19 depending on the cc code and concatinated with rest of the 5 digit code. So its changed from CCYYDDD to YYYYDDD which i sent via stringtodate to resolve

Posted: Tue Feb 10, 2009 4:53 am
by ray.wurlod
Earlier you were complaining about needing to do this 100 times. Presumably you are now happy with that.