Hello All,
I need to remove a leading space and trailing '.' from my source data.
The source is a mainframe file. The source field attributes are --
Native Type : DISPLAY NUMERIC
Length : 3
Scale : 0
Level Number : 3
USAGE : DISPLAY
SQL Type : Decimal
Storage Length : 3
Picture : PIC 93
Now lets say my Input is coming as ' 999.' -->> My desired output is '999'.
The Target Datatype is - Numeric(3).
Please advice on how to move ahead with replacing/removing it.. Tried using the Convert & Trim Functions.. But nothing positive..!!
@Sudha01_vpr -- I tried Ereplace(), but it was not working.. It works only with strings..!!
Also, as per my findings in DSXchange-EReplace() works with version 9.1, and pxEReplace() is not advised to be used.. Am working with DataStage 8.7..
Let me try it once with DecimalToString(), but again the datatypes needed to be tweaked..!!
Numeric datatype will have the . when printed to a file. File doesn't have any datatype as such, so you can change the datatype in datastage. Reading program can still read it as decimal.
Priyadarshi Kunal
Genius may have its limitations, but stupidity is not thus handicapped.
Assuming that your data is comprised of whole numbers, you can change it to an Integer datatype before the output file (expanding on Priyad's suggestion). Alternatively, you have the option of specifying a format string (C_format or Out_format options) in the column's metadata in the output sequential file stage.
There was a similar thread to this from just a week or two ago...a little bit of searching might have turned it up.
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
The sign is usually incorporated in the first (rarely) or last (standard) digit. The EBCDIC character displays instead of the numeric. Ex. unsigned 0 = 0 (x'F0'), positive 0 = } (x'C0'), negative 0 = { (x'D0'). C and D are also the final half-byte in signed packed decimals.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson