<?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 sas functions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710569#M218758</link>
    <description>&lt;P&gt;What is the rule for the split?&lt;/P&gt;
&lt;P&gt;At the third value? At a specific name? Something else not shown?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And show the code that you are currently using to "fetch from a table into a ',' separated macro ".&lt;/P&gt;</description>
    <pubDate>Mon, 11 Jan 2021 15:24:42 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-01-11T15:24:42Z</dc:date>
    <item>
      <title>Sas macro sas functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710565#M218756</link>
      <description>I have a list of names fetched from a table into a ',' separated macro.&lt;BR /&gt;Cities='Mumbai,Delhi,jaipur,chandigarh,chennai,goa'&lt;BR /&gt;I want to split this inti two macro like&lt;BR /&gt;Cities1="Mumbai,delhi,jaipur"&lt;BR /&gt;Cities2="chandigarh,chennai,goa"&lt;BR /&gt;&lt;BR /&gt;I am new to learning sas.</description>
      <pubDate>Mon, 11 Jan 2021 15:05:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710565#M218756</guid>
      <dc:creator>khandelwalanmol</dc:creator>
      <dc:date>2021-01-11T15:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Sas macro sas functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710569#M218758</link>
      <description>&lt;P&gt;What is the rule for the split?&lt;/P&gt;
&lt;P&gt;At the third value? At a specific name? Something else not shown?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And show the code that you are currently using to "fetch from a table into a ',' separated macro ".&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 15:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710569#M218758</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-11T15:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Sas macro sas functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710574#M218761</link>
      <description>Rule is i have to keep 4 variables in the first variable and next 4 in another.&lt;BR /&gt;If in future the count of cities increase third variable shoukd be created.</description>
      <pubDate>Mon, 11 Jan 2021 15:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710574#M218761</guid>
      <dc:creator>khandelwalanmol</dc:creator>
      <dc:date>2021-01-11T15:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sas macro sas functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710576#M218762</link>
      <description>I am using&lt;BR /&gt;Proc sql;&lt;BR /&gt;Select distinct cities into :cities separated by ',' from states;&lt;BR /&gt;Quit;</description>
      <pubDate>Mon, 11 Jan 2021 15:29:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710576#M218762</guid>
      <dc:creator>khandelwalanmol</dc:creator>
      <dc:date>2021-01-11T15:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: Sas macro sas functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710581#M218764</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/363459"&gt;@khandelwalanmol&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Rule is i have to keep 4 variables in the first variable and next 4 in another.&lt;BR /&gt;If in future the count of cities increase third variable shoukd be created.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You will want to switch to using a data step from trying to use SQL for this.&amp;nbsp; So if you have variable named CITY in a dataset named HAVE you can use code like this to create macro variables MVAR1, MVAR2, ... and MVAR_COUNT.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
do i=1 to 4 until(eof) ;
   set have end=eof ;
   length string $500 ;
   string = catx(',',string,city);
end;
  call symputx(cats('mvar',_n_),string);
  if eof then call symputx('mvar_count',_n_);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Jan 2021 15:33:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710581#M218764</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-01-11T15:33:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sas macro sas functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710588#M218767</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/363459"&gt;@khandelwalanmol&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Rule is i have to keep 4 variables in the first variable and next 4 in another.&lt;BR /&gt;If in future the count of cities increase third variable shoukd be created.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Please check either your counting or your definition. The values you showed look like you start with 6 and want 3 value in each, not 4. So I am not sure how to interpret this "Rule".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 15:49:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710588#M218767</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-11T15:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: Sas macro sas functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710590#M218768</link>
      <description>Sorry for that typo.&lt;BR /&gt;It is 3 cities in one variable.</description>
      <pubDate>Mon, 11 Jan 2021 15:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710590#M218768</guid>
      <dc:creator>khandelwalanmol</dc:creator>
      <dc:date>2021-01-11T15:56:15Z</dc:date>
    </item>
    <item>
      <title>Re: Sas macro sas functions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710610#M218779</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/363459"&gt;@khandelwalanmol&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Sorry for that typo.&lt;BR /&gt;It is 3 cities in one variable.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Then that looks like &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;'s solution starting with a "Do i=1 to 3" instead of the "to 4" should work.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 16:25:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Sas-macro-sas-functions/m-p/710610#M218779</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-01-11T16:25:48Z</dc:date>
    </item>
  </channel>
</rss>

