iconv function

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 function

Post by admin »

This is a topic for an orphaned message.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

If its a timestamp, you must first (before applying an ICONV function) strip out the date portion. This could be done with substrings or the FIELD function.

Iconv(TheTimeStamp[1,10], "DYMD")

Iconv(Field(TheTimeStamp, " ", 1, 1), "DYMD")

Depending on your locale, its almost certain you will need to specify the "YMD" (indicating year-month-day order) to the Iconv date conversion. Just "D" uses your current locale setting, which is typically either day-month-year or month-day-year. Just "D" *may* work with YYYY-MM-DD, but its better to be sure.

> ----------
> From: Rick Schirm[SMTP:rick@schirms.net]
> Reply To: informix-datastage@oliver.com
> Sent: Thursday, 14 September 2000 03:37
> To: informix-datastage@oliver.com
> Subject: RE: iconv statement
>
> 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 »

The "D" does not work for the Year first date conversion And Ray is correct must strip off the time portion

*************************************************************
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: Ray Wurlod [mailto:ray.wurlod@informix.com]
Sent: Wednesday, September 13, 2000 4:47 PM
To: informix-datastage@oliver.com
Subject: RE: iconv function


If its a timestamp, you must first (before applying an ICONV function) strip out the date portion. This could be done with substrings or the FIELD function.

Iconv(TheTimeStamp[1,10], "DYMD")

Iconv(Field(TheTimeStamp, " ", 1, 1), "DYMD")

Depending on your locale, its almost certain you will need to specify the "YMD" (indicating year-month-day order) to the Iconv date conversion. Just "D" uses your current locale setting, which is typically either day-month-year or month-day-year. Just "D" *may* work with YYYY-MM-DD, but its better to be sure.

> ----------
> From: Rick Schirm[SMTP:rick@schirms.net]
> Reply To: informix-datastage@oliver.com
> Sent: Thursday, 14 September 2000 03:37
> To: informix-datastage@oliver.com
> Subject: RE: iconv statement
>
> 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
>
>
Locked