Once you have the value out if the xlateInVals list into a variable, you can do a number of things to determine if the parens exist.
one way is a regexp (I will let you ty that if you want).
another way is to simple use an if with ‘string range’ to check the first character to see if it is “(” (the assumption here is that if the field begins with the left paren it probably ends with the right paren). If the assumption is more than what you want to make, then you can also check the last charactre for a right paren.
In any case, you will most likely also need to remove the parens – the ‘string map’ command can accomplish that for you – or you can use regsub.
email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 61 years IT – old fart.
Since this is a delimited file perhaps the source system has an option as to how to express negative numbers (many do) and could change their output to have a preceeding sign. Of course then you might have to deal with a leading +.
The use of parens to indicate a negative number is valid but not always useful.
email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 61 years IT – old fart.