<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How Can I define operations with SAS Output? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-Can-I-define-operations-with-SAS-Output/m-p/509635#M137026</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/243927"&gt;@JorgeHidalgo&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you like to perform calculations with selected values (such as sums of squares) that you see in procedure output without the need to copy and paste from the output window to the program editor?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, you can use ODS output datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt; You see PROC GLM output, but you don't know the names of the&amp;nbsp;&lt;SPAN&gt;ODS output datasets.&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Option 1: Look up the name(s) in the procedure documentation, typically under Details --&amp;gt; ODS Table Names. Here is the link for PROC GLM:&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=14.3&amp;amp;docsetTarget=statug_glm_details70.htm&amp;amp;locale=en" target="_blank"&gt;ODS Table Names&lt;/A&gt;.&lt;/LI&gt;
&lt;LI&gt;Option 2: Let SAS display the names (in the log window) in a preliminary test run of the PROC step (possibly with only a few observations of the input dataset in order to avoid long processing times) using &lt;FONT face="courier new,courier"&gt;ODS trace on;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods trace on;
proc glm data=one;
class block a b c;
model y=block a b a*b c a*c b*c/ss3;
quit;
ods trace off;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's assume that ModelANOVA is the table you're interested in. Then you'd request this ODS output dataset with an &lt;A href="https://documentation.sas.com/?docsetId=odsug&amp;amp;docsetTarget=p0oxrbinw6fjuwn1x23qam6dntyd.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;ODS OUTPUT&lt;/A&gt; statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output ModelANOVA=ssb; /* ssb=arbitrary dataset name */
proc glm data=one;
class block a b c;
model y=block a b a*b c a*c b*c/ss3;
quit;

proc print data=ssb width=min;
run;

ods output ModelANOVA=ss;
proc glm data=two;
class rep a b c;
model y=rep a|b|c/ss3;
quit;

proc print data=ss width=min;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(In some cases PROC CONTENTS, e.g.&amp;nbsp;&lt;FONT face="courier new,courier"&gt;proc contents data=ss; run;&lt;/FONT&gt; can be useful to clarify variable types.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now that you've created the ODS output datasets (here: SSB and SS) you can work with them as with any other datasets, e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set ssb(where=(source='block') keep=source ss rename=(ss=ss_block));
set ss(where=(source='rep') keep=source ss rename=(ss=ss_rep));
set ss(where=(source='a*b*c') keep=source ss rename=(ss=ss_abc));
/* &amp;lt; perform calculations involving ss_block, ss_rep and ss_abc here &amp;gt; */
drop source;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please adapt the above example to your needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Nov 2018 18:01:04 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2018-11-01T18:01:04Z</dc:date>
    <item>
      <title>How Can I define operations with SAS Output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Can-I-define-operations-with-SAS-Output/m-p/509543#M136989</link>
      <description>&lt;P&gt;Thank you so much for the time, I am running a proc glm analysis and I want to do an operation with a specific output, i.e. I want to summing the SS of rep factor and ABC interaction in a confounding design, How Can I do that? Heres is my code?&lt;/P&gt;&lt;P&gt;I would like to know the way to define this specific terms before running the model, my option now is running the program and put the actual value, however I have to wait for running the program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*Jorge Angel Hidalgo-Confounding Poultry Manure Example*/&lt;BR /&gt;dm 'output;clear;log;clear';&lt;BR /&gt;options ls=72 formdlim='';&lt;/P&gt;&lt;P&gt;ods graphics off;&lt;BR /&gt;ods html close;&lt;BR /&gt;ods listing;&lt;/P&gt;&lt;P&gt;title 'Confounding-Poultry Manure Example-Jorge Angel Hidalgo';&lt;BR /&gt;data one;&lt;BR /&gt;do block=1 to 6;&lt;BR /&gt;do s=1 to 4;&lt;BR /&gt;input a b c y@@;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;datalines;&lt;BR /&gt;0 1 1 48.81 1 1 0 58.88 1 0 1 46.11 0 0 0 38.62&lt;BR /&gt;1 0 0 40.49 1 1 1 61.55 0 0 1 32.75 0 1 0 55.07&lt;BR /&gt;1 1 0 50.43 0 0 0 40.26 1 0 1 52.31 0 1 1 49.62&lt;BR /&gt;0 0 1 32.36 1 1 1 48.49 1 0 0 51.94 0 1 0 53.86&lt;BR /&gt;1 0 1 39.30 1 1 0 49.93 0 0 0 39.23 0 1 1 51.43&lt;BR /&gt;0 1 0 47.37 0 0 1 37.25 1 1 1 46.87 1 0 0 46.94&lt;BR /&gt;;&lt;BR /&gt;proc print data=one;&lt;BR /&gt;run;&lt;BR /&gt;proc glm data=one;&lt;BR /&gt;class block a b c;&lt;BR /&gt;model y=block a b a*b c a*c b*c/ss3;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data two;&lt;BR /&gt;do rep=1 to 3;&lt;BR /&gt;do block=2*rep-1 to 2*rep;&lt;BR /&gt;do s=1 to 4;&lt;BR /&gt;input a b c y@@;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;datalines;&lt;BR /&gt;0 1 1 48.81 1 1 0 58.88 1 0 1 46.11 0 0 0 38.62&lt;BR /&gt;1 0 0 40.49 1 1 1 61.55 0 0 1 32.75 0 1 0 55.07&lt;BR /&gt;1 1 0 50.43 0 0 0 40.26 1 0 1 52.31 0 1 1 49.62&lt;BR /&gt;0 0 1 32.36 1 1 1 48.49 1 0 0 51.94 0 1 0 53.86&lt;BR /&gt;1 0 1 39.30 1 1 0 49.93 0 0 0 39.23 0 1 1 51.43&lt;BR /&gt;0 1 0 47.37 0 0 1 37.25 1 1 1 46.87 1 0 0 46.94&lt;BR /&gt;;&lt;BR /&gt;proc glm data=two;&lt;BR /&gt;class rep a b c;&lt;BR /&gt;model y=rep a|b|c/ss3;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;title3 "Calculating (Rep*ABC) SS";&lt;BR /&gt;data three;&lt;BR /&gt;abcSS=??&lt;BR /&gt;repSS=??&lt;BR /&gt;bksSS=??&lt;BR /&gt;Rep*ABC=bksSS-repSS-abcSS;&lt;BR /&gt;proc print data=three;&lt;BR /&gt;run;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 14:43:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Can-I-define-operations-with-SAS-Output/m-p/509543#M136989</guid>
      <dc:creator>JorgeHidalgo</dc:creator>
      <dc:date>2018-11-01T14:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I define operations with SAS Output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Can-I-define-operations-with-SAS-Output/m-p/509635#M137026</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/243927"&gt;@JorgeHidalgo&lt;/a&gt;&amp;nbsp;and welcome to the SAS Support Communities!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Would you like to perform calculations with selected values (such as sums of squares) that you see in procedure output without the need to copy and paste from the output window to the program editor?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, you can use ODS output datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt; You see PROC GLM output, but you don't know the names of the&amp;nbsp;&lt;SPAN&gt;ODS output datasets.&lt;/SPAN&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;Option 1: Look up the name(s) in the procedure documentation, typically under Details --&amp;gt; ODS Table Names. Here is the link for PROC GLM:&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=14.3&amp;amp;docsetTarget=statug_glm_details70.htm&amp;amp;locale=en" target="_blank"&gt;ODS Table Names&lt;/A&gt;.&lt;/LI&gt;
&lt;LI&gt;Option 2: Let SAS display the names (in the log window) in a preliminary test run of the PROC step (possibly with only a few observations of the input dataset in order to avoid long processing times) using &lt;FONT face="courier new,courier"&gt;ODS trace on;&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods trace on;
proc glm data=one;
class block a b c;
model y=block a b a*b c a*c b*c/ss3;
quit;
ods trace off;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's assume that ModelANOVA is the table you're interested in. Then you'd request this ODS output dataset with an &lt;A href="https://documentation.sas.com/?docsetId=odsug&amp;amp;docsetTarget=p0oxrbinw6fjuwn1x23qam6dntyd.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;ODS OUTPUT&lt;/A&gt; statement:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output ModelANOVA=ssb; /* ssb=arbitrary dataset name */
proc glm data=one;
class block a b c;
model y=block a b a*b c a*c b*c/ss3;
quit;

proc print data=ssb width=min;
run;

ods output ModelANOVA=ss;
proc glm data=two;
class rep a b c;
model y=rep a|b|c/ss3;
quit;

proc print data=ss width=min;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(In some cases PROC CONTENTS, e.g.&amp;nbsp;&lt;FONT face="courier new,courier"&gt;proc contents data=ss; run;&lt;/FONT&gt; can be useful to clarify variable types.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now that you've created the ODS output datasets (here: SSB and SS) you can work with them as with any other datasets, e.g.:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
set ssb(where=(source='block') keep=source ss rename=(ss=ss_block));
set ss(where=(source='rep') keep=source ss rename=(ss=ss_rep));
set ss(where=(source='a*b*c') keep=source ss rename=(ss=ss_abc));
/* &amp;lt; perform calculations involving ss_block, ss_rep and ss_abc here &amp;gt; */
drop source;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please adapt the above example to your needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 18:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Can-I-define-operations-with-SAS-Output/m-p/509635#M137026</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2018-11-01T18:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: How Can I define operations with SAS Output?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-Can-I-define-operations-with-SAS-Output/m-p/509872#M137124</link>
      <description>&lt;P&gt;That is working perfectly, I really appreciate your time, this was exactly that I needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Jorge&lt;/P&gt;&lt;P&gt;Best Wishes&lt;/P&gt;</description>
      <pubDate>Fri, 02 Nov 2018 14:01:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-Can-I-define-operations-with-SAS-Output/m-p/509872#M137124</guid>
      <dc:creator>JorgeHidalgo</dc:creator>
      <dc:date>2018-11-02T14:01:56Z</dc:date>
    </item>
  </channel>
</rss>

