something about date

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

sylvan_rydes
Participant
Posts: 47
Joined: Wed Apr 12, 2006 12:13 pm

something about date

Post by sylvan_rydes »

Hi All,

I got something interesting while creating a job. I had one constant input date which is 12/31/2999. When I connect to output link and run the job. I see 12/31/1967 instead of 12/31/2999.

Also if the field is nullable then how can we just leave the space empty in the column.

Any suggestion. Thanks.

Sylvan
sylvan rydes
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

what is your source and target?
As for your second question, check for null in transformer and insert literal 'NULL' or some other value, as you wish.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Re: something about date

Post by gateleys »

sylvan_rydes wrote: Also if the field is nullable then how can we just leave the space empty in the column.
Use IF(ISNULL(InLink.ColumnName)) THEN @NULL ELSE InLink.ColumnName in the column derivation.

gateleys
sylvan_rydes
Participant
Posts: 47
Joined: Wed Apr 12, 2006 12:13 pm

Post by sylvan_rydes »

Thanks for the reply

My source is Oracle OCI8 and same is target.

Sylvan
sylvan rydes
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

are you doing some kind of conversions. Especially date conversions.
From the looks of it, you are trying to ICONV and then OCONV.
The ICONV is not set up correctly and hence its spitting out a zero. The Oconv takes that zero and turns it into 12/31/1967 as that the translation of 0 internally by Datastage.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sylvan_rydes
Participant
Posts: 47
Joined: Wed Apr 12, 2006 12:13 pm

Post by sylvan_rydes »

Hi Jules,

Thanks a lot for the reply. Well I am just trying to pass a string 12/31/2999 to date but as it is not valid So it is returning junk values. I also used the following function:

Oconv(Iconv('12/31/2999', 'D/MDY[2,2,4]'), 'D/MDY[2,2,4]')
but still it says input invalid.

But if I use output type as character then job is done successfully.

Now can you help me.

Sylvan
sylvan rydes
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

What is the data type in your target?

gateleys
sylvan_rydes
Participant
Posts: 47
Joined: Wed Apr 12, 2006 12:13 pm

Post by sylvan_rydes »

It is Date type and I don't want to change it.

Thanks gateleys
sylvan rydes
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

IF you are pulling for an oracle table and able to pull that kind of date successfully, then how come you are not able to load it.
Are you sure your immediate source is Oracle table. Or is it a flat file.
If it is a flat file then you have to convert it to a format that Oracle excepts.
I am a bit confused here. Can you clearly state your design, and what transformations you are doing and how?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sylvan_rydes
Participant
Posts: 47
Joined: Wed Apr 12, 2006 12:13 pm

Post by sylvan_rydes »

Thanks for the reply.

I have got two options. One is start date and other one is end date. Start date could be anything or null and end date is 12/31/2999. Both are constant. And I need to fill them in target. As I told you only the startdate is from input OCI8 which could be NULL. And Enddate is constant.

I guess this makes is clear.

Sylvan
sylvan rydes
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Here is what i found
click on me

I Think there is a format change problem. I am not familiar with Oracle so i cannot comment more on that.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
sylvan_rydes
Participant
Posts: 47
Joined: Wed Apr 12, 2006 12:13 pm

Post by sylvan_rydes »

thanks a lot Jules.
sylvan rydes
diamondabhi
Premium Member
Premium Member
Posts: 108
Joined: Sat Feb 05, 2005 6:52 pm
Location: US

Post by diamondabhi »

Who is Jules and ehy r u tahnking him? :shock:
Every great mistake has a halfway moment, a split second when it can be recalled and perhaps remedied.
sylvan_rydes
Participant
Posts: 47
Joined: Wed Apr 12, 2006 12:13 pm

Post by sylvan_rydes »

My misunderstanding. I had seen the name not the quote.
sylvan rydes
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

Day 0 in the DS BASIC internal date world is 1967-12-31. Somehow you're getting to there in your manipulations.
Last edited by kcbland on Wed Apr 19, 2006 8:31 pm, edited 1 time in total.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
Post Reply