type 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
sundar
Participant
Posts: 30
Joined: Thu Sep 01, 2005 10:34 am

type conversion

Post by sundar »

Hi all


source Sequential file field is Double, Length not given

Target sequential file Field is Date and length is 8

it is a 1:1 mapping

I used the below code for conversion,It's giving null value

StringToDate(DecimalToString(DFloatToDecimal(DSLink2.a),"suppress_zero"),"%yyyy-%mm-%dd")

please help me.

Thanks
sundar
ashwin141
Participant
Posts: 95
Joined: Wed Aug 24, 2005 2:26 am
Location: London, UK

type conversion

Post by ashwin141 »

try using

DfloatToStringNoExp
and then string to date.

Regards
Ashwin
sundar
Participant
Posts: 30
Joined: Thu Sep 01, 2005 10:34 am

Post by sundar »

hi ashwin

Thank u for u'r reply

i tried what u said,below is the code.

StringToDate(DFloatToStringNoExp(DSLink2.a,"0"),"%yyyy%mm%dd")

it's showing the field has import error and no default value

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

Post by ray.wurlod »

An import error occurs in an importing stage, not in a Transformer stage. It has no relationship, therefore, to the function you have described. Inspect the generated OSH, determine which stage generates an import operator. Add a rejects link to that stage, leading into a Peek stage so you can see what data are causing the import error.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sundar
Participant
Posts: 30
Joined: Thu Sep 01, 2005 10:34 am

Post by sundar »

Hi Ray

Thank u For u'r Kind reply

my job design look like this

seq1 ----->transformer -----> seq2

to verify the data i put peek stage(reject link) in seq2 and i am getting ******** in the director

please correct me

Thanks
sundar
thompsonp
Premium Member
Premium Member
Posts: 205
Joined: Tue Mar 01, 2005 8:41 am

Post by thompsonp »

Is there anything in the peek that allows you to identify what the source data of the rejected row is? Compare what's in the output file with the input file to identify the value that was rejected.

Are there any other fields in the row that could be getting rejected?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In stage seq1 make sure that (a) the field in question is declared as nullable and (b) that you have specified either a null field value or a null field length property for it. It's the lack of one of these properties about which the error message is complaining.
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