<?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 PROC PHREG macro var list is not recognized in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-macro-var-list-is-not-recognized/m-p/891360#M352136</link>
    <description>&lt;PRE&gt;/*Cox Regression*/
%let class_var = genderC;
%let length = timeToFirstInrAttain;
%let response_var = firstInrAttain;
%let indep_list = ageY genderC BSA AF Hypertension CHF serumAlb akiC ddiC indicationC CYP2C9code VKORC1Code;

%macro Cox;
proc phreg data = &amp;amp;raw_data_name;
class &amp;amp;class_var;
model &amp;amp;length*&amp;amp;response_var(1) = &amp;amp;indep_list;
run;
%mend;&lt;/PRE&gt;
&lt;P&gt;The &amp;amp;indep_list was read by the PROC PHREG as the very &amp;amp;indep_list, instead of the 12 vars it represented. I compared this with PROC LOGISTIC and the later PROC does not have this issue.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Aug 2023 17:33:26 GMT</pubDate>
    <dc:creator>TomHsiung</dc:creator>
    <dc:date>2023-08-28T17:33:26Z</dc:date>
    <item>
      <title>PROC PHREG macro var list is not recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-macro-var-list-is-not-recognized/m-p/891360#M352136</link>
      <description>&lt;PRE&gt;/*Cox Regression*/
%let class_var = genderC;
%let length = timeToFirstInrAttain;
%let response_var = firstInrAttain;
%let indep_list = ageY genderC BSA AF Hypertension CHF serumAlb akiC ddiC indicationC CYP2C9code VKORC1Code;

%macro Cox;
proc phreg data = &amp;amp;raw_data_name;
class &amp;amp;class_var;
model &amp;amp;length*&amp;amp;response_var(1) = &amp;amp;indep_list;
run;
%mend;&lt;/PRE&gt;
&lt;P&gt;The &amp;amp;indep_list was read by the PROC PHREG as the very &amp;amp;indep_list, instead of the 12 vars it represented. I compared this with PROC LOGISTIC and the later PROC does not have this issue.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 17:33:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-macro-var-list-is-not-recognized/m-p/891360#M352136</guid>
      <dc:creator>TomHsiung</dc:creator>
      <dc:date>2023-08-28T17:33:26Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG macro var list is not recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-macro-var-list-is-not-recognized/m-p/891361#M352137</link>
      <description>&lt;P&gt;This is not possible, because the macro variable resolution happens before PROC PHREG has started to execute.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you post the full log from running an example, with system option MPRINT turned on?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 17:41:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-macro-var-list-is-not-recognized/m-p/891361#M352137</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-08-28T17:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG macro var list is not recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-macro-var-list-is-not-recognized/m-p/891422#M352157</link>
      <description>Hi, Quentin&lt;BR /&gt;Thanks for you comments. Well, today I re-ran the code and it did not reproduce the issue. Therefore, I am not able to reproduce the error log. I use SAS University edition and my networking connection was bad yesterday. Maybe the networking lag caused this issue. Thank you.</description>
      <pubDate>Tue, 29 Aug 2023 06:07:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-macro-var-list-is-not-recognized/m-p/891422#M352157</guid>
      <dc:creator>TomHsiung</dc:creator>
      <dc:date>2023-08-29T06:07:31Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG macro var list is not recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-macro-var-list-is-not-recognized/m-p/891537#M352198</link>
      <description>&lt;P&gt;Any time you are working with macros, not just macro variables but actual %macro/%mend code and something goes wonky there are 3 basic things to do:&lt;/P&gt;
&lt;P&gt;1) make sure have saved the code files and data&lt;/P&gt;
&lt;P&gt;2) close the SAS session (if you can watch the LOG screen while doing this you might see error messages just as the session shuts down)&lt;/P&gt;
&lt;P&gt;3) restart a new SAS session.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The macro language has lots of places that very little things can end up with the code you think you submit is not what is actually seen by the processor. Some of these can be subtle, others result in no apparent code running at all. Resetting the session clears out some of that.&lt;/P&gt;
&lt;P&gt;When you say that re-running the code today didn't do that I suspect it was in a new SAS session correct?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 14:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-macro-var-list-is-not-recognized/m-p/891537#M352198</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2023-08-29T14:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: PROC PHREG macro var list is not recognized</title>
      <link>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-macro-var-list-is-not-recognized/m-p/891875#M352303</link>
      <description>&lt;P&gt;Thanks for these advice, ballardw.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yep, I will follow your guide.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Aug 2023 07:28:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/PROC-PHREG-macro-var-list-is-not-recognized/m-p/891875#M352303</guid>
      <dc:creator>TomHsiung</dc:creator>
      <dc:date>2023-08-31T07:28:28Z</dc:date>
    </item>
  </channel>
</rss>

