<?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: how to create an unique composite index in the data step? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-unique-composite-index-in-the-data-step/m-p/22084#M3577</link>
    <description>Suggest you start with the SAS documentation and the SAS support &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website (free) resources.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
data step programming composite index site:sas.com</description>
    <pubDate>Mon, 25 Oct 2010 14:31:07 GMT</pubDate>
    <dc:creator>sbb</dc:creator>
    <dc:date>2010-10-25T14:31:07Z</dc:date>
    <item>
      <title>how to create an unique composite index in the data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-unique-composite-index-in-the-data-step/m-p/22083#M3576</link>
      <description>Hi, All!&lt;BR /&gt;
&lt;BR /&gt;
I want create an unique composite index in the data step for limit dumplicate rows inserted.&lt;BR /&gt;
&lt;BR /&gt;
The Logic SAS Code may like following:&lt;BR /&gt;
&lt;BR /&gt;
data work.wolf(index=(id name /unique ));&lt;BR /&gt;
infile datalines dlm="|"; &lt;BR /&gt;
length id 8. name $10. age 8.;&lt;BR /&gt;
input id name age;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1|forest|10&lt;BR /&gt;
2|forest|11&lt;BR /&gt;
2|forest|12&lt;BR /&gt;
3|forest|13&lt;BR /&gt;
2|forest|14&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
In the rows in the work.wolf as following:&lt;BR /&gt;
1|forest|10&lt;BR /&gt;
2|forest|11&lt;BR /&gt;
3|forest|13&lt;BR /&gt;
&lt;BR /&gt;
My SAS version is:9.2</description>
      <pubDate>Mon, 25 Oct 2010 13:20:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-unique-composite-index-in-the-data-step/m-p/22083#M3576</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-10-25T13:20:57Z</dc:date>
    </item>
    <item>
      <title>Re: how to create an unique composite index in the data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-unique-composite-index-in-the-data-step/m-p/22084#M3577</link>
      <description>Suggest you start with the SAS documentation and the SAS support &lt;A href="http://support.sas.com/" target="_blank"&gt;http://support.sas.com/&lt;/A&gt;  website (free) resources.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Suggested Google advanced search argument, this topic / post:&lt;BR /&gt;
&lt;BR /&gt;
data step programming composite index site:sas.com</description>
      <pubDate>Mon, 25 Oct 2010 14:31:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-unique-composite-index-in-the-data-step/m-p/22084#M3577</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2010-10-25T14:31:07Z</dc:date>
    </item>
    <item>
      <title>Re: how to create an unique composite index in the data step?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-unique-composite-index-in-the-data-step/m-p/22085#M3578</link>
      <description>Hello Wolf,&lt;BR /&gt;
&lt;BR /&gt;
If I understood you correctly this could be a possible solution:&lt;BR /&gt;
&lt;BR /&gt;
data work.wolf(/*index=(id name /unique )*/);&lt;BR /&gt;
infile datalines dlm="|"; &lt;BR /&gt;
length id 8. name $10. age 8.;&lt;BR /&gt;
input id name age;&lt;BR /&gt;
datalines;&lt;BR /&gt;
1|forest|10&lt;BR /&gt;
2|forest|11&lt;BR /&gt;
2|forest|12&lt;BR /&gt;
3|forest|13&lt;BR /&gt;
2|forest|14&lt;BR /&gt;
;&lt;BR /&gt;
run;&lt;BR /&gt;
proc sort data=wolf nodupkey;&lt;BR /&gt;
  by id name;&lt;BR /&gt;
run;&lt;BR /&gt;
proc datasets library=work;&lt;BR /&gt;
  modify wolf;&lt;BR /&gt;
  index create idn=(id name);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Sincerely,&lt;BR /&gt;
SPR</description>
      <pubDate>Mon, 25 Oct 2010 14:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-create-an-unique-composite-index-in-the-data-step/m-p/22085#M3578</guid>
      <dc:creator>SPR</dc:creator>
      <dc:date>2010-10-25T14:43:28Z</dc:date>
    </item>
  </channel>
</rss>

