Convert to column to Upper case in SAS is accomplished using UPCASE() function, Converting a column to Lower case in SAS is done using LOWCASE() function, and title case in SAS uses PROPCASE() function. Let’s see an example of each.
- Convert column to upper case in SAS – UPCASE() function
- Convert column to lower case in SAS – LOWCASE() function
- Convert column to title case in SAS – PROPCASE() function
So we will be using EMP_DET Table in our example
Convert to Upper Case in SAS – UPCASE() Function
Syntax:
colname1 – Column name
UPCASE() Function in SAS takes up the column name as argument and converts the column to upper case
/* Convert to upper case */ data EMP_DET1; set EMP_DET; STATE_CASE = UPCASE(state_name); run;
So the resultant table with upper case converted column will be,
Convert to Lower Case in SAS – LOWCASE() Function
Syntax:
colname1 – Column name
LOWCASE() Function in SAS takes up the column name as argument and converts the column to Lower case
/* Convert to lower case */ data EMP_DET1; set EMP_DET; STATE_CASE = LOWCASE(state_name); run;
So the resultant table with lower case converted column will be,
Convert to Title case or Proper case in SAS – PROPCASE Function
Syntax:
colname1 – Column name
PROPCASE() Function in SAS takes up the column name as argument and converts the column to proper case i.e. only First character of the word will be in upper case all others will be in lower case
/* Convert to proper case/ title case */ data EMP_DET1; set EMP_DET; STATE_CASE = PROPCASE(state_name); run;
So the resultant table with proper case converted column will be,