Date conversions

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

Date conversions

Post by admin »

Hi, where can I find more information about the iconv() / oconv() functions ?

I looked at the Server Job Developers Guide, but it only shows examples, and doesnt explain the different codes. Im just having a hard time understanding the codes. I am getting date errors in a new job I created, and I remember from the course having to use oconv() & iconv() to convert dates for Datastage to understand.



Dirk Moolman
Database Administrator
Reach Technologies
South Africa

www.thefuelgroup.co.za

"No pessimist ever discovered the secret of the stars, or sailed to an uncharted land, or opened a new doorway for the human spirit." -Helen Keller




==========================================================
This message contains information intended for the perusal, and/or use (if so stated), by the stated addressee(s) only. The information is confidential and privileged. If you are not an intended recipient, do not peruse, use, disseminate, distribute, copy or in any manner rely upon the information contained in this message (directly or indirectly). The sender and/or the entity represented by the sender shall not be held accountable in the event that this prohibition is disregarded. If you receive this message in error, notify the sender immediately by e-mail, fax or telephone representations contained in this message, whether express or implied, are those of the sender only, unless that sender expressly states them to be the views or representations of an entity or person, who shall be named by the sender and who the sender shall state to represent. No liability shall otherwise attach to any other entity or person. ==========================================================
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Hi Dirk,
i have always found enough info in Datastage help on-line. Open the designer then click on help menu. :o)

Riccardo

----- Original Message -----
From: "Dirk Moolman"
To: "Datastage List"
Sent: Monday, October 01, 2001 3:19 PM
Subject: Date conversions


> Hi, where can I find more information about the iconv() / oconv()
functions
> ?
>
> I looked at the Server Job Developers Guide, but it only shows
> examples, and doesnt explain the different codes. Im just having a
> hard time understanding the codes. I am getting date errors in a new
> job I created, and I remember from the course having to use oconv() &
> iconv() to convert dates for Datastage to understand.
>
>
>
> Dirk Moolman
> Database Administrator
> Reach Technologies
> South Africa
>
> www.thefuelgroup.co.za
>
> "No pessimist ever discovered the secret of the stars, or sailed to an
> uncharted land, or opened a new doorway for the human spirit." -Helen
> Keller
>
>
>
>
> ==========================================================
> This message contains information intended for the perusal, and/or use
> (if so stated), by the stated addressee(s) only. The information is
> confidential and privileged. If you are not an intended recipient, do
> not peruse, use, disseminate, distribute, copy or in any manner rely
> upon the information contained in this message (directly or
> indirectly). The sender and/or the entity represented by the sender
> shall not be held accountable in the event that this prohibition is
> disregarded. If you receive this message in error, notify the sender
> immediately by e-mail, fax or
telephone
> representations contained in this message, whether express or implied,
> are those of the sender only, unless that sender expressly states them
> to be the views or representations of an entity or person, who shall
> be named by the sender and who the sender shall state to represent. No
> liability shall otherwise attach to any other entity or person.
> ==========================================================
>
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Try opening help in your designer. Then, go to index and lookup Oconv. Within this help you can hot key to what the codes mean.

Syntax

Oconv(expression, conversion [@VM conversion] ...)

expression is a string stored in internal format that you want to convert to an output format. If expression is a null value, null is returned.

conversion is one or more "conversion codes" specifying how the string is to be formatted. Separate multiple codes with a "value mark" . If conversion is a null value, it generates a run-time error.

David

-----Original Message-----
From: Dirk Moolman [mailto:dirkm@reach.co.za]
Sent: Monday, October 01, 2001 9:20 AM
To: Datastage List
Subject: Date conversions


Hi, where can I find more information about the iconv() / oconv() functions ?

I looked at the Server Job Developers Guide, but it only shows examples, and doesnt explain the different codes. Im just having a hard time understanding the codes. I am getting date errors in a new job I created, and I remember from the course having to use oconv() & iconv() to convert dates for Datastage to understand.



Dirk Moolman
Database Administrator
Reach Technologies
South Africa

www.thefuelgroup.co.za

"No pessimist ever discovered the secret of the stars, or sailed to an uncharted land, or opened a new doorway for the human spirit." -Helen Keller




==========================================================
This message contains information intended for the perusal, and/or use (if so stated), by the stated addressee(s) only. The information is confidential and privileged. If you are not an intended recipient, do not peruse, use, disseminate, distribute, copy or in any manner rely upon the information contained in this message (directly or indirectly). The sender and/or the entity represented by the sender shall not be held accountable in the event that this prohibition is disregarded. If you receive this message in error, notify the sender immediately by e-mail, fax or telephone representations contained in this message, whether express or implied, are those of the sender only, unless that sender expressly states them to be the views or representations of an entity or person, who shall be named by the sender and who the sender shall state to represent. No liability shall otherwise attach to any other entity or person. ==========================================================
***Note:The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the Sender immediately by replying to the message and deleting it from your computer. Thank you. Premier Inc.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Dirk, check under your start button --> Ardent DataStage --> Online Manuals
--> Universe Documentation....

Ive offered before to send you a copy of my libraries, in which is a bunch of functions to recognize and conform date formats. Make sure you always turn your dates into the ISO form ---> YYYY-MM-DD. This way you can do date comparisons without any difficulty. You also want a function to subtract or add to dates.

Good luck!
-Ken






dirkm@reach.co.za on 01-Oct-2001 09:19



Please respond to datastage-users@oliver.com

To: datastage-users
cc:
Subject: Date conversions


Hi, where can I find more information about the iconv() / oconv() functions ?

I looked at the Server Job Developers Guide, but it only shows examples, and doesnt explain the different codes. Im just having a hard time understanding the codes. I am getting date errors in a new job I created, and I remember from the course having to use oconv() & iconv() to convert dates for Datastage to understand.



Dirk Moolman
Database Administrator
Reach Technologies
South Africa

www.thefuelgroup.co.za

"No pessimist ever discovered the secret of the stars, or sailed to an uncharted land, or opened a new doorway for the human spirit." -Helen Keller




==========================================================
This message contains information intended for the perusal, and/or use (if so stated), by the stated addressee(s) only. The information is confidential and privileged. If you are not an intended recipient, do not peruse, use, disseminate, distribute, copy or in any manner rely upon the information contained in this message (directly or indirectly). The sender and/or the entity represented by the sender shall not be held accountable in the event that this prohibition is disregarded. If you receive this message in error, notify the sender immediately by e-mail, fax or telephone representations contained in this message, whether express or implied, are those of the sender only, unless that sender expressly states them to be the views or representations of an entity or person, who shall be named by the sender and who the sender shall state to represent. No liability shall otherwise attach to any other entity or person. ==========================================================
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Yes, thanks Ken. I apologise if Im not using your libraries right now. Im just taking **baby steps** first. Everything is new to me right now. I also wrote a routine today for calculating values off a string. For me it was quite cool, just getting it to work, but for you it will be a very simple function. I think I figured out the date conversions. I tested a couple of my own formats that werent in the examples, and they worked.

Regarding the ISO form (YYYY-MM-DD), I will try keeping it this way, but for reading / loading I will use different formats. Redbrick accepts MM-DD-YYYY, and so on.

Thanks for the e-mail
Regards
Dirk

-----Original Message-----
From: Ken_2_Bland@sbphrd.com [mailto:Ken_2_Bland@sbphrd.com]
Sent: Monday, October 01, 2001 3:54 PM
To: datastage-users@oliver.com
Subject: Re: Date conversions



Dirk, check under your start button --> Ardent DataStage --> Online Manuals
--> Universe Documentation....

Ive offered before to send you a copy of my libraries, in which is a bunch of functions to recognize and conform date formats. Make sure you always turn your dates into the ISO form ---> YYYY-MM-DD. This way you can do date comparisons without any difficulty. You also want a function to subtract or add to dates.

Good luck!
-Ken






dirkm@reach.co.za on 01-Oct-2001 09:19



Please respond to datastage-users@oliver.com

To: datastage-users
cc:
Subject: Date conversions


Hi, where can I find more information about the iconv() / oconv() functions ?

I looked at the Server Job Developers Guide, but it only shows examples, and doesnt explain the different codes. Im just having a hard time understanding the codes. I am getting date errors in a new job I created, and I remember from the course having to use oconv() & iconv() to convert dates for Datastage to understand.



Dirk Moolman
Database Administrator
Reach Technologies
South Africa

www.thefuelgroup.co.za

"No pessimist ever discovered the secret of the stars, or sailed to an uncharted land, or opened a new doorway for the human spirit." -Helen Keller




==========================================================
This message contains information intended for the perusal, and/or use (if so stated), by the stated addressee(s) only. The information is confidential and privileged. If you are not an intended recipient, do not peruse, use, disseminate, distribute, copy or in any manner rely upon the information contained in this message (directly or indirectly). The sender and/or the entity represented by the sender shall not be held accountable in the event that this prohibition is disregarded. If you receive this message in error, notify the sender immediately by e-mail, fax or telephone representations contained in this message, whether express or implied, are those of the sender only, unless that sender expressly states them to be the views or representations of an entity or person, who shall be named by the sender and who the sender shall state to represent. No liability shall otherwise attach to any other entity or person. ==========================================================
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Thanks Riccardo ! I keep forgetting about the online help.

Regards
Dirk

-----Original Message-----
From: Riccardo Tani [mailto:rtani@datamat.it]
Sent: Monday, October 01, 2001 3:35 PM
To: datastage-users@oliver.com
Subject: Re: Date conversions


Hi Dirk,
i have always found enough info in Datastage help on-line. Open the designer then click on help menu. :o)

Riccardo

----- Original Message -----
From: "Dirk Moolman"
To: "Datastage List"
Sent: Monday, October 01, 2001 3:19 PM
Subject: Date conversions


> Hi, where can I find more information about the iconv() / oconv()
functions
> ?
>
> I looked at the Server Job Developers Guide, but it only shows
> examples, and doesnt explain the different codes. Im just having a
> hard time understanding the codes. I am getting date errors in a new
> job I created, and I remember from the course having to use oconv() &
> iconv() to convert dates for Datastage to understand.
>
>
>
> Dirk Moolman
> Database Administrator
> Reach Technologies
> South Africa
>
> www.thefuelgroup.co.za
>
> "No pessimist ever discovered the secret of the stars, or sailed to an
> uncharted land, or opened a new doorway for the human spirit." -Helen
> Keller
>
>
>
>
> ==========================================================
> This message contains information intended for the perusal, and/or use
> (if so stated), by the stated addressee(s) only. The information is
> confidential and privileged. If you are not an intended recipient, do
> not peruse, use, disseminate, distribute, copy or in any manner rely
> upon the information contained in this message (directly or
> indirectly). The sender and/or the entity represented by the sender
> shall not be held accountable in the event that this prohibition is
> disregarded. If you receive this message in error, notify the sender
> immediately by e-mail, fax or
telephone
> representations contained in this message, whether express or implied,
> are those of the sender only, unless that sender expressly states them
> to be the views or representations of an entity or person, who shall
> be named by the sender and who the sender shall state to represent. No
> liability shall otherwise attach to any other entity or person.
> ==========================================================
>
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Thanks, this is also what the manual said (the syntax you printed below). The "conversion codes" had me baffled for a while. There are lots of examples, but the arent really explained. I think Ive got it now. I studied the examples and tried a couple of my own formats that werent in the examples, and they worked !

Thanks for the e-mail.

-----Original Message-----
From: Lathan, David [mailto:David_Lathan@PremierInc.com]
Sent: Monday, October 01, 2001 3:47 PM
To: datastage-users@oliver.com
Subject: RE: Date conversions


Try opening help in your designer. Then, go to index and lookup Oconv. Within this help you can hot key to what the codes mean.

Syntax

Oconv(expression, conversion [@VM conversion] ...)

expression is a string stored in internal format that you want to convert to an output format. If expression is a null value, null is returned.

conversion is one or more "conversion codes" specifying how the string is to be formatted. Separate multiple codes with a "value mark" . If conversion is a null value, it generates a run-time error.

David

-----Original Message-----
From: Dirk Moolman [mailto:dirkm@reach.co.za]
Sent: Monday, October 01, 2001 9:20 AM
To: Datastage List
Subject: Date conversions


Hi, where can I find more information about the iconv() / oconv() functions ?

I looked at the Server Job Developers Guide, but it only shows examples, and doesnt explain the different codes. Im just having a hard time understanding the codes. I am getting date errors in a new job I created, and I remember from the course having to use oconv() & iconv() to convert dates for Datastage to understand.



Dirk Moolman
Database Administrator
Reach Technologies
South Africa

www.thefuelgroup.co.za

"No pessimist ever discovered the secret of the stars, or sailed to an uncharted land, or opened a new doorway for the human spirit." -Helen Keller




==========================================================
This message contains information intended for the perusal, and/or use (if so stated), by the stated addressee(s) only. The information is confidential and privileged. If you are not an intended recipient, do not peruse, use, disseminate, distribute, copy or in any manner rely upon the information contained in this message (directly or indirectly). The sender and/or the entity represented by the sender shall not be held accountable in the event that this prohibition is disregarded. If you receive this message in error, notify the sender immediately by e-mail, fax or telephone representations contained in this message, whether express or implied, are those of the sender only, unless that sender expressly states them to be the views or representations of an entity or person, who shall be named by the sender and who the sender shall state to represent. No liability shall otherwise attach to any other entity or person. ==========================================================
***Note:The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the Sender immediately by replying to the message and deleting it from your computer. Thank you. Premier Inc.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Hi Dirk,

As well as the information in the online help, there are a load of useful conversion charts in the UniVerse Basic guide, appendix C1. If the manual was installed on your machine, they should be under the "Online Manuals" menu. Otherwise it can be accessed directly off your installation CD under Client-Docs-ENU-books-UniVerse-Basic.

Regards

- Chris Thornton
Locked