Date type conversion

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
senthilmp
Participant
Posts: 85
Joined: Mon Sep 22, 2008 6:11 am

Date type conversion

Post by senthilmp »

Hi ,

I have a source file containing the date as

eg:

20080120(YYYYMMDD) and i want this to be tranformed into output target table in date format, pls help me out to do so.

Thanks,
Senthil
mandyli
Premium Member
Premium Member
Posts: 898
Joined: Wed May 26, 2004 10:45 pm
Location: Chicago

Post by mandyli »

Hi

What is your target database?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What "date format" do you need? There's always an IConv/OConv pair but if your incoming format is consistent then substring should be fine. For example:

Code: Select all

YourField[1,4]:"-":YourField[5,2]:"-":YourField[7,2]
To change YYYYMMDD to YYYY-MM-DD.
-craig

"You can never have too many knives" -- Logan Nine Fingers
senthilmp
Participant
Posts: 85
Joined: Mon Sep 22, 2008 6:11 am

Post by senthilmp »

mandyli wrote:Hi

What is your target database?

My target database is Oracle
senthilmp
Participant
Posts: 85
Joined: Mon Sep 22, 2008 6:11 am

Post by senthilmp »

chulett wrote:What "date format" do you need? There's always an IConv/OConv pair but if your incoming format is consistent then substring should be fine. For example:

Code: Select all

YourField[1,4]:"-&quo ...[/quote]

I need DD-MON-YYYY format ie (I am creating table through Datastage itself, using create table option)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

For Oracle you don't "need" any particular format, so long as the TO_DATE() mask matches your data.
-craig

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