I have an id variable in one study that is numeric
and a study_id variable in another study that is a character.
How do I harmonize these so that study_id=id as well as change them from character to numeric.
ID variables are not used for calculations, so store them as character.
Please supply examples for your character ID data, then we can show you how to convert the numbers to that.
the id= 23434 just a number
the pid= 23423 is also just a number
study_id is BOM234 letters and numbers
I am trying to sort by just study_id
I want id and pid to be be renamed as study_id
So the first three digits of an ID correspond to the last three digits of the study_id?
ID belongs to study 1
pid belongs to study 2
and study_id belongs to study 3
I am trying to combine information from all three studies.
but want one variable called study id to know who all the participants are
Is it important to know if a single person took part in more than one study? If yes, how can you correlate the entries?
If no, just format your purely numeric IDs (if they are actually stored in numeric variables in SAS) with z6. (to get an even length).
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.