Amadeus cookies policy - you'll see this message only once.

Amadeus use cookies on this website. They help us to know a little bit about you and how you use our website, which improves the browsing experience and marketing - both for you and for others. They are stored locally on your computer or mobile device. To accept cookies, continue browsing as normal. Or, go to the privacy policy for more information.

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.