Problem in loading a 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

Post Reply
Amit_111
Participant
Posts: 134
Joined: Sat Mar 24, 2007 11:37 am

Problem in loading a date

Post by Amit_111 »

Hi All,

I am facing one strange problem. I have a DataStage job created in Windows Environment, in which I use a Date() function to pass Sys Date in the Target DataBase(Oracle9i). Its working fine.
But when I Executed the same Job in UNIX Environment it throws a Warning Message saying "A non-Numeric character was found where a numeric was expected". The Oracle Error code thrown is : ORA 01858
Please Help.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not nearly enough information to be able to help. Except to say I'd wager it's because you are not explicitly handing your date transforms but making assumptions about the formatting.

You also need to verify that Date() returns the same information on both operating systems. I would think they would but you need to check.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Date() inside the transformer or OS level date function? What expression are you using with Date()? Date() creates internal format. Now its upto you to change that to the format you require using the OCONV() function.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Amit_111
Participant
Posts: 134
Joined: Sat Mar 24, 2007 11:37 am

Post by Amit_111 »

I am using the date() function from the Transformer Stage. The database format(scale etc.) is same for both the database. so if it works on windows environment it should work on Unix. Nothing has been changed from job level to the database level except the Environment.

Is it that Unix excepts something more specific than windows( windows might be automatically converting the date format from the date function to the Database format and Unix might not be able to do this).
Is it so?
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

I have not worked on windows so I will let someone else give the insight on that. Unlike DB2, oracle does not like internal formats for dates. It has to be in YYYY-MM-DD format. I dont know how this would have worked in windows keeping in mind that the DSEngine is the same for both the platforms.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
nick.bond
Charter Member
Charter Member
Posts: 230
Joined: Thu Jan 15, 2004 12:00 pm
Location: London

Post by nick.bond »

Write it out to a sequential file and show us what the value is,.
Regards,

Nick.
Amit_111
Participant
Posts: 134
Joined: Sat Mar 24, 2007 11:37 am

Post by Amit_111 »

I will be able to show you this value only on Monday since my weekend has already started :) .
Till then please suggest if you get any idea about this issue.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Post your transforms on this field and the sql you are using in the target stage.
-craig

"You can never have too many knives" -- Logan Nine Fingers
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Post by rafik2k »

Also check the date format at the target database in both windows and unix environment.
As per target date format u need to customize the date() function accordingly.
rafik2k
Participant
Posts: 182
Joined: Wed Nov 23, 2005 1:36 am
Location: Sydney

Post by rafik2k »

Also check the date format at the target database in both windows and unix environment.
As per target date format u need to customize the date() function accordingly.
yiminghu
Participant
Posts: 91
Joined: Fri Nov 14, 2003 10:09 am

Re: Problem in loading a date

Post by yiminghu »

Try to use timestamp(date()) instead of date()
Post Reply