<?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: halfnorm macro: proc genmod, ods output in a macro loop in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/halfnorm-macro-proc-genmod-ods-output-in-a-macro-loop/m-p/81949#M17699</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion, but the&lt;/P&gt;&lt;P&gt;OUTPUT statement is not currently an option, at least not without a major re-write.&lt;/P&gt;&lt;P&gt;This may turn out to provide a good solution, but I'd rather see if I can tweak the ODS first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The OUTPUT statement did not exist when the macro was originally written.&amp;nbsp; It provides similar output statistics&lt;/P&gt;&lt;P&gt;to what is available via ODS, but seems to have been constructed by an independent contractor, because the names&lt;/P&gt;&lt;P&gt;of the output variables differ in a bewildering way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.,&lt;/P&gt;&lt;P&gt;OBSTATS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUTPUT&lt;/P&gt;&lt;P&gt;streschi&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdreschi&lt;/P&gt;&lt;P&gt;stresdev&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdresdev&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 01 Oct 2012 19:50:18 GMT</pubDate>
    <dc:creator>michael_friendly</dc:creator>
    <dc:date>2012-10-01T19:50:18Z</dc:date>
    <item>
      <title>halfnorm macro: proc genmod, ods output in a macro loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/halfnorm-macro-proc-genmod-ods-output-in-a-macro-loop/m-p/81947#M17697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am attempting to update my halfnorm macro for V9+, current version at&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.datavis.ca/sasmac/halfnorm.html" title="http://www.datavis.ca/sasmac/halfnorm.html"&gt;Visualizing Categorical Data: halfnorm - Half normal plot for generalized linear models&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having trouble with a section of the macro designed to run proc genmod repeatedly to get a simulated envelope&lt;/P&gt;&lt;P&gt;based on randomly generated values from a given distribution.&amp;nbsp; I would prefer to have no printed output generated,&lt;/P&gt;&lt;P&gt;but commented out the ODS LISTING statements for now. The essence is the following loop:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put HALFNORM: Generating &amp;amp;nres simulated residual sets...;&lt;/P&gt;&lt;P&gt;%if %sysevalf(&amp;amp;sysver&amp;nbsp; &amp;gt;= 7) %then %do;&lt;/P&gt;&lt;P&gt;*&amp;nbsp;&amp;nbsp;&amp;nbsp; ods listing exclude all;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;%do i=1 %to &amp;amp;nres;&lt;/P&gt;&lt;P&gt;options nonotes;&lt;/P&gt;&lt;P&gt;%*put Generating residual set &amp;amp;i;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;ods output ObStats=work._hres&amp;amp;i(keep=&amp;amp;res rename=(&amp;amp;res=res&amp;amp;i));&lt;/P&gt;&lt;P&gt;proc genmod data=_obstat_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %if %length(&amp;amp;class)&amp;gt;0 %then %do; class &amp;amp;class; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %if %length(&amp;amp;freq)&amp;gt;0 %then %do;&amp;nbsp; freq &amp;amp;freq;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if %length(&amp;amp;trials)=0 %then %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; model _y&amp;amp;i&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; = &amp;amp;model /&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %else %do;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; model _y&amp;amp;i/&amp;amp;trials = &amp;amp;model /&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if %length(&amp;amp;dist)&amp;gt;0 %then %do;&amp;nbsp; dist=&amp;amp;dist %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if %length(&amp;amp;link)&amp;gt;0 %then %do;&amp;nbsp; link=&amp;amp;link %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if %length(&amp;amp;offset)&amp;gt;0 %then %do; offset=&amp;amp;offset&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if %length(&amp;amp;mopt)&amp;gt;0 %then %do;&amp;nbsp; %str(&amp;amp;mopt) %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; obstats residuals;&lt;/P&gt;&lt;P&gt;*&amp;nbsp; make 'obstats'&amp;nbsp; out=_hres&amp;amp;i(keep=&amp;amp;res rename=(&amp;amp;res=res&amp;amp;i));&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%end;&amp;nbsp; /* End %do i */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm getting warnings, then errors regarding the ObStats datasets when I try to use them&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HALFNORM: Generating 19 simulated residual sets...&lt;/P&gt;&lt;P&gt;MPRINT(HALFNORM):&amp;nbsp;&amp;nbsp; * ods listing exclude all;&lt;/P&gt;&lt;P&gt;MPRINT(HALFNORM):&amp;nbsp;&amp;nbsp; options nonotes;&lt;/P&gt;&lt;P&gt;MPRINT(HALFNORM):&amp;nbsp;&amp;nbsp; ods output ObStats=work._hres1(keep=stresdev &lt;/P&gt;&lt;P&gt;rename=(stresdev=res1));&lt;/P&gt;&lt;P&gt;MPRINT(HALFNORM):&amp;nbsp;&amp;nbsp; proc genmod data=_obstat_;&lt;/P&gt;&lt;P&gt;MPRINT(HALFNORM):&amp;nbsp;&amp;nbsp; class dept gender admit;&lt;/P&gt;&lt;P&gt;MPRINT(HALFNORM):&amp;nbsp;&amp;nbsp; model _y1 = dept|gender|admit@2 / dist=POISSON obstats &lt;/P&gt;&lt;P&gt; residuals;&lt;/P&gt;&lt;P&gt;MPRINT(HALFNORM):&amp;nbsp;&amp;nbsp; * make 'obstats' out=_hres&amp;amp;i(keep=&amp;amp;res rename=(&amp;amp;res=res&amp;amp;i));&lt;/P&gt;&lt;P&gt;MPRINT(HALFNORM):&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WARNING: Output 'ObStats' was not created.&amp;nbsp; Make sure that the output object &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; name, label, or path is spelled correctly.&amp;nbsp; Also, verify that the &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; appropriate procedure options are used to produce the requested output &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; object.&amp;nbsp; For example, verify that the NOPRINT option is not used.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attach the current version I'm testing, together with a log file from a test run.&amp;nbsp; Can anyone see what is wrong and how to correct it?&lt;/P&gt;&lt;P&gt;Test code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;title 'Berkeley Admissions data';&lt;/P&gt;&lt;P&gt;%include catdata(berkeley);&lt;/P&gt;&lt;P&gt;data berkeley;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; set berkeley;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; cell = trim(put(dept,dept.)) ||&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gender ||&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trim(put(admit,yn.));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;%include macros(halfnorm12);&lt;/P&gt;&lt;P&gt;options mprint;&lt;/P&gt;&lt;P&gt;%halfnorm(data=berkeley, class="dept" gender admit,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; resp=freq, model=dept|gender|admit@2, dist=poisson, id=cell);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 15:11:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/halfnorm-macro-proc-genmod-ods-output-in-a-macro-loop/m-p/81947#M17697</guid>
      <dc:creator>michael_friendly</dc:creator>
      <dc:date>2012-10-01T15:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: halfnorm macro: proc genmod, ods output in a macro loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/halfnorm-macro-proc-genmod-ods-output-in-a-macro-loop/m-p/81948#M17698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a reason that the OUTPUT= option for creating dataset output isnt' acceptable?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The online help suggests these reasons for using this option:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&amp;nbsp; The OUTPUT statement produces no tabular output.&amp;nbsp; &lt;/LI&gt;&lt;LI&gt;&lt;P&gt;The OUTPUT statement creates a SAS data set more efficiently than ODS. This can be an advantage for large data sets. &lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;You can specify the individual statistics to be included in the SAS data set. &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 17:58:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/halfnorm-macro-proc-genmod-ods-output-in-a-macro-loop/m-p/81948#M17698</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2012-10-01T17:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: halfnorm macro: proc genmod, ods output in a macro loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/halfnorm-macro-proc-genmod-ods-output-in-a-macro-loop/m-p/81949#M17699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion, but the&lt;/P&gt;&lt;P&gt;OUTPUT statement is not currently an option, at least not without a major re-write.&lt;/P&gt;&lt;P&gt;This may turn out to provide a good solution, but I'd rather see if I can tweak the ODS first.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The OUTPUT statement did not exist when the macro was originally written.&amp;nbsp; It provides similar output statistics&lt;/P&gt;&lt;P&gt;to what is available via ODS, but seems to have been constructed by an independent contractor, because the names&lt;/P&gt;&lt;P&gt;of the output variables differ in a bewildering way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g.,&lt;/P&gt;&lt;P&gt;OBSTATS&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OUTPUT&lt;/P&gt;&lt;P&gt;streschi&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdreschi&lt;/P&gt;&lt;P&gt;stresdev&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stdresdev&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 19:50:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/halfnorm-macro-proc-genmod-ods-output-in-a-macro-loop/m-p/81949#M17699</guid>
      <dc:creator>michael_friendly</dc:creator>
      <dc:date>2012-10-01T19:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: halfnorm macro: proc genmod, ods output in a macro loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/halfnorm-macro-proc-genmod-ods-output-in-a-macro-loop/m-p/81950#M17700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Michael,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know if the attached fixes your problem, but it runs without error on 9.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I may have made some additional changes that I don't now remember, but the only significant ones I can recall are having changed your comments to /* */ type rather than the * type, and commenting out one additional statement, namely:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;ods listing exclude none;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Oct 2012 20:16:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/halfnorm-macro-proc-genmod-ods-output-in-a-macro-loop/m-p/81950#M17700</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2012-10-01T20:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: halfnorm macro: proc genmod, ods output in a macro loop</title>
      <link>https://communities.sas.com/t5/SAS-Programming/halfnorm-macro-proc-genmod-ods-output-in-a-macro-loop/m-p/81951#M17701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or if you annony these information , you can redirect them into a txt file .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like something :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc printto log='c:\log.txt' ;run;&lt;/P&gt;&lt;P&gt;..............&lt;/P&gt;&lt;P&gt;proc printto;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Oct 2012 07:44:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/halfnorm-macro-proc-genmod-ods-output-in-a-macro-loop/m-p/81951#M17701</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-10-02T07:44:11Z</dc:date>
    </item>
  </channel>
</rss>

