So I want to run PROC MIXED in a macro loop. I know don't say it.:smileyshocked:
I code ODS OUTPUT with presist=proc and I get my tables stacked together that's all good and there are two variables _PROC_ and _RUN_ that seem to suggest that they are to help me know which run of the proc each row is associated with but they all have the same value. Is there a way I can control the value of these variables thought the PROC or other ODS statement?
What would be nice (and would address your original thought) is a way to capture the current value of a macro variable in an ODS table. It's all about getting something useful in the _RUN_ variable. Man, if I had that, it would clean up so much work around code...
Steve Denham
Hi Data_null
I think that _Proc_ will give you always the name of the used procedure.
If you persist with models through glm and reg then you get GLM and Reg values in that variable.
for _Run_ , i obtained increasing values (1 2 3) when i have tried different successive models in one same proc (catmod by example)
You are certainly submitting repeating mixed procedures.
HTH
Andre
The only control that i can see is after: reworking the generated values
This is what I'm going to do.
This is close to what we do, but your approach using the persist= option is something we may want to look into.
Basically here is our approach:
Probably not the most elegant method, but it gives what I think you are going after.
Steve Denham
Sounds like you're doing pretty much the same thing as me. I'm running a repeated measures model with a list of covariates that are include in the model one at a time. I don't create the empty data sets as you do, I'm not sure I need them. Here's my code such as it is and out of context but you get the idea.
I think the logic is identical. The empty dataset is just to avoid an error in the log when we start accumulating over several dependent variables for later reporting. I think we could adapt part of this, esp. the match_all= option, and the idea of using a view rather than a whole new dataset to insert the indexing variable will definitely help.
There needs to be a way to give credit for an answer that comes up in the course of the discussion. If I had been asking something, it would definitely be marked "Correct".
Steve Denham
With MATCH_ALL SAS helps keeps track of the data sets that are created which is very helpful. You do get this NOTE telling you that you no longer need to use MATCH_ALL but it doesn't mention that the new way may not include enough information to solve the newly created stacked data puzzle.
I think the question is still un-answered. We just discussed our work-around. I think since they are almost identical they must be the "correct" work-around.
It would be nice to get some input from someone at SI.
What would be nice (and would address your original thought) is a way to capture the current value of a macro variable in an ODS table. It's all about getting something useful in the _RUN_ variable. Man, if I had that, it would clean up so much work around code...
Steve Denham
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.