Decimal field with Trailing negative signs

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

ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

If you're in a server job you can use Iconv(thevalue, "MDn") where n is the number of decimal places. This function handles signs at either end of the value.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
a2love
Participant
Posts: 30
Joined: Fri Feb 09, 2007 10:03 am

Post by a2love »

Those were all very good ideas. In the end the Iconv() worked very very easily.

Thank you all for your help I really appreciate it! This message board will be getting some good recommendations from me :).

Cheers,
Adam Love
Adam Love
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

A2love - I hate to have to post this at the end of the thread; but you stated you had an EE job; and ICONV() won't work in one unless you call up a BASIC transform stage. :?
Gazelle
Premium Member
Premium Member
Posts: 108
Joined: Mon Nov 24, 2003 11:36 pm
Location: Australia (Melbourne)

Post by Gazelle »

The complication I had was that the Amount was the final column in the delimited sequential file.
eg.
ORDERA,ITEMA,12345.67-
ORDERA,ITEMB,98765.43

When defining the Amount column as a decimal (with "packed=no" and "sign position=trailing"), the row was dropped with the message in the log:
SF_ReadPayment,0: Field "AMOUNT" with 'delim=end' did not consume entire input, at offset: 99


Because this is an adhoc throw-away job, I read the column in as a Varchar and used DSguru2B's "string manipulation" method.

However, it would've been nicer if it could've been handled in the read stage.
Post Reply