There is no RIGHT function in SQL only a LEFT. Your best bet is to use a SUBSTR function if the field is an exact length to extract the last 6 positions
Example – Select SUBSTR(gmans,strpos,6)from f0901
where strpos is a numeric starting position.
Note that RIGHT() is a scalar function available in DB2 on iSeries as of V5R3.
If you are at a OS Version that does NOT support RIGHT() then you can emulate it with the following:
<pre> select substr(trim(gmans), max(length(trim(gmans)) – 5, 1), 6) from f0901 </pre>