<?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 execution not ending manual stopping of run giving error in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-execution-not-ending-manual-stopping-of-run-giving-error/m-p/161731#M31417</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1/ as your are trying to symput nbt nbf in the datastep the macro will not be able to get those values. There will be a timing problem on valuses&lt;/P&gt;&lt;P&gt;2/ Debug your macro wih optionc mprint mlogic symbolgen etc...o&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Nov 2014 19:39:19 GMT</pubDate>
    <dc:creator>jakarman</dc:creator>
    <dc:date>2014-11-07T19:39:19Z</dc:date>
    <item>
      <title>Macro execution not ending manual stopping of run giving error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-execution-not-ending-manual-stopping-of-run-giving-error/m-p/161730#M31416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; I created a macro that create global variables based based on the program name I pass. when I execute macro it is not stop running. When I manually stop I am getting following error.&amp;nbsp;&amp;nbsp; What is wrong with my code?&lt;/P&gt;&lt;P&gt;The input dataset has the value "l_demo_fas".&lt;/P&gt;&lt;P&gt;Please help!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;129&amp;nbsp;&amp;nbsp; %datapgm(pgm=l_demo_fas);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: The %TO value of the %DO I loop is invalid.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: The macro DATAPGM will stop executing.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*****Here is my code****&lt;/P&gt;&lt;P&gt;%macro datapgm(pgm=);&lt;/P&gt;&lt;P&gt;%global nbt nbf outname pgmpath;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set adam.toc_prog;&lt;/P&gt;&lt;P&gt;&amp;nbsp; where pgm_id = "&amp;amp;pgm";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symput('nbt',compress(input(strip(put(numtitle,3.)),$3.)));&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symput('nbf',compress(input(strip(put(numfoot,3.)),$3.)));&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symput('outname', compress(strip(outname)));&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symput('pgmpath',compress(strip(pgmpath)));&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;%do i = 1 %to &amp;amp;nbt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %global t&amp;amp;i;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('t'||"&amp;amp;i",strip(title_&amp;amp;i));&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%do j = 1 %to &amp;amp;nbf;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %global f&amp;amp;j;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('f'||"&amp;amp;j",strip(foot_&amp;amp;j));&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt; run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;%datapgm(pgm=l_demo_fas);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; %put &amp;amp;nbt.&amp;nbsp; &amp;amp;nbf;&lt;/P&gt;&lt;P&gt; %put &amp;amp;t1&amp;nbsp; &amp;amp;t2 &amp;amp;t3;&lt;/P&gt;&lt;P&gt; %put &amp;amp;f1;&lt;/P&gt;&lt;P&gt; %put &amp;amp;outname;&lt;/P&gt;&lt;P&gt; %put &amp;amp;pgmpath;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 18:10:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-execution-not-ending-manual-stopping-of-run-giving-error/m-p/161730#M31416</guid>
      <dc:creator>mikki</dc:creator>
      <dc:date>2014-11-07T18:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Macro execution not ending manual stopping of run giving error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-execution-not-ending-manual-stopping-of-run-giving-error/m-p/161731#M31417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1/ as your are trying to symput nbt nbf in the datastep the macro will not be able to get those values. There will be a timing problem on valuses&lt;/P&gt;&lt;P&gt;2/ Debug your macro wih optionc mprint mlogic symbolgen etc...o&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 19:39:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-execution-not-ending-manual-stopping-of-run-giving-error/m-p/161731#M31417</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-11-07T19:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Macro execution not ending manual stopping of run giving error</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-execution-not-ending-manual-stopping-of-run-giving-error/m-p/161732#M31418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaap,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If I run part by part working fine.. kind of weird.&lt;/P&gt;&lt;P&gt;&amp;nbsp; As you have mentioned it looks like timing issue.&lt;/P&gt;&lt;P&gt;Now I used 2 data steps in the macro. so far working fine and I used %eval for do loop. see the following corrected program. &lt;/P&gt;&lt;P&gt;Thanks for you suggestion..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro datapgm(pgm=);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data ttft;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set adam.toc_prog;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; where pgm_id = "&amp;amp;pgm";&lt;/P&gt;&lt;P&gt; %global nbt nbf outname pgmpath;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&amp;nbsp; call symput('nbt', compress(input(strip(put(numtitle,3.)),$3.)));&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symput('nbf', compress(input(strip(put(numfoot,3.)),$3.)));&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symput('outname', compress(strip(outname)));&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symput('pgmpath',compress(strip(pgmpath)));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _NULL_;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; set ttft;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %do i = 1 %to %eval(&amp;amp;nbt);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %global t&amp;amp;i;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('t'||"&amp;amp;i",strip(title_&amp;amp;i));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %do j = 1 %to %eval(&amp;amp;nbf);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %global f&amp;amp;j;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; call symput('f'||"&amp;amp;j", strip(foot_&amp;amp;j));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 20:03:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-execution-not-ending-manual-stopping-of-run-giving-error/m-p/161732#M31418</guid>
      <dc:creator>mikki</dc:creator>
      <dc:date>2014-11-07T20:03:56Z</dc:date>
    </item>
  </channel>
</rss>

