| www.sas.com > SAS UK > In the Know Homepage | Search | Contact Us |
|
|
|
|
By using Macros and the SAS datastep functions UPCASE, LOWCASE and SUBSTR you can convert your text strings to proper case making your text more readable. This mimics a function which is available in Oracle - INITCAP - to capitalize the first letter of a word and lowercase all the other letters in a word. In my job this is useful, particularly for names and addresses when creating mailing files and sending data outside of our company. It is designed to run within a dataset and I have included an example dataset and usage example:
In addition to the customer's suggestion, please find below alternative SAS datastep examples when using Base SAS 8.2. If you have the module SAS Data Quality Cleanse licensed in SAS 8.2, you will have access to the function PROPERCASES that automatically does this for you. Beginning with Base SAS 9 there is a new function PROPCASE which will convert all words in an argument to proper case. http://ftp.sas.com/techsup/download/sample/datastep/char.html http://www2.sas.com/proceedings/sugi25/25/cc/25p079.pdf
|