Date conversion problem

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

hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Date conversion problem

Post by hhh »

Hello DS Friends,

In my job , source and target are oracle tables .source having portfoliodate column and its datatype is TIMESTAMP. for ex its value is 1998-01-31 00:00:00 . while conveting portfoliodate(Timestamp) into target date(dd-mon-yy) format I am using following Iconv,Oconv function.
1)Substrings(DSLink4.PORTFOLIODATE,1,10)
2)Oconv(Iconv(aa, "D-YMD"), "D-DMY[,A3,2]") .
While running job , i am getting following warnig in every portfoliodate values : "Graph_CSV_sf_Test..Transformer_1: At row 2333, link "DSLink5", while processing column "PortfolioDate"
Value treated as NULL
Attempt to convert String value "31-Jan-98" to Date type unsuccessful"

why value treats as Null that i am not getting, Please share your ideas on this issue.

Thanks
HHH
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Are you sure that your default date format is being used? Execute a SQL "SELECT sysdate from dual;" using your favorite tool and see if that format matches yours.
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Post by hhh »

Yes,default format of date in oracle is dd-mon-yy only, i hv checked it from dual.
However here , portfoliodate has been converted to default format only.




ArndW wrote:Are you sure that your default date format is being used? Execute a SQL "SELECT sysdate from dual;" using your favorite tool and see if that format matches yours. ...
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Are you sure your target formated to dd-mon-yy and not as dd-mm-yyyy?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Post by hhh »

default oracle's date format is dd-mon-yy only,so i have converted it according to target format only.
kumar_s wrote:Are you sure your target formated to dd-mon-yy and not as dd-mm-yyyy?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Which stage are you using to write to Oracle?
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

Why dont you try to insert manually 1 row in target with this date format.... May be one of the way to check format of table...

Thanks,
Anupam
hhh
Participant
Posts: 86
Joined: Tue Aug 02, 2005 7:39 am

Post by hhh »

Manually also i entered the record with this format, and it works fine with this date format.

sb_akarmarkar wrote:Why dont you try to insert manually 1 row in target with this date format.... May be one of the way to check format of table...

Thanks,
Anupam
sb_akarmarkar
Participant
Posts: 232
Joined: Fri Sep 30, 2005 4:52 am
Contact:

Post by sb_akarmarkar »

Is it happing to that 2333 row only ? with timestamp value "1998-01-31 00:00:00"

Thanks,
Anupam
m_keerthi2005
Participant
Posts: 22
Joined: Thu Jun 02, 2005 5:12 am

Post by m_keerthi2005 »

if you use data type as Date or Timestamp, it does not work, because it is not able to treat it data type as Date. if you can use Varchar data type this will work. if you have not any problem you can use. this could be one of the solution.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: Date conversion problem

Post by chulett »

hhh wrote:In my job , source and target are oracle tables .source having portfoliodate column and its datatype is TIMESTAMP. for ex its value is 1998-01-31 00:00:00 . while conveting portfoliodate(Timestamp) into target date(dd-mon-yy) format I am using following Iconv,Oconv function.
Your 'default' or NLS_DATE format don't come into play if you are treating these fields as dates. If you are using OCI stages with Generated SQL and a Timestamp datatype, (which you should be, in my opinion) then your incoming value is already in the proper format for the target.

Drop your substring/Conv transformations and just push the portfoliodate over untouched.
-craig

"You can never have too many knives" -- Logan Nine Fingers
raji
Participant
Posts: 40
Joined: Tue May 16, 2006 6:06 am

Post by raji »

Hi all,

As i am new to Datastage, I want to know that the Functions "Iconv and Oconv" works in Parallel Extender jobs or not.

If not which is the equivalent function to this in parallel jobs.

Please ppl help me out.

thanks in advance
Raji

Nothing is impossible because impossible itself
says I'm Possible
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

IConv and OConv are not available in PX.

This post should be in parallel forum and not in server forum.
sateeshbabu
Participant
Posts: 48
Joined: Sat Oct 22, 2005 9:56 am

Could any one of you let me know parallel forum Link

Post by sateeshbabu »

Hi Balajisr,

Could you let me know parallel forum link.
Plot No – B4, Jeevan Akshyay apts
8/14, 2nd Main Road, Jaya Nagar
Tambaram sanitorium,
Chennai-47.
smandepudi@gmail.com
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Re: Could any one of you let me know parallel forum Link

Post by balajisr »

sateeshbabu wrote:Hi Balajisr,

Could you let me know parallel forum link.

Click on the Forum link on the top of the page. You will get list of forums. Parallel forum is the next link to Server Forum. Parallel forum is same as Enterprise edition forum.

viewforum.php?f=8
Post Reply