String to DB2 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
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

String to DB2 Date conversion

Post by I_Server_Whale »

Hi all,

I have a simple job design as follows:

Code: Select all


Sequential file Stage ----> Xfmr -----> DB2 table

One of the mapping is:

Sequential.FirstDate ---> DB2table.FirstDate

Sequential.FirstDate is of Varchar(8) datatype and is of the format yyyymmdd(20050914).

DB2table.FirstDate is of the Date datatype.

How would I convert the incoming varchar datatype to the target DB2 date datatype in the transformer?

Is it as simple as :

Code: Select all

StringToDate(Sequential.FirstDate,"%yyyy%mm%dd")
?

But when I tried the above, I get the following error:

Code: Select all

APT_CombinedOperatorController(0),0: Invalid character(s) ([x2E73]) found converting Unicode string (code point(s): 55555[x0000][x0000][x2E73][x0000][x5041]) to codepage windows-1252, substituting.
And no rows are being loaded into the target DB2 table.

FYI, NLS is enabled. Has that got to do something? How do I proceed? Any suggesstions/guidance/inputs greatly appreciated.

Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Try removing all references to Unicode (at least for this column) throughout your job design, to see whether it is string vs ustring that is the culprit.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

Many thanks, Ray! I will try that and get back.

Regards,

Whale.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

DataStage, it seems to me, is way too enthusiastic to mark columns as Unicode, even when the database from which table definitions are imported differentiate between Char and NChar, VarChar and NVarChar. It should manage these more gracefully (no Unicode for Char and VarChar).
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