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
senthilmp
Participant
Posts: 85 Joined: Mon Sep 22, 2008 6:11 am
Post
by senthilmp » Fri Dec 12, 2008 9:18 am
Hi,
My source is having one of the 'Date Field' as an integer type , and i want this to be converted as Date type in the target.
eg: the source contains
20080325 i want this to be stored as date format in the target, can any one help out in this?
Regards,
Senthil MP
Sainath.Srinivasan
Participant
Posts: 3337 Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom
Post
by Sainath.Srinivasan » Fri Dec 12, 2008 9:25 am
You can work with it as a string input. What have you attempted so far?
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Fri Dec 12, 2008 9:46 am
Server job as marked or Parallel job per the forum you posted in?
-craig
"You can never have too many knives" -- Logan Nine Fingers
srinivas.g
Participant
Posts: 251 Joined: Mon Jun 09, 2008 5:52 am
Post
by srinivas.g » Sat Dec 13, 2008 1:01 am
througth iconv oconv function
oconv(iconv(columnname),D-DMY),D-DMY[2,2,4])
Srinu Gadipudi
senthilmp
Participant
Posts: 85 Joined: Mon Sep 22, 2008 6:11 am
Post
by senthilmp » Sat Dec 13, 2008 6:57 am
Hi, now its converting but still while inserting into the target table am getting the following error
"Attempt to convert String value "15-08-2005" to Date type unsuccessful"
I tried with both DATA and TIMESTAMP in target but i got this error
srinivas.g
Participant
Posts: 251 Joined: Mon Jun 09, 2008 5:52 am
Post
by srinivas.g » Sat Dec 13, 2008 7:10 am
try this one
OCONV(ICONV(columnname,'D-MDY[2,2,4]'), 'D-YMD[4, 2, 2]')
datatype is timestamp
Srinu Gadipudi
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Sat Dec 13, 2008 8:46 am
OK, Server job it seems. Rather than attack this piecemeal, how about details like target database & stage you are using? Custom or generated SQL? All affect the answer.
-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 » Sat Dec 13, 2008 9:35 am
Hi all,
thanks for the response, i got it by searching DSXchange further,
the solution is have to use only ICONV and not the combination of OCONV & ICONV.
Gr8 Forum
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Sat Dec 13, 2008 10:13 am
So... DB2?
-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 » Sat Dec 13, 2008 10:28 am
No its Oracle
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Sat Dec 13, 2008 11:09 am
In that case, using IConv only doesn't make much sense, but I'll take your word for it that it is actually working for you.
-craig
"You can never have too many knives" -- Logan Nine Fingers