What's the easiest way in COBOL to get 3 characters from the right end of a field. For example I have a field that is 255 bytes long. It has a file name in it and may only take up part of the field and the rest will be padded with spaces. So what I want is to check the extension of the file name. So say it's C:\test\test.txt and then padded with spaces so that it's 255 long. I want the 'txt' part of the file name. What's the easiest way or maybe least amount of coding to do this.