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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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