Schema files - default date

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Schema files - default date

Post 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
ddevdutt
Participant
Posts: 47
Joined: Wed Aug 22, 2007 2:38 pm

Re: Schema files - default date

Post 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
DD

Success is right around the corner
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post 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
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post 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
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post by crouse »

Good luck.

So, do you have a solution to share?
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post 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?
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post by Sreenivasulu »

How to implement default date in a schema file

Any ideas ?


Regards
Sreeni
crouse
Charter Member
Charter Member
Posts: 204
Joined: Sun Oct 05, 2003 12:59 pm
Contact:

Post by crouse »

Define as varchar and check within a transformer or custom routine. You could have had that coded by now. :wink:
Craig Rouse
Griffin Resouces, Inc
www.griffinresources.com
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What is your target? If it's a database, define your 'default' there.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sreenivasulu
Premium Member
Premium Member
Posts: 892
Joined: Thu Oct 16, 2003 5:18 am

Post 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
Post Reply