Page 1 of 1

TIME field format change In schema file

Posted: Fri Nov 21, 2014 3:36 am
by Dip_DS
Source is sending the time in Decimal (Decimal 7,0) format. We are reading the data using the Schema file (Input = ASCII) and trying to load into Teradata table. We would like load the time field with proper time format.

Field defination in Schema:
XYZ_TIME:nullable Time {time_format='%hh%nn%ss'}

Input recs:
XYZ_Time:
223,644
1,349
72,506
2,123
60,517
337

expected Output data from the target table:

22:36:44 - fine
00:13:49 - rejected
07:25:06 - rejected
00:21:23 - rejected
06:05:17 - rejected
00:03:37 - rejected

There are no issues if the time comes in 6 digits (hh:nn:ss). But schema is rejecting the record if hh or part of nn is missing in the input file.
Is there any way to handle this in schema file. Due to some other architectural / techinal constraints I dont have any other option other than fixing the schema file to fix this.

Any suggesstion?

Re: TIME field format change In schema file

Posted: Fri Nov 21, 2014 5:28 am
by battaliou
Quick question: Are you keeping the type as decimal in your job?

Re: TIME field format change In schema file

Posted: Fri Nov 21, 2014 6:27 am
by Dip_DS
Job is using the schema file to load the data.
In the schema the field is defined as TIME in the below format.
XYZ_TIME:nullable Time {time_format='%hh%nn%ss'}

Posted: Fri Nov 21, 2014 8:10 am
by chulett
Those "double letters" in your format tell it the format is fixed, i.e. always two digits. Start by trying single letters. I don't think it will solve all your problems but give it a shot and let us know.

Posted: Fri Nov 21, 2014 9:42 am
by qt_ky
The time format tag is missing the colons that were shown in the expected output example.

Posted: Fri Nov 21, 2014 10:38 am
by chulett
That format is for the incoming string, not the expected output so should not include the colons.

Posted: Fri Nov 21, 2014 2:00 pm
by qt_ky
I am a little bit confused by what was stated above:

"reading the data using the Schema file"

"using the schema file to load the data"