DATA Step, Macro, Functions and more

How to use BY statement along with OUTPUT in PROC GLM to save several output data sets ?

Accepted Solution Solved
Reply
Contributor
Posts: 74
Accepted Solution

How to use BY statement along with OUTPUT in PROC GLM to save several output data sets ?

Dear SAS users,

 

I want to run PROC GLM several times on the same data set using BY statement. This works fine.

But how to save different output data sets of residuals (with OUTPUT) each time ?

 

 

Thank you.


Accepted Solutions
Solution
‎09-29-2017 02:23 PM
Respected Advisor
Posts: 3,288

Re: How to use BY statement along with OUTPUT in PROC GLM to save several output data sets ?

If you use a BY statement, the residuals still get written into the OUTPUT data set. Does your question mean that you want each BY group's residuals in a different data set? Generally, I would advise against doing this, as I don't see the benefit, but you can certainly take the output data set and in a following data step, split it up by the value of the BY variable (but again, I don't see any benefit to doing this).

--
Paige Miller

View solution in original post


All Replies
Solution
‎09-29-2017 02:23 PM
Respected Advisor
Posts: 3,288

Re: How to use BY statement along with OUTPUT in PROC GLM to save several output data sets ?

If you use a BY statement, the residuals still get written into the OUTPUT data set. Does your question mean that you want each BY group's residuals in a different data set? Generally, I would advise against doing this, as I don't see the benefit, but you can certainly take the output data set and in a following data step, split it up by the value of the BY variable (but again, I don't see any benefit to doing this).

--
Paige Miller
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 122 views
  • 1 like
  • 2 in conversation