Hi everyone,
I have been struggling with this for a couple days, so hope somebody out there has done this before.
I have a dataset that is currently vertical, and I want to transpose it to be horizontal. That's no problem with PROC TRANSPOSE. The tricky part is that after the data is transposed, I need to assign labels to the new variables from a field that existed in the initial data.
Currently I have something like this:
variable_name field_label
INV Physician
INST Institution
I have transposed the dataset to this:
INV INST
Dr Joe Hospital1
Dr Jane Hospital2
What I am not sure how to do is assign the values from field_label to the INV and INST variables after the transpose. I have 397 rows in the intial dataset, and it can change in the future, so I really want to be able to do this dynamically.
Any suggestions?
Thanks!
IDLABEL option in PROC TRANSPOSE.
proc transpose data=.....;
...
idlabel field_label;
...
run;
@biglerc wrote:
Hi everyone,
I have been struggling with this for a couple days, so hope somebody out there has done this before.
I have a dataset that is currently vertical, and I want to transpose it to be horizontal. That's no problem with PROC TRANSPOSE. The tricky part is that after the data is transposed, I need to assign labels to the new variables from a field that existed in the initial data.
Currently I have something like this:
variable_name field_label
INV Physician
INST Institution
I have transposed the dataset to this:
INV INST
Dr Joe Hospital1
Dr Jane Hospital2
What I am not sure how to do is assign the values from field_label to the INV and INST variables after the transpose. I have 397 rows in the intial dataset, and it can change in the future, so I really want to be able to do this dynamically.
Any suggestions?
Thanks!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.