How to convert Date format using Moify stage

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
stefanfrost1
Premium Member
Premium Member
Posts: 99
Joined: Mon Sep 03, 2007 7:49 am
Location: Stockholm, Sweden

Post by stefanfrost1 »

try

effdate_out:date=date_from_string["%dd/%mm/%yyyy"](effdate_in)
-------------------------------------
http://it.toolbox.com/blogs/bi-aj
my blog on delivering business intelligence using agile principles
reddy.vinod
Participant
Posts: 36
Joined: Mon Jul 16, 2007 3:37 am
Location: USA

How to convert Date format using Moify stage

Post by reddy.vinod »

Hi,

I am facing one problem while converting date format.First my source is a fixed width file.one of my column contain date type records, but i am reading it using char data type.My sourec is

10120/01/2007aaa
10212/12/2007bbb

metadata:
id char(3)
effdate char(10)
name char(3)

In file date is in dd/mm/yyyy format .now i have to it to datastage default format("yyyy-mm-dd").
For this i am using modify stage.I am written below logic in modify stage.

effdate_out:date=date_from_string(effdate_in,"%dd/%mm/%yyyy")

While i am runningthe job it is showing error.

Can i do it using modify stage or i have to use transformer stage.
VINOD
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Your specification should be:

Code: Select all

effdate_out:date=date_from_string["%dd-%mm-%yyyy"](effdate_in)
reddy.vinod
Participant
Posts: 36
Joined: Mon Jul 16, 2007 3:37 am
Location: USA

Post by reddy.vinod »

stefanfrost1 wrote:try

effdate_out:date=date_from_string["%dd/%mm/%yyyy"](effdate_in)
Hi Stefan ,

Thank u a ton.it is working now.
VINOD
Post Reply