<?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: Ods Output in SAS Macro LR model - please help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Ods-Output-in-SAS-Macro-LR-model-please-help/m-p/58141#M12610</link>
    <description>Hi:&lt;BR /&gt;
  Without seeing what's in your WORK.RESULTS, I have no idea why your WHERE statement does not work. If you posted your SAS LOG and the PROC PRINT of WORK.RESULTS, it might be possible to figure out more.&lt;BR /&gt;
 &lt;BR /&gt;
  (If you are going to post the SAS log or SAS output, then do read this forum posting &lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=27609毙" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=27609毙&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
and, use the [pre] and  [/pre]  tags around your code and output in order to maintain indenting and spacing.)&lt;BR /&gt;
 &lt;BR /&gt;
 Usually ODS OUTPUT gives you messages  like your #2 question because you have a duplicate name in a situation where the name is expected to be unique. I could not duplicate that message, even when I put my PROC LOGISTIC inside a macro %DO loop.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
    <pubDate>Fri, 30 Jul 2010 19:00:44 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2010-07-30T19:00:44Z</dc:date>
    <item>
      <title>Ods Output in SAS Macro LR model - please help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ods-Output-in-SAS-Macro-LR-model-please-help/m-p/58138#M12607</link>
      <description>I have a trouble with Ods Output now, the macro for LR works.&lt;BR /&gt;
&lt;BR /&gt;
I used the similar ods output to collect pvalues in the PHREG statement and it was totally fine, but now I am given the error message that the variable 'Parameter' has never been referenced. Also I am getting this WARNING: Duplicate data set name on ODS OUTPUT statement. Entry will be ignored.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
here is my program: &lt;BR /&gt;
&lt;BR /&gt;
%MACRO logistic;&lt;BR /&gt;
%local I;&lt;BR /&gt;
&lt;BR /&gt;
%DO I=1 %TO x;&lt;BR /&gt;
&lt;BR /&gt;
ods output  ParameterEstimates=Results; &lt;BR /&gt;
&lt;BR /&gt;
DATA a; SET b; df=d*f; RUN;&lt;BR /&gt;
&lt;BR /&gt;
proc logistic descending data=a;&lt;BR /&gt;
&lt;BR /&gt;
MODEL y=d f df e.. ;&lt;BR /&gt;
RUN;&lt;BR /&gt;
&lt;BR /&gt;
ods OUTPUT close;&lt;BR /&gt;
&lt;BR /&gt;
 DATA Estimate; SET Results; WHERE Parameter="df"; KEEP Parameter&lt;BR /&gt;
 ProbChiSq ; RUN; &lt;BR /&gt;
&lt;BR /&gt;
DATA PVALUE; SET PVALUE Estimate; RUN; &lt;BR /&gt;
%END;&lt;BR /&gt;
%MEND logistic;&lt;BR /&gt;
%logistic;</description>
      <pubDate>Fri, 30 Jul 2010 16:06:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ods-Output-in-SAS-Macro-LR-model-please-help/m-p/58138#M12607</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-30T16:06:13Z</dc:date>
    </item>
    <item>
      <title>Re: Ods Output in SAS Macro LR model - please help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ods-Output-in-SAS-Macro-LR-model-please-help/m-p/58139#M12608</link>
      <description>Hi:&lt;BR /&gt;
  Let's remove SAS macro from the picture. When I run this code: &lt;BR /&gt;
[pre]&lt;BR /&gt;
      &lt;BR /&gt;
ods output ParameterEstimates=Results; &lt;BR /&gt;
            &lt;BR /&gt;
proc logistic descending data=sashelp.class;&lt;BR /&gt;
MODEL age=height weight;&lt;BR /&gt;
RUN;&lt;BR /&gt;
       &lt;BR /&gt;
ods listing;&lt;BR /&gt;
           &lt;BR /&gt;
proc contents data=work.results;&lt;BR /&gt;
run;&lt;BR /&gt;
            &lt;BR /&gt;
proc print data=work.results;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
I do NOT see a column called "Parameter" in WORK.RESULTS. This is what I see in WORK.RESULTS:&lt;BR /&gt;
[pre]&lt;BR /&gt;
              Class                                   Prob&lt;BR /&gt;
Obs Variable  Val0  DF Estimate   StdErr  WaldChiSq  ChiSq&lt;BR /&gt;
                 &lt;BR /&gt;
 1  Intercept  16    1 -33.6021  11.1725     9.0455 0.0026&lt;BR /&gt;
 2  Intercept  15    1 -30.0342  10.7184     7.8519 0.0051&lt;BR /&gt;
 3  Intercept  14    1 -28.1425  10.4843     7.2052 0.0073&lt;BR /&gt;
 4  Intercept  13    1 -26.7933  10.2666     6.8108 0.0091&lt;BR /&gt;
 5  Intercept  12    1 -23.8218   9.8517     5.8470 0.0156&lt;BR /&gt;
 6  Height           1   0.3577   0.2039     3.0777 0.0794&lt;BR /&gt;
 7  Weight           1   0.0576   0.0447     1.6597 0.1976&lt;BR /&gt;
          &lt;BR /&gt;
[/pre]&lt;BR /&gt;
                     &lt;BR /&gt;
Every procedure can potentially write different column names to the ODS OUTPUT dataset. You need to check the column names before you use the output dataset in subsequent steps.&lt;BR /&gt;
   &lt;BR /&gt;
Possibly you need to change your WHERE condition to test for the value of VARIABLE. Perhaps something like this (which works with the above program):&lt;BR /&gt;
[pre]&lt;BR /&gt;
DATA Estimate; &lt;BR /&gt;
   SET Results; &lt;BR /&gt;
   WHERE Variable="Height"; &lt;BR /&gt;
   KEEP Variable Estimate ProbChiSq ;&lt;BR /&gt;
RUN; &lt;BR /&gt;
                           &lt;BR /&gt;
proc print data=estimate;&lt;BR /&gt;
  title 'WHERE Variable = Height';&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                    &lt;BR /&gt;
  One of the best practices when using SAS macros is to ensure that you have a working program BEFORE you "macro-ize" the program. Although ODS TRACE ON/TRACE OFF will show you the correct output object names for the ODS OUTPUT statement, you will need to verify the columns names in the output dataset using either PROC CONTENTS or PROC PRINT before you use the dataset in subsequent steps. The issue was not with SAS Macro, but was with not understanding what column names were created in the output dataset.&lt;BR /&gt;
   &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 30 Jul 2010 16:26:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ods-Output-in-SAS-Macro-LR-model-please-help/m-p/58139#M12608</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-07-30T16:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Ods Output in SAS Macro LR model - please help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ods-Output-in-SAS-Macro-LR-model-please-help/m-p/58140#M12609</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
thank you for an attempt to resolve this, I did check the simple program before.&lt;BR /&gt;
It does have the 'Parameter' variables listed in the output with their B-coefficients estimated, as well as ChiSq probabilities, OR, CI etc..&lt;BR /&gt;
so i am not sure why it does not take 1) Parameter as a variable;&lt;BR /&gt;
2) why it says that the 'Ods Output' has a duplicate data set name</description>
      <pubDate>Fri, 30 Jul 2010 16:59:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ods-Output-in-SAS-Macro-LR-model-please-help/m-p/58140#M12609</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-07-30T16:59:02Z</dc:date>
    </item>
    <item>
      <title>Re: Ods Output in SAS Macro LR model - please help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Ods-Output-in-SAS-Macro-LR-model-please-help/m-p/58141#M12610</link>
      <description>Hi:&lt;BR /&gt;
  Without seeing what's in your WORK.RESULTS, I have no idea why your WHERE statement does not work. If you posted your SAS LOG and the PROC PRINT of WORK.RESULTS, it might be possible to figure out more.&lt;BR /&gt;
 &lt;BR /&gt;
  (If you are going to post the SAS log or SAS output, then do read this forum posting &lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=27609毙" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=27609毙&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
and, use the [pre] and  [/pre]  tags around your code and output in order to maintain indenting and spacing.)&lt;BR /&gt;
 &lt;BR /&gt;
 Usually ODS OUTPUT gives you messages  like your #2 question because you have a duplicate name in a situation where the name is expected to be unique. I could not duplicate that message, even when I put my PROC LOGISTIC inside a macro %DO loop.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 30 Jul 2010 19:00:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Ods-Output-in-SAS-Macro-LR-model-please-help/m-p/58141#M12610</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-07-30T19:00:44Z</dc:date>
    </item>
  </channel>
</rss>

