<?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: Proc sql in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469138#M119949</link>
    <description>sir,&lt;BR /&gt;can you give little bit hint&lt;BR /&gt;how I can achieve these with Hash Table&lt;BR /&gt;&lt;BR /&gt;thanks in advance..</description>
    <pubDate>Mon, 11 Jun 2018 08:51:36 GMT</pubDate>
    <dc:creator>katkarparam</dc:creator>
    <dc:date>2018-06-11T08:51:36Z</dc:date>
    <item>
      <title>Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468652#M119741</link>
      <description>&lt;P&gt;I have one dataset(country) with one column(state),&lt;/P&gt;&lt;P&gt;dataset contain 10000 of record, all are duplicate.&lt;/P&gt;&lt;P&gt;i want to find out distinct record using &lt;STRONG&gt;proc SQ&lt;/STRONG&gt;L and store all distinct record in separate &lt;STRONG&gt;macro variable&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;i.e each distinct record stored in separete macro variable.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 11:49:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468652#M119741</guid>
      <dc:creator>katkarparam</dc:creator>
      <dc:date>2018-06-08T11:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468655#M119744</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/188222"&gt;@katkarparam&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have one dataset(country) with one column(state),&lt;/P&gt;
&lt;P&gt;dataset contain 10000 of record, all are duplicate.&lt;/P&gt;
&lt;P&gt;i want to find out distinct record using &lt;STRONG&gt;proc SQ&lt;/STRONG&gt;L and store all distinct record in separate &lt;STRONG&gt;macro variable&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;i.e each distinct record stored in separete macro variable.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Don't do that. Mass data belongs in datasets, macro variables are good for certain references etc.&lt;/P&gt;
&lt;P&gt;What for would you need that mass of macro variables?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 12:00:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468655#M119744</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-08T12:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468656#M119745</link>
      <description>&lt;P&gt;proc sql noprint;&lt;/P&gt;
&lt;P&gt;select distinct state into :state1- from country;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 12:46:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468656#M119745</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2018-06-11T12:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468672#M119750</link>
      <description>&lt;P&gt;Why?&amp;nbsp; You will hit macro limits, possible restrictions, and have to create a whole lot more code to work with that macro list.&amp;nbsp; Data should go in datasets - clue is in the name.&amp;nbsp; If you need to find data from one table using this distinct list then there are mutliple ways to do it for example:&lt;/P&gt;
&lt;PRE&gt;proc sql;
  create table want as 
  select  *
  from    have 
  where   state in (select distinct state from listds);
quit;&lt;/PRE&gt;
&lt;P&gt;Much simpler, listds dataset cotains the 1000 states, so you can add to that dataset, remove from, manipulate etc. very simple like any dataset, and use it like a list.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 12:45:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468672#M119750</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-08T12:45:27Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468678#M119753</link>
      <description>I agree with you. But my requirement is i have create new macro variable for each distinct value.</description>
      <pubDate>Fri, 08 Jun 2018 12:53:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468678#M119753</guid>
      <dc:creator>katkarparam</dc:creator>
      <dc:date>2018-06-08T12:53:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468681#M119754</link>
      <description>&lt;P&gt;So at least 10000 macro variables, I am not sure "requirement" is the right word here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you insist:&lt;/P&gt;
&lt;PRE&gt;proc sort data=states out=loop nodupkey;
  by state;
run;

data _null_;
  set loop;
  call symputx(cats('col',put(_n_,best.)),state);
run;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;But do be prepared to spend the next 100 years trying to work with that.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 13:00:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468681#M119754</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-06-08T13:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468921#M119830</link>
      <description>for. example purpose I have use the sas default dataset&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc sql noprint;&lt;BR /&gt;select distinct origin into :list- from sashelp.cars;&lt;BR /&gt;quit;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;WARNING: INTO Clause :list through : does not specify a valid sequence of macro variables.&lt;BR /&gt;</description>
      <pubDate>Sat, 09 Jun 2018 09:28:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468921#M119830</guid>
      <dc:creator>katkarparam</dc:creator>
      <dc:date>2018-06-09T09:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468922#M119831</link>
      <description>i have create new macro variable for each distinct value.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#This is challenge for me from my colleague&lt;BR /&gt;but I am not able to do</description>
      <pubDate>Sat, 09 Jun 2018 09:32:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/468922#M119831</guid>
      <dc:creator>katkarparam</dc:creator>
      <dc:date>2018-06-09T09:32:20Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469106#M119935</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/188222"&gt;@katkarparam&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;i have create new macro variable for each distinct value.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#This is challenge for me from my colleague&lt;BR /&gt;but I am not able to do&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So you're wasting time on something that two superusers have advised you not to do because it's probably the most stupid way to deal with this kind of issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's not that difficult to create, either. &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144199"&gt;@tomrvincent&lt;/a&gt; has already shown you (although his code doesn't work because he missed to give the macro variable name a trailing number) that there is a way to write values into a list of macro variables.&lt;/P&gt;
&lt;P&gt;See the documentation of the INTO clause in the &lt;A href="http://documentation.sas.com/?docsetId=sqlproc&amp;amp;docsetTarget=p0hwg3z33gllron184mzdoqwpe3j.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_blank"&gt;SAS 9.4 documentation for the SELECT statement&lt;/A&gt; (fourth method of macro variable specification).&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 06:31:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469106#M119935</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-11T06:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469114#M119938</link>
      <description>thanks &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; your valuable time.</description>
      <pubDate>Mon, 11 Jun 2018 07:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469114#M119938</guid>
      <dc:creator>katkarparam</dc:creator>
      <dc:date>2018-06-11T07:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469126#M119944</link>
      <description>&lt;P&gt;I agree absolutely with everyone else who says this is not a sensible thing to do. If you were to absolutely require loading a list of that magnitude into memory then a hash table would be the way to go....&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 08:19:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469126#M119944</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2018-06-11T08:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469138#M119949</link>
      <description>sir,&lt;BR /&gt;can you give little bit hint&lt;BR /&gt;how I can achieve these with Hash Table&lt;BR /&gt;&lt;BR /&gt;thanks in advance..</description>
      <pubDate>Mon, 11 Jun 2018 08:51:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469138#M119949</guid>
      <dc:creator>katkarparam</dc:creator>
      <dc:date>2018-06-11T08:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469151#M119953</link>
      <description>&lt;P&gt;The proper way of dealing with issues is not starting with the tools. You start with the issue itself, and then select the tool most suited for the task.&lt;/P&gt;
&lt;P&gt;So what for would you use this list of 10000 items?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 10:00:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469151#M119953</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-06-11T10:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469154#M119955</link>
      <description>&lt;P&gt;There’s a nice introduction to the subject here&amp;nbsp;&lt;A href="https://support.sas.com/resources/papers/proceedings15/3024-2015.pdf&amp;nbsp;" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings15/3024-2015.pdf&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 10:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469154#M119955</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2018-06-11T10:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469202#M119971</link>
      <description>Sorry...that should be list1-.  I've corrected my original post.</description>
      <pubDate>Mon, 11 Jun 2018 12:47:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469202#M119971</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2018-06-11T12:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469203#M119972</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; thanks for the catch.  I've corrected my post to be state1.</description>
      <pubDate>Mon, 11 Jun 2018 12:48:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469203#M119972</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2018-06-11T12:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469205#M119974</link>
      <description>How many distinct state values are there in your dataset?</description>
      <pubDate>Mon, 11 Jun 2018 12:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469205#M119974</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2018-06-11T12:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469512#M120126</link>
      <description>for this dataset I have 37 distinct values.</description>
      <pubDate>Tue, 12 Jun 2018 05:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469512#M120126</guid>
      <dc:creator>katkarparam</dc:creator>
      <dc:date>2018-06-12T05:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469513#M120127</link>
      <description>thank you.. I will refer it</description>
      <pubDate>Tue, 12 Jun 2018 05:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469513#M120127</guid>
      <dc:creator>katkarparam</dc:creator>
      <dc:date>2018-06-12T05:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: Proc sql</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469895#M120247</link>
      <description>Not 10,000.  37.</description>
      <pubDate>Wed, 13 Jun 2018 12:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Proc-sql/m-p/469895#M120247</guid>
      <dc:creator>tomrvincent</dc:creator>
      <dc:date>2018-06-13T12:06:27Z</dc:date>
    </item>
  </channel>
</rss>

