Reputation: 9
I don't think if it is possible, but I lose some time in googling but with no results!
I need something like this example:
DATA:
(...)195231021(...)
CTL:
TEST POSITION(37:40) '1'
Result:
0211 (last 3 numbers and append a constant number '1')
Help me please.
Upvotes: 1
Views: 889
Reputation: 191570
You can apply an SQL operator to a field, so this works:
test position(37:39) "concat(:test, '1')"
You said you only wanted three characters so I changed the range from 37:40 to 37:39, but not sure if you actually want 38:40. (Of course, using the ||
concatenation operator works too, as EatÅPeach's answer shows).
Upvotes: 2