If this is for an Xlate, I have a reusable proc intended for this purpose. Arguments provide the offset desired among other things (like resultant format). If you would like a copy of that proc, email me.
email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.