Handling Case with an Informat
The UPCASE function is often used to compare variables against a value in a consistent case or convert existing data to upper case. It is often easier and more efficient to convert text to upper case as the data is read in, provided the original case does not need to be retained. The $UPCASEw. informat can be used to achieve this.
The following example reads data in using list input and the colon format modifier to supply the appropriate informat.
data demog; format id z3.; length name $20 gender $1; input id name & gender:$upcase1.; datalines; 001 James Cook m 002 Felicity Kendall F 003 David Beckham M 004 Jo Brand f run; proc print data=demog noobs; run;
with the following output generated:
id name gender 001 James Cook M
002 Felicity Kendall F
003 David Beckham M
004 Jo Brand F
Unfortunately there are not as yet (SAS V9.2 Phase 1) any informats corresponding to the LOWCASE and PROPCASE functions.