<?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 macross in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242644#M309074</link>
    <description>&lt;P&gt;%macro ab(lib,ds);&lt;/P&gt;
&lt;P&gt;%do i=1 %to 3;&lt;BR /&gt;%let x=%scan&lt;STRONG&gt;(&amp;amp;ds,&amp;amp;i,%str(,));&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;proc print data=&amp;amp;lib..&amp;amp;x;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jan 2016 03:41:54 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-01-11T03:41:54Z</dc:date>
    <item>
      <title>sas macross</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242527#M309065</link>
      <description>&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;%macro ab(lib,ds);&lt;/P&gt;&lt;P&gt;%do i=1 %to 3;&lt;BR /&gt;%let x=%scan("&amp;amp;ds",&amp;amp;i,',');&lt;/P&gt;&lt;P&gt;proc print data=&amp;amp;lib..&amp;amp;x;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;BR /&gt;%ab(test ,test1 )&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro ab;&lt;BR /&gt;proc sql;&lt;BR /&gt;select distinct memname into:a separated by ',' from dictionary.columns where libname="PAWAN" and memname like"A%";&lt;BR /&gt;%let x=&amp;amp;sqlobs;&lt;BR /&gt;quit;&lt;BR /&gt;%do i=1 %to x;&lt;BR /&gt;%let x=%scan("&amp;amp;a",&amp;amp;i,'i');&lt;BR /&gt;proc print data=pawan..&amp;amp;x;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;%mend;&lt;BR /&gt;%ab;&lt;/P&gt;&lt;P&gt;&amp;nbsp;in the first macro i'm getting error but in the second it is working fine??&lt;/P&gt;&lt;P&gt;why %scan is not working in the first macro???what's the logic&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2016 10:21:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242527#M309065</guid>
      <dc:creator>pawandh</dc:creator>
      <dc:date>2016-01-09T10:21:53Z</dc:date>
    </item>
    <item>
      <title>Re: sas macross</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242540#M309066</link>
      <description>&lt;P&gt;What is your error?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Different issue could happen when running&amp;nbsp;your first macro&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro ab(lib,ds);
%let c=%sysfunc(countw(&amp;amp;ds));
%do i=1 %to &amp;amp;c;
%let x=%scan(&amp;amp;ds,&amp;amp;i,',');
%put &amp;amp;y;
proc print data=&amp;amp;lib..&amp;amp;x;
run;
%end;
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This shold works if&amp;nbsp;you do not use double quote with ds when calling your macro&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2016 14:09:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242540#M309066</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-01-09T14:09:50Z</dc:date>
    </item>
    <item>
      <title>Re: sas macross</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242546#M309067</link>
      <description>&lt;P&gt;when i'm passing values in a macro by "into" using proc sql then we are enclosing that macro variable in double quotes and normally v r not doing it .why so??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2016 15:03:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242546#M309067</guid>
      <dc:creator>pawandh</dc:creator>
      <dc:date>2016-01-09T15:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: sas macross</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242548#M309068</link>
      <description>&lt;P&gt;like here&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;%macro ab;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc sql;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;select distinct memname into:a separated by ',' from dictionary.columns where libname="PAWAN" and memname like"A%";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%let x=&amp;amp;sqlobs;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;quit;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%do i=1 %to x;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%let x=%scan("&amp;amp;a",&amp;amp;i,'i');&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;proc print data=pawan..&amp;amp;x;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%end;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%mend;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;%ab;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i'm enclosing &amp;amp;ds in double quotes and it's working fine then why not in first scenerio as we are using the same %scan function in both???&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2016 15:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242548#M309068</guid>
      <dc:creator>pawandh</dc:creator>
      <dc:date>2016-01-09T15:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: sas macross</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242557#M309069</link>
      <description>&lt;P&gt;Clearly, you are not showing us your real programs. &amp;nbsp;Your second program that you claim is working contains at least two errors. &amp;nbsp;So until you show us your real programs, nobody can debug them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your first program should not be using double quotes. &amp;nbsp;You would expect this to generate an error:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc print data=lib."cars;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you were to turn on the MPRINT option, you could see that this is the code being generated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2016 16:02:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242557#M309069</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-01-09T16:02:47Z</dc:date>
    </item>
    <item>
      <title>Re: sas macross</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242558#M309070</link>
      <description>&lt;P&gt;Although your secnd macro _as it is _ may give the output. But, if you checked the log you will find error too.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2016 16:10:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242558#M309070</guid>
      <dc:creator>mohamed_zaki</dc:creator>
      <dc:date>2016-01-09T16:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: sas macross</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242564#M309071</link>
      <description>&lt;P&gt;can u plz tell that while using %scan when we have to keep our macro variable within double quotes and when not?&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2016 17:02:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242564#M309071</guid>
      <dc:creator>pawandh</dc:creator>
      <dc:date>2016-01-09T17:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: sas macross</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242565#M309072</link>
      <description>&lt;P&gt;%macro ab(ds);&lt;/P&gt;&lt;P&gt;%do i=1 %to 3;&lt;BR /&gt;%let x=%scan("&amp;amp;ds",&amp;amp;i,',');&lt;/P&gt;&lt;P&gt;proc print data=&amp;amp;lib..&amp;amp;x;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;BR /&gt;%ab(test ,test1,test2 );&lt;/P&gt;&lt;P&gt;it should work but it's not working??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2016 17:07:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242565#M309072</guid>
      <dc:creator>pawandh</dc:creator>
      <dc:date>2016-01-09T17:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: sas macross</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242575#M309073</link>
      <description>&lt;P&gt;Yesterday you posted&amp;nbsp;&lt;A href="https://communities.sas.com/t5/General-SAS-Programming/sas-mac/m-p/242519#U242519" target="_self"&gt;this&lt;/A&gt;&amp;nbsp;same macro and you were given options on how to correct it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It doesn't appear you've made any of the changes suggested.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again, you are passing more parameters to the macro than you have defined.&lt;/P&gt;</description>
      <pubDate>Sat, 09 Jan 2016 20:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242575#M309073</guid>
      <dc:creator>JoshB</dc:creator>
      <dc:date>2016-01-09T20:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: sas macross</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242644#M309074</link>
      <description>&lt;P&gt;%macro ab(lib,ds);&lt;/P&gt;
&lt;P&gt;%do i=1 %to 3;&lt;BR /&gt;%let x=%scan&lt;STRONG&gt;(&amp;amp;ds,&amp;amp;i,%str(,));&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;proc print data=&amp;amp;lib..&amp;amp;x;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2016 03:41:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-macross/m-p/242644#M309074</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-01-11T03:41:54Z</dc:date>
    </item>
  </channel>
</rss>

