how to define date of D-MMM-YY in a schema file

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
dsnovice
Participant
Posts: 38
Joined: Thu Jul 22, 2004 11:56 pm
Location: Mclean, VA
Contact:

how to define date of D-MMM-YY in a schema file

Post by dsnovice »

Hello All,

I have a problem where the date that we get from a source file is in format of d-mmm-yy or .. dd-mmm-yyyy format.
like 1-Jan-09 the same row also contains 11-Jan-09.

So how do I define the record as a date in a schema file? I am planning to use Run time column propagation from there on to get it loaded into a table. Because of this req, handling the date by the field length in the transformer is not an option.

The table currently has the target columns as date. So when I run the job I get the error :
Conversion error calling conversion routine date_from_string data may have been lost

Thank you,

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

Post by ray.wurlod »

You don't. You can define it as string, then bring it into a standard format (for example by adding leading zeroes to day and month where required) before converting to Date 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.
dsnovice
Participant
Posts: 38
Joined: Thu Jul 22, 2004 11:56 pm
Location: Mclean, VA
Contact:

Post by dsnovice »

Ray, Thank you for the reply.

Do you mean to say that all this could be done dynamically by using RCP or do I have to individually prefix the zero for each column where it is required?

What about tagged records? could that be employed to get around this? Kind of new to PX.. and curious.

thank you,

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

Post by ray.wurlod »

That's not what RCP does, so no to that question. There is no automatic mechanism of which I am aware; put simply your data do not match your metadata (record schema) in all cases. Only one format can be specified for any single date field in a record schema.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
dsnovice
Participant
Posts: 38
Joined: Thu Jul 22, 2004 11:56 pm
Location: Mclean, VA
Contact:

Post by dsnovice »

Thank you, That settles the case. I will load them as varchar into the tables by switching the date fields to Varchar(10).

Thank you,

a novice
Post Reply