SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Search||next

Transforming Data with SAS Functions
Modifying Character Values with Functions


UPCASE Function

The UPCASE function converts all letters in a character expression to uppercase.


General form, UPCASE function:
UPCASE(argument)

where argument can be any SAS expression, such as a character value or constant.


Now let's use the UPCASE function to convert the values of a character variable in Hrd.Temp. The values of the variable Job appear in lowercase letters.


SAS Data Set Hrd.Temp
Job Contact Department Site
word processing WORD PROCESSOR DP 26
filing, administrative duties ADMIN. ASST. PURH 57
organizational dev. specialist CONSULTANT PERS 34
bookkeeping, word processing BOOKKEEPER ASST. BK 57


To convert the values of Job to uppercase, you write the UPCASE function as follows:
     upcase(job)

Then place the function in an assignment statement in a DATA step.

     data hrd.newtemp;
        set hrd.temp;
        Job=upcase(job);
     run;

Here's the new data set that contains the converted values of Job.


SAS Data Set Hrd.Newtemp
Job Contact Department Site
WORD PROCESSING WORD PROCESSOR DP 26
FILING, ADMINISTRATIVE DUTIES ADMIN. ASST. PURH 57
ORGANIZATIONAL DEV. SPECIALIST CONSULTANT PERS 34
BOOKKEEPING, WORD PROCESSING BOOKKEEPER ASST. BK 57



|next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement