Converting Amount in integer to amount in words

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
abhilashnair
Participant
Posts: 284
Joined: Fri Oct 13, 2006 4:31 am

Converting Amount in integer to amount in words

Post by abhilashnair »

I have a requirement to Convert Amount in integer to amount in words
For eg: 1500 in source should get converted to Thousand Five Hundred in target

Any suggestions?
Last edited by abhilashnair on Mon Nov 19, 2012 2:57 am, edited 1 time in total.
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post by vamsi.4a6 »

What about the source and target details?Is it a flat file or database etc?
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

An external routine might be able to ease your job. Not too sure about a tailor-made functionality in DataStage that wills erve your purpose
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
abhilashnair
Participant
Posts: 284
Joined: Fri Oct 13, 2006 4:31 am

Post by abhilashnair »

The source as well as target will be database
jerome_rajan
Premium Member
Premium Member
Posts: 376
Joined: Sat Jan 07, 2012 12:25 pm
Location: Piscataway

Post by jerome_rajan »

See if This helps. You can probably get a custom SQL at your source. This is under the assumption that your database is Oracle. Not too ure whether the SQLs mentioned will work with other DBs
Jerome
Data Integration Consultant at AWS
Connect With Me On LinkedIn

Life is really simple, but we insist on making it complicated.
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post by vamsi.4a6 »

If is oracle means then u can use below query

select to_char(to_date(1500 ,'j'),'jsp') from dual;

If it is some other Database means use equivalent functions for to_date,to_char
abhilashnair
Participant
Posts: 284
Joined: Fri Oct 13, 2006 4:31 am

Post by abhilashnair »

So this means I have to rely on database functions and not on DataStage?
vamsi.4a6
Participant
Posts: 334
Joined: Sun Jan 22, 2012 7:06 am
Contact:

Post by vamsi.4a6 »

I think we do not have any Direct function in Datastage,otherwise you have to write external parallel routine suggested by jerome_rajan
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

There's nothing built-in, but you can certainly create a routine. I recall creating a server routine to do just this thing many years back. Resolve certain questions first, such as whether commas and "and" are needed. For example "one thousand seven hundred twenty eight" or "one thousand, seven hundred and twenty eight". This routine is a useful example of recursion; you only need to write the function to handle up to a million; it can call itself to handle larger numbers.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply