October 18, 2006 Hey, Ted
I have to build a file for input to another system. All fields are fixed-length, and numeric values are to be edited and right-adjusted. SQL’s CHAR function takes care of the editing requirement, but the result is left-adjusted. How do I right-adjust an edited numeric value? Or will I have to rewrite my program using native I/O operations?
On the surface, this seemed like an easy request. It turned to be a little more complicated than I had thought.
I suggested Sarah use the SPACE function to generate enough leading blanks to force right alignment. For example, the following