Hello,
I am merging various datasets.
The datasets generally have the same case in their variables, but I noticed that some of them have variable 'caseid' whereas others have 'CaseID' for example (or 'sex', 'Sex' etc).
I am now using these commands:
The problem with this is that dataset_2 might have some uppercase.
The only different way I can think of is:
Is there a way to include the rename variables for a dataset not in use?
Thank you.
I am merging various datasets.
The datasets generally have the same case in their variables, but I noticed that some of them have variable 'caseid' whereas others have 'CaseID' for example (or 'sex', 'Sex' etc).
I am now using these commands:
Code:
use dataset_1 rename *, lower merge 1:1 caseid using dataset_2
The only different way I can think of is:
Code:
use dataset_1 rename *, lower use dataset_2 rename *, lower merge 1:1 caseid using dataset_1
Thank you.
Comment