Format a negative number

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

Format a negative number

Post by admin »

I have a source system that gives me a negative value like: 22122-

There is in DataStage, any function/format to convert this value in -22122?

Thanks in Advance,

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

Post by admin »

Try something like

Iconv(input,"ML0M")


I havent tested this, but if it isnt quite right, check ou the help on Iconv

-----Original Message-----
From: Nuno Pimenta [mailto:nuno.pimenta@tmn.pt]
Sent: Thursday, 23 August 2001 8:43 PM
To: LIST-DataStage (E-mail)
Subject: Format a negative number

I have a source system that gives me a negative value like: 22122-

There is in DataStage, any function/format to convert this value in -22122?

Thanks in Advance,

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

Post by admin »

Iconv(number, "MD0-") will do it.

The "MD" conversion (see BASIC Reference Guide) also handles other forms of negative number, such as appended "CR" or "DB", or notation.

-----Original Message-----
From: Nuno Pimenta [mailto:nuno.pimenta@tmn.pt]
Sent: Thursday, 23 August 2001 20:43
To: LIST-DataStage (E-mail)
Subject: Format a negative number


I have a source system that gives me a negative value like: 22122-

There is in DataStage, any function/format to convert this value in -22122?

Thanks in Advance,

NP
Locked