<?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: SAS macro variable warning in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718890#M222517</link>
    <description>&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;This is a simple user witten code in the user written transofrm . I tested once again and it looks like an issue if add a sub job(job in a job)&amp;nbsp; if I add a sub job to a job then it is not working. If I remove the subjob then it is working.&lt;/P&gt;
&lt;P&gt;nothing to do with subjob but not sure why macro is not resolving.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sathya66_0-1613137988248.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54643iD9D122EE4A715371/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sathya66_0-1613137988248.png" alt="sathya66_0-1613137988248.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    connect to teradata  ( user=myusr1 password=mypwd1 );
    select * from connection to teradata 
	(select count(*) as count into:wt05_count from test)
	;
    disconnect from teradata;
    quit;
  %put &amp;amp;wt05_count&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 Feb 2021 13:58:26 GMT</pubDate>
    <dc:creator>sathya66</dc:creator>
    <dc:date>2021-02-12T13:58:26Z</dc:date>
    <item>
      <title>SAS macro variable warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718861#M222513</link>
      <description>&lt;P&gt;All&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Open Job from DI studio&lt;/LI&gt;
&lt;LI&gt;Click on Run -&amp;gt; The job will run with a warning as mentioned below&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sathya66_1-1613131769789.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54631i30C5DE26AC44C008/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sathya66_1-1613131769789.png" alt="sathya66_1-1613131769789.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Now only run transformation 3 -&amp;gt; It runs fine, and macro is resolved fine&lt;/LI&gt;
&lt;LI&gt;Then run the whole job again -&amp;gt; It runs fine&lt;/LI&gt;
&lt;LI&gt;Now close the job, open it again and run the whole job -&amp;gt; Same &amp;nbsp;with a warning as above&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Any idea? I thought it’s&amp;nbsp; assigning a macro globally but 2nd&amp;nbsp;&amp;nbsp;step is working so its not a global macro issue.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 12:15:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718861#M222513</guid>
      <dc:creator>sathya66</dc:creator>
      <dc:date>2021-02-12T12:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro variable warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718862#M222514</link>
      <description>&lt;P&gt;The macro variable &amp;amp;wt05_count does not exist. Then, somewhere along the way, the macro variable &amp;amp;wt05_count is created and you don't get the WARNING. When you create a new job, it doesn't know about the macro variables from other jobs. Other than that, we can't say as you have shown us only a small portion of the program.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 12:29:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718862#M222514</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-02-12T12:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro variable warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718890#M222517</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;This is a simple user witten code in the user written transofrm . I tested once again and it looks like an issue if add a sub job(job in a job)&amp;nbsp; if I add a sub job to a job then it is not working. If I remove the subjob then it is working.&lt;/P&gt;
&lt;P&gt;nothing to do with subjob but not sure why macro is not resolving.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sathya66_0-1613137988248.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54643iD9D122EE4A715371/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sathya66_0-1613137988248.png" alt="sathya66_0-1613137988248.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    connect to teradata  ( user=myusr1 password=mypwd1 );
    select * from connection to teradata 
	(select count(*) as count into:wt05_count from test)
	;
    disconnect from teradata;
    quit;
  %put &amp;amp;wt05_count&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 13:58:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718890#M222517</guid>
      <dc:creator>sathya66</dc:creator>
      <dc:date>2021-02-12T13:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro variable warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718914#M222531</link>
      <description>&lt;P&gt;If the wt05_count macro variable has been deleted in the subjob, or&lt;/P&gt;
&lt;P&gt;if the wt05_count macro variable has been created in the subjob, then&lt;/P&gt;
&lt;P&gt;it has become a local macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's the former, check the symdel and %symdel statements, and if it's the latter, try putting&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%global wt05_count;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in front of the proc sql.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 15:35:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718914#M222531</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-02-12T15:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro variable warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718920#M222532</link>
      <description>&lt;P&gt;That code looks wrong.&amp;nbsp; It looks like you are trying to create a variable in Teradata instead of a macro variable in SAS.&lt;/P&gt;
&lt;P&gt;Also when using INTO clause of PROC SQL to make a macro variable it is best to first set some default value for the macro variable in case the query returns no observations.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
  connect to teradata  ( user=myusr1 password=mypwd1 );
%let wt05_count=QUERY FAILURE;
  select count into :wt05_count  from connection to teradata 
    (select count(*) as count from test)
  ;
  disconnect from teradata;
quit;
%put &amp;amp;wt05_count&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Feb 2021 15:45:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718920#M222532</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-12T15:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro variable warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718934#M222533</link>
      <description>Tried this&lt;BR /&gt;but no luck %global wt05_count;&lt;BR /&gt;let me test symdel and %symdel statements</description>
      <pubDate>Fri, 12 Feb 2021 16:16:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718934#M222533</guid>
      <dc:creator>sathya66</dc:creator>
      <dc:date>2021-02-12T16:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro variable warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718935#M222534</link>
      <description>If we run only that trnasormation , it is resolving but with whole job it's not&lt;BR /&gt;&lt;BR /&gt; only run transformation  -&amp;gt; It runs fine, and macro is resolved fine&lt;BR /&gt;Then run the whole job again -&amp;gt; It runs fine&lt;BR /&gt;Now close the job, open it again and run the whole job -&amp;gt; Same  with a warning</description>
      <pubDate>Fri, 12 Feb 2021 16:19:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718935#M222534</guid>
      <dc:creator>sathya66</dc:creator>
      <dc:date>2021-02-12T16:19:24Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro variable warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718944#M222535</link>
      <description>&lt;P&gt;also Just tried with simple proc sql and it didn't work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname test teradata AUTHDOMAIN="TeradataAuth" database=test fastload=yes;
proc sql noprint ;

select count(*) as count into:wt05_count from test.test;

quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I added a dummy job and run the code worked fine. If I add this subjob and Getting the warning. I think, the problem is with subjob.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 16:48:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/718944#M222535</guid>
      <dc:creator>sathya66</dc:creator>
      <dc:date>2021-02-12T16:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro variable warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/719043#M222572</link>
      <description>&lt;P&gt;symdel deletes a macro variable.&lt;/P&gt;
&lt;P&gt;Try searching for "symdel" in subjob.&lt;BR /&gt;If you find it, make sure you haven't deleted wt05_count.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Feb 2021 22:55:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/719043#M222572</guid>
      <dc:creator>japelin</dc:creator>
      <dc:date>2021-02-12T22:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: SAS macro variable warning</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/719868#M222939</link>
      <description>Recreated the main job , sub/inner job from scratch and working fine</description>
      <pubDate>Wed, 17 Feb 2021 11:34:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-macro-variable-warning/m-p/719868#M222939</guid>
      <dc:creator>sathya66</dc:creator>
      <dc:date>2021-02-17T11:34:13Z</dc:date>
    </item>
  </channel>
</rss>

