<?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 help in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/93983#M19808</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At a minimum, start with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The word %LET is missing from I=&amp;amp;fin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the purpose of:&amp;nbsp; var=&amp;amp;&amp;amp;var&amp;amp;i;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It generates a DATA step assignment statement, without the rest of the DATA step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also note that you have unmatched single quotes in the comment line that you added.&amp;nbsp; It's not clear if that's really part of the code you ran or not but get rid of unmatched quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And of course, whatever the results, show us the earlier pieces of the code.&amp;nbsp; Some of these macro variables are coming out of nowhere.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 13 Oct 2012 02:29:06 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2012-10-13T02:29:06Z</dc:date>
    <item>
      <title>Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/93979#M19804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have the follwing macro. It does not show any error but is not executed either. Please help me fix it. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro surv(filenm, str=, fin=);&lt;/P&gt;&lt;P&gt; %let k=&amp;amp;str; l=&amp;amp;fin; %let name=&amp;amp;filename;&lt;/P&gt;&lt;P&gt; %let var1=a_cmb; %let var2=a_ip; %let var3=a_er; &lt;/P&gt;&lt;P&gt; %let var4=d_cmb; %let var5=d_ip; %let var6=d_er;&lt;/P&gt;&lt;P&gt; %do i=&amp;amp;k %to &amp;amp;l;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var=&amp;amp;&amp;amp;var&amp;amp;i; *(' tried "&amp;amp;&amp;amp;var&amp;amp;i" also );&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; title "PD_file-&amp;amp;name, event-&amp;amp;var";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; proc phreg data=event_pd_&amp;amp;name;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; model &amp;amp;var_time*&amp;amp;var_event(0)=&amp;nbsp; age cci&amp;nbsp; pd / ties=efron; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; array pd_a(*) pd_q1-pd_q8; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; t=ceil(&amp;amp;var_time/90); pd=pd_a&lt;T&gt;;&lt;/T&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; run; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; title;&lt;/P&gt;&lt;P&gt; %end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%surv(min, str=4, fin=5);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 23:49:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/93979#M19804</guid>
      <dc:creator>brs2012</dc:creator>
      <dc:date>2012-10-12T23:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/93980#M19805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have not read through your code, but one thing pop out instantly: You did not define &amp;amp;filename in your macro (unless you did it somewhere else, and then 'filenm' was defined but never called), yet you call for it. My guess is that you typo parameter "filenm" with 'filename'. Not sure if this is the cause,&amp;nbsp; but it just does not seem right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2012 00:02:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/93980#M19805</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-10-13T00:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/93981#M19806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@Hai-Kuo; thanks, smart catch, but it is typo here. It was ok in the original one but problem is still there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2012 00:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/93981#M19806</guid>
      <dc:creator>brs2012</dc:creator>
      <dc:date>2012-10-13T00:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/93982#M19807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;options mlogic mprint symbolgen;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then post the log, or maybe you can then figure it out yourself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Haikuo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;update: from your code, &lt;/P&gt;&lt;P&gt;1. "var" was not defined as macro variable, so '&amp;amp;var' should not be resolved.&amp;nbsp; add '%let' to&amp;nbsp; 'var=&amp;amp;&amp;amp;var&amp;amp;i;' &lt;/P&gt;&lt;P&gt;2. &amp;amp;var_time, &amp;amp;var_event was not defined. What you want maybe: &amp;amp;var._time, &amp;amp;var._event&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2012 01:31:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/93982#M19807</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2012-10-13T01:31:47Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/93983#M19808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At a minimum, start with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The word %LET is missing from I=&amp;amp;fin.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the purpose of:&amp;nbsp; var=&amp;amp;&amp;amp;var&amp;amp;i;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It generates a DATA step assignment statement, without the rest of the DATA step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also note that you have unmatched single quotes in the comment line that you added.&amp;nbsp; It's not clear if that's really part of the code you ran or not but get rid of unmatched quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And of course, whatever the results, show us the earlier pieces of the code.&amp;nbsp; Some of these macro variables are coming out of nowhere.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2012 02:29:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/93983#M19808</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-10-13T02:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro help</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/93984#M19809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Lots of thanks to both of you!!! Yes, code ran.&lt;/P&gt;&lt;P&gt;@ Haikuo: Enabling Options, comments 1 &amp;amp; 2 were of great help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@ Astounding: adding %let worked. &amp;amp;&amp;amp;var&amp;amp;i added to pick and assign values selectively.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 13 Oct 2012 06:03:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-help/m-p/93984#M19809</guid>
      <dc:creator>brs2012</dc:creator>
      <dc:date>2012-10-13T06:03:06Z</dc:date>
    </item>
  </channel>
</rss>

