Page 1 of 1

Schema files - default date

Posted: Fri Jun 12, 2009 9:41 am
by Sreenivasulu
Hi All,

For date columns how do we define the default value. This would be applicable when the column is empty


I tried the default dataype for date used in datastage. It then asks to put the datatype for the column. If i give the column's datatype it asks to u se the datastage default format.

Regards
Sreeni

Re: Schema files - default date

Posted: Fri Jun 12, 2009 9:52 am
by ddevdutt
Can you be a little more specific, like what stage are you talking about? Can you also explain what is it that you are trying to do?
Sreenivasulu wrote:Hi All,

For date columns how do we define the default value. This would be applicable when the column is empty


I tried the default dataype for date used in datastage. It then asks to put the datatype for the column. If i give the column's datatype it asks to u se the datastage default format.

Regards
Sreeni

Posted: Fri Jun 12, 2009 12:17 pm
by crouse
My experience with dates on input is to define them as VARCHAR 10, then analyze and default them in a transformer.
Else, you run into issues of format, defaults, nulls, null lengths, null values... not worth it trying to define it in the schema.

-Craig

Posted: Sat Jun 13, 2009 7:52 am
by Sreenivasulu
Hi,

Thanks for your response

I understand that we can use varchar. This solution is not applicable here since i use a single job to load 100 files using different schema files with different date formats.

Regards
Sreeni

Posted: Sat Jun 13, 2009 8:24 am
by crouse
Good luck.

So, do you have a solution to share?

Posted: Sun Jun 14, 2009 5:18 am
by Sreenivasulu
No Not yet. But i think i am doing wrong somewhere. It should be possible.

Regards
Sreeni

crouse wrote:Good luck.

So, do you have a solution to share?

Posted: Sun Jun 28, 2009 7:17 am
by Sreenivasulu
How to implement default date in a schema file

Any ideas ?


Regards
Sreeni

Posted: Sun Jun 28, 2009 8:19 am
by crouse
Define as varchar and check within a transformer or custom routine. You could have had that coded by now. :wink:

Posted: Sun Jun 28, 2009 4:18 pm
by chulett
What is your target? If it's a database, define your 'default' there.

Posted: Sun Jun 28, 2009 4:35 pm
by ray.wurlod
Schema files can only provide constants as defaults. It is not possible to provide "current date" as a default. It is, of course, possible to provide "1967-12-31" as a default date, since "1967-12-31" is a constant.

Posted: Mon Jun 29, 2009 3:34 am
by Sreenivasulu
Thanks for your inputs.

I will try to fix it by having a default date as a 'value' instead of trying 'current date'

Thanks
Sreeni