cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in Date field.

vijay_b4
Active Contributor
0 Kudos

Hi,

I am mapping source date( yyyyMMdd) - date transformation(MMddyy) - mapping to target.

In my input data, i got the input as 00000000 and my output from date transformation is showing as 113002. Can anyone please explain why its showing like that?

Thanks & Regards,

Pragathi.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

In my input data, i got the input as 00000000 and my output from date transformation is showing as 113002. Can anyone please explain why its showing like that?

All 0's is not a valid date, that's why the date transformation throws a weird output. Make sure you get a valid date for this transformation.

If there is a possiblity that you might get all 0's in your date field, then better to filter those and make sure that they escape the transformation step.

Hope this helps.

Regards,

Neetesh

Edited by: Neetesh Raj on Nov 12, 2009 9:26 AM

Answers (1)

Answers (1)

Former Member
0 Kudos

Write a small UDF before sending the input to datetrans function.

String yr = a.substring(0,4);

String mm=a.substring(4,6);

String dd=a.substring(6,8);

if(yr.equals("0000")||mm.equals("00")||dd.equals("00"))

{

return "false";

}

else

return "true";

UDF output should be given to ifWithoutElse. Input to 'Then' need to be your source date.

Make sure that your output node's occurence is 0..1 or 0..unbounded if using 'ifWithoutElse' function. Otherwise use 'if'

function and pass a blank value in 'else' part.

Thanks,

Vishal

Edited by: Vishal.P.Kulkarni on Nov 11, 2009 6:11 AM