Page 1 of 1

EBCDIC date issue

Posted: Mon Jul 26, 2010 5:32 am
by Akhobare
Hi,

I am new to EBCDIC file format. I am reading EBCDIC file through Seq. file stage ( not CFF).

Below properties are set : I referred exisitng simple jobs from our repository.

character set : EBCDIC
byte order : big-endian
data format : binary
Recod Type : implicit , delimiter : none.

I have below expression in Transformer.

StringToDate((Lnk_read_from_source.STM_YR):'-':Lnk_read_from_source.STM_MO:'-':Lnk_read_from_source.STM_DAY),"%yyyy-%mm-%dd")

Now , this seems to be leading to below warning.

"Invalid date value in getInputFieldAsDate() for field '1' of input dataset '0'." and further failure in Teradata Mload.Records are going to first Error table.

Can any one help me to know issue?

I can guess , i may need to convert EBCDIC year/day/month fields to ASCII format. IF true , how? Unfortunately we don't have any existing routines in repository..

Thanks in advance. Early reply welcome.

Posted: Mon Jul 26, 2010 6:47 am
by chulett
The stage is doing the conversion for you. Add a peek stage and verify the date format you are building, probably easier to debug if you build it in a stage variable and then convert the end result.

Re: EBCDIC date issue

Posted: Mon Jul 26, 2010 2:45 pm
by vivekgadwal
I wonder if there is a space/spaces arriving within any one of the fields which is causing the tool to throw this error message :? . Please check and see if there is a need to add function to handle this.

Re: EBCDIC date issue

Posted: Fri Aug 13, 2010 2:04 pm
by vinodbp
You need to convert EBCDIC year/day/month fields to ASCII format.

Try below option -

Dtx( seq( DateColomn[1,1]),2) : "-": Dtx( seq( DateColomn[2,1]),2) : "-":Dtx( seq( DateColomn[3,1]),2)

Thanks
Vinod





Akhobare wrote:Hi,

I am new to EBCDIC file format. I am reading EBCDIC file through Seq. file stage ( not CFF).

Below properties are set : I referred exisitng simple jobs from our repository.

character set : EBCDIC
byte order : big-endian
data format : binary
Recod Type : implicit , delimiter : none.

I have below expression in Transformer.

StringToDate((Lnk_read_from_source.STM_YR):'-':Lnk_read_from_source.STM_MO:'-':Lnk_read_from_source.STM_DAY),"%yyyy-%mm-%dd")

Now , this seems to be leading to below warning.

"Invalid date value in getInputFieldAsDate() for field '1' of input dataset '0'." and further failure in Teradata Mload.Records are going to first Error table.

Can any one help me to know issue?

I can guess , i may need to convert EBCDIC year/day/month fields to ASCII format. IF true , how? Unfortunately we don't have any existing routines in repository..

Thanks in advance. Early reply welcome.

Posted: Fri Aug 13, 2010 2:26 pm
by arunkumarmm
If the NLS is EBCDIC, it will convert the data to ASCII.

Also, dtx is to convert decimal to hex right? Will it convert EBCDIC to ASCII?