BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi all. I'm trying to find a way to speed up SAS analysis by minimizing the amount of manual labour.

Let's say you have a very simple code like below:


proc mixed data = mydata;
class stand_type;
model total_mg = stand_type;
run;


I'm trying to find a way to automatically substitute "total_mg" in the model statement with other variables (e.g., total_c, total_n, total_k etc.) found in the same dataset so that I only have to execute the program once, and all the variables in MYDATA is analysed by the proc mixed model provided.

Thanks in advance for your help!
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
Anytime you talk about "automating" SAS code, you get, eventually, to advice about using the SAS Macro Facility. For a good overview of the SAS macro facility, this is an excellent place to start:
http://www2.sas.com/proceedings/sugi28/056-28.pdf

When you talk about generating a LIST of variable names, to be used in the automation process, you will get, eventually, to advice about using the SAS Dictionary Tables or the SASHELP.Vxxxxx tables.
http://www2.sas.com/proceedings/sugi26/p017-26.pdf
http://www2.sas.com/proceedings/sugi31/259-31.pdf
http://www2.sas.com/proceedings/sugi29/237-29.pdf (specifically Example 5)

This reading should get you pointed in the right direction. There have also been a lot of previous forum postings on the use of the DICTIONARY tables and on macro processing like this.

cynthia
deleted_user
Not applicable
Great! Thanks for all your hard work!!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 900 views
  • 0 likes
  • 2 in conversation