Those don't look like variable names, they look like labels.
Here's an example of how you can do that, with a fully worked example code that you can run. This is a dynamic approach, but if the macro variables were to become larger than 65K characters it wouldn't work. So as long as your variable lists is relatively short you should be fine.
https://gist.github.com/statgeek/f18931085f6a0009185c
@amaple wrote:
Hi there. I am on SAS 9.4. I have two csv files, one containing data and another containing two columns, one for the variables of the first file and the second for what I am supposed to rename them to, something like this:
file 1 - base age yr
some data..
some data..
some data..
file 2 -
var_dict var2
base Baseline
age Age at first diagnosis
yr Duration in years
How am I supposed to get around to renaming file1's variables to file2's? I was thinking PROC TRANSPOSE and an if loop but I can't quite seem to get my head around the logic of it? Any help is appreciated. My code so far is just importing both csv files I'm stuck from there.
... View more