String to Date conversion--Missing values on mainframe file

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
dscon9128
Participant
Posts: 25
Joined: Fri Jun 13, 2008 9:11 am

String to Date conversion--Missing values on mainframe file

Post by dscon9128 »

Hello,

I have a field "date1" and 4 other fields(all fields are char datatypes) coming from a file on the mainframe. I'm FTP'ing it as a char datatype and then passing it onto a column import stage to read it as one column and then feeding it to a transformer where i'm trimming it and converting it to varchar. In the next transformer i'm performing the string to date conversions.

The job is: FTP--->COLUMN IMPORT--->TRANSFORMER---->TRANSFORMER--->PEEK

When I'm executing this job it gives me an error saying:

"APT_CombinedOperatorController,2: Conversion error calling conversion routine date_from_string data may have been lost "

The "date1" has '*******' being propagated. The thing here is the "date1" field in the mainframe file has blanks or missing values and these are the ones that are being propagated as asterisks. The proper values are being formatted in the correct way.

The "date1" field has the following format on the file. Eg: 2007-05-12. It is of datatype char(10) on the mainframe file. But the destination is of date type.


Any help in resolving this issue would be really appreciated.


Thanks,

dscon9128
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

" " is not a valid date, which is why DataStage is handling it like that. You need to intercept the spaces value and replace it with some valid date, such as 4000-01-01, or declare spaces as the Null Value for that field, before converting the data type.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dscon9128
Participant
Posts: 25
Joined: Fri Jun 13, 2008 9:11 am

Post by dscon9128 »

Thank you very much..really appreciate the help..your solution worked
Post Reply