<?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: STACK?  ARRAY?  What is the best approach? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/STACK-ARRAY-What-is-the-best-approach/m-p/521494#M141505</link>
    <description>&lt;P&gt;The suggested SORT will work, as will PROC SQL using SELECT DISTINCT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before that, however,&amp;nbsp; you have to decide what makes a name different?&amp;nbsp; You have "shawn" in your sample data.&amp;nbsp; Is "shawn" different than "Shawn" ?&amp;nbsp; You might want to account for capitalization before applying a procedure.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Dec 2018 15:16:45 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-12-14T15:16:45Z</dc:date>
    <item>
      <title>STACK?  ARRAY?  What is the best approach?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/STACK-ARRAY-What-is-the-best-approach/m-p/521487#M141501</link>
      <description>&lt;P&gt;I have 100k obs of data with the variable NAME.&amp;nbsp;&amp;nbsp; Looks as follows.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;OBS&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;NAME&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;John&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Mary&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;John&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;5&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;6&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Joan&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;7&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;John&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;8&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Mary&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;9&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;10&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;shawn&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I would like to do is create a list that has each unique value of the variable NAME.&amp;nbsp;&amp;nbsp; From the sample above the output list would be...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Obs&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Name&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;John&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;2&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Mary&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;3&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;4&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;5&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Joan&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;6&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;Shawn&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I only want to capture each unique value of the variable NAME.&amp;nbsp;&amp;nbsp; I've thought of doing this using a STACK feature in other languages and read up on the ARRAY function in SAS.&amp;nbsp;&amp;nbsp;I need to be able to read my input dataset capture the value of NAME and examine it against a stack or array to see if I have already stored its value.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a better way of doing this?&amp;nbsp;&amp;nbsp; Is there a PROCEDURE that will do this? I'm thinking the DATA Step is the best approach but wanted to share my problem with this forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 15:03:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/STACK-ARRAY-What-is-the-best-approach/m-p/521487#M141501</guid>
      <dc:creator>jduffy</dc:creator>
      <dc:date>2018-12-14T15:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: STACK?  ARRAY?  What is the best approach?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/STACK-ARRAY-What-is-the-best-approach/m-p/521491#M141504</link>
      <description>&lt;P&gt;please try the proc sort procedure with the nodupkey option to remove the duplicates. &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 sort data=have out=want nodupkey;
by name;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 15:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/STACK-ARRAY-What-is-the-best-approach/m-p/521491#M141504</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2018-12-14T15:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: STACK?  ARRAY?  What is the best approach?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/STACK-ARRAY-What-is-the-best-approach/m-p/521494#M141505</link>
      <description>&lt;P&gt;The suggested SORT will work, as will PROC SQL using SELECT DISTINCT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Before that, however,&amp;nbsp; you have to decide what makes a name different?&amp;nbsp; You have "shawn" in your sample data.&amp;nbsp; Is "shawn" different than "Shawn" ?&amp;nbsp; You might want to account for capitalization before applying a procedure.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 15:16:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/STACK-ARRAY-What-is-the-best-approach/m-p/521494#M141505</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-12-14T15:16:45Z</dc:date>
    </item>
  </channel>
</rss>

