—•Today is •—

PROPCASE is the latest function available in SAS® v9.1 to modify character strings. For instance, traditionally, programmers use LOWCASE, UPCASE, and SUBSTR functions to capitalize the first letter of a word or words.


	data workdata;
	  set carlo.questlab;
	    First=lowcase(fname);
	    Last=lowcase(lname);
	    substr(First,1,1)=upcase(substr(First,1,1));
	    substr(Last,1,1)=upcase(substr(Last,1,1));
	run;

	proc print data=workdata;
	run;

	Obs    FName      LName          First      Last

	1      PATRICIA   BOSCIA         Patricia   Boscia
	2      MEDHAT     CREDI          Medhat     Credi
	3      SONIA      ACHI-CREDI     Sonia      Achi-credi
	4      TECKIE     GHEBREMEDHIN   Teckie     Ghebremedhin
	5      RUSSELL    SOHLBERG       Russell    Sohlberg
				

Using PROPCASE function in SAS® v9.1, things are much easier.


	data workdata;
	  set carlo.questlab;
	    First=propcase(fname);
	    Last=propcase(lname);
	run;
				

Print Document

Copyright © 2002-2004 www.nycinformatics®.com All Rights Reserved
Last edited on: May 28, 2006
SAS product or service names are registered trademarks of SAS Institute, Inc. in the USA and other countries.
® indicates USA registration.