<?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: Macro for surveygenmod: warning macro not resolved and statement not valid or out of order in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-surveygenmod-warning-macro-not-resolved-and-statement/m-p/899034#M355362</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No problem, happy to help if I can, although I doubt I will be able to go through all of the PDF you shared.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally it is most useful to have a sample of data (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank" rel="noopener"&gt;in the form of a data step&lt;/A&gt;) plus the code you are using, so that we can easily replicate and attempt to diagnose the issue. I had trouble following the details of everything you tried running, so as an attempt to help share what we cannot see, I would suggest the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Start a new SAS session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Submit the macro definition of&amp;nbsp;surveygenmod from page 16 onwards (including %mend on the last page) in the PDF you shared. This should just tell SAS what surveygenmod should do if it is invoked, it doesn't actually invoke it at this stage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Check all of the log. If there are no warnings or error messages then continue to the next step, otherwise please share the warnings and error messages using the Insert Code icon "&amp;lt;/&amp;gt;" when posting, and then see if anyone is able to assist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4) If the log had no issues then submit the following for diagnostics for the upcoming step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint symbolgen mlogic;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5) If the log had no issues then attempt to invoke (submit) %surveygenmod with the values you wanted to use with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;6) Check all of the log again. If there are no warnings or error messages then continue to the next step, otherwise please share the warnings and error messages using the Insert Code icon "&amp;lt;/&amp;gt;" when posting, and then see if anyone is able to assist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;7) Check your results and advise accordingly. If they are not what you expect then I would expect we will require sample data&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank" rel="noopener"&gt;in the form of a data step&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Oct 2023 22:38:09 GMT</pubDate>
    <dc:creator>Amir</dc:creator>
    <dc:date>2023-10-17T22:38:09Z</dc:date>
    <item>
      <title>Macro for surveygenmod: warning macro not resolved and statement not valid or out of order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-surveygenmod-warning-macro-not-resolved-and-statement/m-p/898981#M355328</link>
      <description>&lt;DIV class=""&gt;&lt;STRONG&gt;Hello,&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;I am working on running a ZIP model with complex survey data, and want to use a domain statement to get results for males and females. But, I keep getting errors when I run the %SurveyGenmod macro. This is my first time using a macro, so I'm likely missing something obvious. In the documentation, the authors list a standard macro code and then apply that code to different examples. However, the applied codes leave off some of the things that the base code had. I've tried the codes in different ways, using the ZIP code they shared and also using the base code they shared, and I keep getting the same errors/warnings. Does anyone have any suggestions for how I can troubleshoot this issue? I really appreciate the support!!&amp;nbsp;&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;Liz&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;Link to documentation:&amp;nbsp;&lt;/STRONG&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings17/0268-2017.pdf" target="_blank" rel="noopener"&gt;https://support.sas.com/resources/papers/proceedings17/0268-2017.pdf&lt;/A&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;Code:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;%surveygenmod(data=lesotho.lesotho_master10162023, y=HIVrisksum123, x= SV18_r EV18_r PVTOT18_r Q55dichot Q51_01 Q2 orphan3 Q9a_r,&lt;DIV class=""&gt;dist=zip, xzip= Q2 orphan3 Q9a_r sv18_r ev18_r pvtot18_r Q55dichot Q51_01,&lt;/DIV&gt;&lt;DIV class=""&gt;link=log, weight = individual_weight1, strata=DISTRICT, cluster=PSU, domain=fem, scale=,&lt;/DIV&gt;vadjust=n, alpha=0.05);&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;&lt;STRONG&gt;Error:&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV class=""&gt;65 &amp;nbsp; %surveygenmod(data=lesotho.lesotho_master10162023, y=HIVrisksum123, x= SV18_r EV18_r PVTOT18_r&lt;DIV class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;-&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;180&lt;/DIV&gt;&lt;DIV class=""&gt;65 ! &amp;nbsp;Q55dichot Q51_01 Q2 orphan3 Q9a_r,&lt;/DIV&gt;&lt;DIV class=""&gt;WARNING: Apparent invocation of macro SURVEYGENMOD not resolved.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/DIV&gt;&lt;DIV class=""&gt;66 &amp;nbsp; dist=zip, xzip= Q2 orphan3 Q9a_r sv18_r ev18_r pvtot18_r Q55dichot Q51_01,&lt;/DIV&gt;&lt;DIV class=""&gt;67 &amp;nbsp; link=log, weight = individual_weight1, strata=DISTRICT, cluster=PSU, domain=fem, scale=,&lt;/DIV&gt;&lt;DIV class=""&gt;68 &amp;nbsp; vadjust=n, alpha=0.05)&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 17 Oct 2023 17:07:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-surveygenmod-warning-macro-not-resolved-and-statement/m-p/898981#M355328</guid>
      <dc:creator>eperry12</dc:creator>
      <dc:date>2023-10-17T17:07:22Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for surveygenmod: warning macro not resolved and statement not valid or out of order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-surveygenmod-warning-macro-not-resolved-and-statement/m-p/898986#M355331</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The message in the log you have shared:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;WARNING: Apparent invocation of macro SURVEYGENMOD not resolved.&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;implies the macro has not been defined. Just to rule out the obvious, did you copy the definition of the macro from page 16 onwards in the link you shared, and submit that macro definition in SAS first, before trying to invoke it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 17:43:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-surveygenmod-warning-macro-not-resolved-and-statement/m-p/898986#M355331</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2023-10-17T17:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for surveygenmod: warning macro not resolved and statement not valid or out of order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-surveygenmod-warning-macro-not-resolved-and-statement/m-p/899010#M355350</link>
      <description>&lt;P&gt;Thanks so much for your help, Amir!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm new to these, so I didn't know I had to do that. So I copied the code starting on page 16 through the end of the documentation and ran that. On page 16 it has the macro code for the model first, so I tried to run that at the top of the code and then I tried to run it at the bottom of the long code, and then I tried to run it as two separate codes, with the long code first and then the model code second. If I run the long code on its own I don't get any errors (just the values are blank). If I run the model code before and after the long code I get dozens of errors, many new errors are in the code with my model, and there are also errors throughout the long macro code from the documentation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really appreciate your help!!!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All my best,&lt;/P&gt;&lt;P&gt;Liz&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 19:25:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-surveygenmod-warning-macro-not-resolved-and-statement/m-p/899010#M355350</guid>
      <dc:creator>eperry12</dc:creator>
      <dc:date>2023-10-17T19:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for surveygenmod: warning macro not resolved and statement not valid or out of order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-surveygenmod-warning-macro-not-resolved-and-statement/m-p/899034#M355362</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;No problem, happy to help if I can, although I doubt I will be able to go through all of the PDF you shared.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ideally it is most useful to have a sample of data (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank" rel="noopener"&gt;in the form of a data step&lt;/A&gt;) plus the code you are using, so that we can easily replicate and attempt to diagnose the issue. I had trouble following the details of everything you tried running, so as an attempt to help share what we cannot see, I would suggest the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Start a new SAS session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) Submit the macro definition of&amp;nbsp;surveygenmod from page 16 onwards (including %mend on the last page) in the PDF you shared. This should just tell SAS what surveygenmod should do if it is invoked, it doesn't actually invoke it at this stage.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3) Check all of the log. If there are no warnings or error messages then continue to the next step, otherwise please share the warnings and error messages using the Insert Code icon "&amp;lt;/&amp;gt;" when posting, and then see if anyone is able to assist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;4) If the log had no issues then submit the following for diagnostics for the upcoming step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint symbolgen mlogic;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;5) If the log had no issues then attempt to invoke (submit) %surveygenmod with the values you wanted to use with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;6) Check all of the log again. If there are no warnings or error messages then continue to the next step, otherwise please share the warnings and error messages using the Insert Code icon "&amp;lt;/&amp;gt;" when posting, and then see if anyone is able to assist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;7) Check your results and advise accordingly. If they are not what you expect then I would expect we will require sample data&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank" rel="noopener"&gt;in the form of a data step&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks &amp;amp; kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Oct 2023 22:38:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-surveygenmod-warning-macro-not-resolved-and-statement/m-p/899034#M355362</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2023-10-17T22:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro for surveygenmod: warning macro not resolved and statement not valid or out of order</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-for-surveygenmod-warning-macro-not-resolved-and-statement/m-p/899658#M355576</link>
      <description>&lt;P&gt;Thanks so much for all of your help!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to get the macro to run (that was my issue not running the first part of the code on page 16). However, I got errors when I entered my own information into the macro code. I decided to go with a different approach instead of trying to use a zip model. Thanks again for your help!&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Liz&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 17:12:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-for-surveygenmod-warning-macro-not-resolved-and-statement/m-p/899658#M355576</guid>
      <dc:creator>eperry12</dc:creator>
      <dc:date>2023-10-23T17:12:51Z</dc:date>
    </item>
  </channel>
</rss>

