The PUT functions PUT(), PUTN(), and PUTC(), are the SAS conventional methods for recasting or recoding values. PUTN() and PUTC() (for character values) allow the format to be provided dynamically, as you require in this case. @RW9's amendment , or the use of the LEFT() function, is required if you use the modified version I supplied. Richard
... View more