BookmarkSubscribeRSS Feed
CathyVI
Lapis Lazuli | Level 10

Hi,

I want to make the following character observation in the character data UPCASE;

Q1_d1Frequency
INcome1
soc hx1
Smoking Status1
INCOME1
SMOKING STATUS1

 

 

2 REPLIES 2
ballardw
Super User

Use the upcase function in a data step.

 

data want;
   set have;
   q1_d1 = upcase(q1_d1);
run;
PGStats
Opal | Level 21

If you just want to change the way the variable is displayed, give it the $UPCASE. format. This can be done in the dataset where it resides or in any proc that refers to that dataset.

 

proc print data=myDataset;

format Qi_d1 $UPCASE.;

run;

PG

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 638 views
  • 1 like
  • 3 in conversation