on 11-27-201309:53 AM - last edited on 10-10-201509:54 PM by LainieH
Actually, more like sprintf.
The put statement formats are great. They enable things in reports that printf can't do. Nonetheless, printf is, by far, the most common mechanism across all languages for "quick-and-dirty" formatted output. That output is what I want to do at least 90% of the time.
The SAS version should cover only a subset of the latest C standard formatting. For anything fancier, use a put statement.
A precedent for this is the prx* series of functions for accessing Perl regular expressions. They are very useful and easy to learn given all the material online.
It would work like other functions (e.g. sortc, sortn) that take multiple arguments:
idAndName = printf("%d: %s, %s.", acct, last, first);