Oconv and iconv

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
santosh_reddy
Participant
Posts: 1
Joined: Tue Oct 31, 2006 12:14 am
Location: Hyderabad

Oconv and iconv

Post by santosh_reddy »

Hi all

Can anyone please help me out in understanding and using the oconv and iconv functions.

Thanks in advance

santosh
ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post by ShaneMuir »

Welcome Aboard! :)

Oconv converts to an output format, Iconv to an internal storage format.

Given that there are so many different conversions that can be acheived with Oconv and Iconv the easiest way to learn about them is to read the documentation or press help.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Check you online manuals available in you client. You can find this documented under Basic Programing in Server Job Developers guide.
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Open Help from Designer.
Type in the topic BASIC Tasks.
Choose Data Formatting from the topic list.
Choose Oconv or Iconv from there.
Read and absorb.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
DSbox61
Premium Member
Premium Member
Posts: 62
Joined: Mon May 22, 2006 10:18 am

Post by DSbox61 »

this is one example how you can use it:
Oconv(Iconv(PriceIn.eventenddate, "DMDY"), "D-YMD[4,2,2]")

iconv converts a date format to decimal type and oconv tkes that as input and delivers it in a date format.
gateleys
Premium Member
Premium Member
Posts: 992
Joined: Mon Aug 08, 2005 5:08 pm
Location: USA

Post by gateleys »

Another example that gives the date output in the format YYMM if the input date is in the format YYYY-MM-DD

Code: Select all

Oconv(Oconv(Iconv(Arg1, "D-YMD"), "DYM[2,2]"), "MCN")
gateleys
ak77
Charter Member
Charter Member
Posts: 70
Joined: Thu Jun 23, 2005 5:47 pm
Location: Oklahoma

Post by ak77 »

Hi everybody -

I have a simple doubt. I recently learned that its not required to specify the format when u use ICONV alone to get the internal number for comparison

Code: Select all

Iconv(link1.variable, 'D')
Is this always true?

Thanks
AK77
Post Reply