iconv statement

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

iconv statement

Post by admin »

I am trying to convert a timestamp from SQL Server to uv in internal format. I am using the iconv statement with the d conversion but it doesnt seem to work. Does anyone know what the correct conversion is?

Seema
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

for the date it would be
iconv(SqlDateValue,"D-YMD[4,2,2]")

*************************************************************
Rick Schirm
Application Performart Ltd.
Vice President of Engineering
mailto:rick.schirm@performart.com
web: www.performart.com
phone: 817.291.6177
*************************************************************


-----Original Message-----
From: Seema Ranchoddas [mailto:seemar@netcare.co.za]
Sent: Wednesday, September 13, 2000 10:18 AM
To: informix-datastage@oliver.com
Subject: iconv statement


I am trying to convert a timestamp from SQL Server to uv in internal format. I am using the iconv statement with the d conversion but it doesnt seem to work. Does anyone know what the correct conversion is?

Seema
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Seema,

You may need to write your own routines
yourself in Manager. I move date columns
to and from Unidata (similar to UV) from
Oracle and Informix a lot. For Oracle
timestamps I take a substring. The
format is yyyy-mm-dd 00:00:00 so X=timestamp[1,10]
then Iconv the result using Iconv(X,"D").

I Iconv Informix dates that seem to come in DS in the
format of YYYY/MM/DD. I have to rearrange the
date string as X=date[6,2]:"/":date[9,2]:"/":date[1,4]
to get it a MM/DD/YYYY format then Iconv the result
to Internal format.

Im not on SQL Server but my point is you may have
to treat the date as a string, cut it up, and rearrange
it before you Iconv it to an internal integer format.

Im running DS version 4.01 and some of the vendor
supplied routines did not work for me so I wrote my own.

Hope this helps

Mark Detwiler
Detwiler Consulting
mailto:mark@msdetwiler.com

-----Original Message-----
From: Seema Ranchoddas
To: informix-datastage@oliver.com
Date: Wednesday, September 13, 2000 9:27 AM
Subject: iconv statement


I am trying to convert a timestamp from SQL Server to uv in internal format. I am using the iconv statement with the d conversion but it doesnt seem to work. Does anyone know what the correct conversion is?

Seema
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Mark,

You dont need to go to all that trouble. Simply use Iconv(TheDate, "DYMD") where YMD asserts that the input date is in year, month, day order.

Ray

> ----------
> From: Mark Detwiler[SMTP:mark@msdetwiler.com]
> Reply To: informix-datastage@oliver.com
> Sent: Saturday, 16 September 2000 18:35
> To: informix-datastage@oliver.com
> Subject: Re: iconv statement
>
> Seema,
>
> You may need to write your own routines
> yourself in Manager. I move date columns
> to and from Unidata (similar to UV) from
> Oracle and Informix a lot. For Oracle
> timestamps I take a substring. The
> format is yyyy-mm-dd 00:00:00 so X=timestamp[1,10]
> then Iconv the result using Iconv(X,"D").
>
> I Iconv Informix dates that seem to come in DS in the
> format of YYYY/MM/DD. I have to rearrange the
> date string as X=date[6,2]:"/":date[9,2]:"/":date[1,4]
> to get it a MM/DD/YYYY format then Iconv the result
> to Internal format.
>
> Im not on SQL Server but my point is you may have
> to treat the date as a string, cut it up, and rearrange
> it before you Iconv it to an internal integer format.
>
> Im running DS version 4.01 and some of the vendor
> supplied routines did not work for me so I wrote my own.
>
> Hope this helps
>
> Mark Detwiler
> Detwiler Consulting
> mailto:mark@msdetwiler.com
>
> -----Original Message-----
> From: Seema Ranchoddas
> To: informix-datastage@oliver.com
> Date: Wednesday, September 13, 2000 9:27 AM
> Subject: iconv statement
>
>
> I am trying to convert a timestamp from SQL Server to uv in internal
> format. I am using the iconv statement with the d conversion but it
> doesnt seem to work. Does anyone know what the correct conversion is?
>
> Seema
>
>
>
Locked