How to change up case my character data in sas?

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

How to change up case my character data in sas?

Hi all,

So I have some participant ID that looks like this:

VVE017001

VVE018033

However, some of my data collectors typed in their participant ID that looks like this:

vve017002

vve018023

When I tried to combined all the data, SAS didn't recognized vve as the same as VVE, I was wondering if I could upcase the "vve" part or is there anyway to tell SAS that vve is actually the same with VVE. Is there any function for that?

Thank you in advanced.


Accepted Solutions
Solution
‎02-15-2014 12:36 PM
Frequent Contributor
Posts: 83

Re: How to change up case my character data in sas?

before you combine them put this statement in

data want;

     set have;

participantid = upcase(participantid);

run;

this will put all of the characters in your participant IDs as upcase, so both are the same format. Mind participantid should be replaced by whatever your unique id variable is in your dataset.

View solution in original post


All Replies
Super Contributor
Super Contributor
Posts: 440

Re: How to change up case my character data in sas?

why dont you use id=upcase(id) ?

Solution
‎02-15-2014 12:36 PM
Frequent Contributor
Posts: 83

Re: How to change up case my character data in sas?

before you combine them put this statement in

data want;

     set have;

participantid = upcase(participantid);

run;

this will put all of the characters in your participant IDs as upcase, so both are the same format. Mind participantid should be replaced by whatever your unique id variable is in your dataset.

New Contributor
Posts: 4

Re: How to change up case my character data in sas?

Thank you very much! It works.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 315 views
  • 3 likes
  • 3 in conversation