DATA Step, Macro, Functions and more

lowcase and upcase functions

Reply
Contributor
Posts: 55

lowcase and upcase functions

What does lowcase and upcase fucntion mainly do ?

 

SAS Super FREQ
Posts: 9,374

Re: lowcase and upcase functions

Hi:
Have you tried them in a program? Or looked them up in the documentation. Here's the alpha list: http://go.documentation.sas.com/?docsetId=allprodslang&docsetTarget=syntaxByType-function.htm&docset...

Cynthia
PROC Star
Posts: 1,852

Re: lowcase and upcase functions

[ Edited ]

Assuming your question is from an intuitive sense rather than a mere purpose/task of what upcase/lowcase functions accomplishes that is converting characters to upcase(all in CAPS) and lowcase(all small letters) which I believe you would have read in the documentation and many examples online.

The intuition I am guessing you are after is when doing conditional processing or applying filter on character variables with values in mixed cases meaning some are small letters and some big and some both.

For example country-- USA,Usa,usa, UsA

Let us suppose you wanna filter the records where country equals usa. Since values are case sensitive, you are prone to get unexpected results. Therefore to make it consistent, application of upcase/lowcase functions becomes handy like

Where upcase(country)=”USA”  ; here the function temporarily converts all values to UPPER case(all CAPS) and then checks for condition to do the filtering.  I hope this gives some intuitive sense beyond what the function does. HTH

Super User
Posts: 13,592

Re: lowcase and upcase functions

While investigating those functions you may also want to investigate PROPCASE.

 

 

Ask a Question
Discussion stats
  • 3 replies
  • 110 views
  • 0 likes
  • 4 in conversation