cancel
Showing results for 
Search instead for 
Did you mean: 

DateTrans Function in Mapping

Former Member
0 Kudos

Hi,

Am using DateTrans Function in Mapping to convert YYYYMMDD(20100101) to MM/DD/YYYY(01/01/2010).

In the DateTrans Function Properties, i hv given input date format as (YYMMDD)(no seperator).

Output date format as (MM/DD/YYYY).

But, its giving me message as ,

Runtime exception when processing target-field mapping /ns1:MT_************/DT_Record/gbdat; root message: Unparseable date: "20100101"

Any idea.....wat might be the issue......

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

>

> Hi,

>

> Am using DateTrans Function in Mapping to convert YYYYMMDD(20100101) to MM/DD/YYYY(01/01/2010).

>

> In the DateTrans Function Properties, i hv given input date format as (YYMMDD)(no seperator).

> Output date format as (MM/DD/YYYY).

>

>

> But, its giving me message as ,

>

> Runtime exception when processing target-field mapping /ns1:MT_************/DT_Record/gbdat; root message: Unparseable date: "20100101"

Santosh,

In the input format give date as "yyyyMMdd"

click on the help icon (little question mark) and remove the date separator "/" and replace with blank.

In the output format give MM/dd/YYYY and make sure to double check the separator which by default is "/"

Regards,

Former Member
0 Kudos

hi pavan,

i followed all the steps mentioned by u .

But, still getting Unparseable date: error.

Another issue i see is,

Everytime i remove the date separator "/" and replace with blank.

Once i go back there, it is reset back to separator "/" .

I tried, saving/activating etc etc........

any clues on this.......

Former Member
0 Kudos

Write a udf and use the SimpleDateFormat class.

Former Member
0 Kudos

Hi Santhosh,

I think you might be keeping the letters as Caps.

keep input format = yyyymmdd

output format = mm/dd/yyyy

This should surely do. I have tried with the Caps and making sure that it will produce an exception in mapping.

Do keep as small letters or copy the formats that I mentioned above.

Thanks,

Former Member
0 Kudos

Thanks dude it worked..........

santosh.

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Santosh,

Your incoming format is YYYYMMDD(20100101) and outgoing format is MM/DD/YYYY(01/01/2010). To convert this u should use the Datetrans function availabe under the Date function.

The problem in your case is that the the input value does not match the input format.

Please change your mapping as follows:

In the properties of the datetrans function, keep the input as yyyymmdd and in the output as mm/dd/yyyy.

P.s: the format should be specified in small letters.

I hope this helps.

Regards, Gaurav.

Former Member
0 Kudos

Thank you for your responses.

I tried all the options mentioned by all of you guys.

But, when i display queue, its giving error as ( Unparseable date: "" ).

Do i need to do any other settings.

Or, can someone provide UDF logic for converting

YYYYMMDD(20100101) to MM/DD/YYYY(01/01/2010).

cheers.

santosh.

Former Member
0 Kudos

You can add / change the date format by using the date transfer mation function give it like this

input as yyyymmdd and in the output as mm/dd/yyyy .

@ Make shure while giving the above format small letters is must.

Regards,

Ravi.

Former Member
0 Kudos

Hi Santosh,

I see that you would like to convert the format from YYYYMMDD(20100101) to MM/DD/YYYY(01/01/2010). To convert this u are using the Datetrans function. Thats fine!!!

One thing you are missing out is the format. You have selected as YYMMDD and trying to send as 20100101. Thats wrong. so it is not able to map the data.

Follow the below:

In the properties of the datetrans function, keep the input as yyyymmdd and in the output as mm/dd/yyyy.

P.s: the letters entered in the function properties should be small letters.

Thanks,

Former Member
0 Kudos

Hi,

Change the format to yyyyMMdd to MM/dd/yyyy. it Will work..

Remember y and d has to be small letters

Thanks,

Kiran

Edited by: King_kiran on Dec 20, 2010 5:35 AM

0 Kudos

Hello,

you write:

..... i hv given input date format as (YYMMDD)(no seperator), but you send a date in this form 20100101. Could it be that this is the reason for the exeption.

You should modify the input date format to YYYYMMDD or the input date to e.g. 100101

Hope that could help you ....