How do I label in a practical way a bunch of vars that have the same prefix and need the same label.
Structure of database:
id col1 col2 col3 col4 col5...…...col72
I want all col vars to be called "Supercalifragilisticexpialidocious";
Is there a very to do this very easily?
A macro could do this. But, what is the value of having 72 variables having the same label? Why put in the effort, what do you gain?
any other way?
I am not too good with macros.
@K_S wrote:
any other way?
I am not too good with macros.
Maybe there's a method using PROC TRANSPOSE, but I will leave that to others. The only other way I know of is to type in the labels for all 72 variables.
Hello @K_S,
Use the ATTRIB statement in PROC DATASETS:
proc datasets lib=your_libref nolist; modify your_dataset; attrib col: label='your label'; quit;
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.