Date conversion

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
gsym
Charter Member
Charter Member
Posts: 118
Joined: Thu Feb 02, 2006 3:05 pm

Date conversion

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Probably worth writing a routine if there are that many.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
gsym
Charter Member
Charter Member
Posts: 118
Joined: Thu Feb 02, 2006 3:05 pm

Used functions to resolve this

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Earlier you were complaining about needing to do this 100 times. Presumably you are now happy with that.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply