<?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 Index Creation using DATA step in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/INDEX-creation-using-DATA-step/m-p/642561#M191712</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a DATA SET called FR that has variables like: stu_id, name, age, gender. I want to create a simple index on stu_id using DATA step (Yes, we can do the same by PROC SQL or PROC DATASETS but here I want to create using DATA step).&lt;/P&gt;&lt;P&gt;I have written the below program but unable to create index:&lt;/P&gt;&lt;P&gt;DATA FR1 (INDEX=(stu_id=(stu_id)));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET FR;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anybody help me on this?&lt;/P&gt;&lt;P&gt;And also, Is there any way to DELETE the created index by DATA step (I don't want to DELETE using PROC SQL or PROC DATASETS) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;Yadaw&lt;/P&gt;</description>
    <pubDate>Fri, 24 Apr 2020 12:53:05 GMT</pubDate>
    <dc:creator>yadaw</dc:creator>
    <dc:date>2020-04-24T12:53:05Z</dc:date>
    <item>
      <title>INDEX creation using DATA step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INDEX-creation-using-DATA-step/m-p/642564#M191710</link>
      <description>&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a DATA SET called FR that has variables like: stu_id, name, age, gender. I want to create a simple index on stu_id using DATA step (Yes, we can do the same by PROC SQL or PROC DATASETS but here I want to create using DATA step).&lt;/P&gt;&lt;P&gt;I have written the below program but unable to create index:&lt;/P&gt;&lt;P&gt;DATA FR1 (INDEX=(stu_id=(stu_id)));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET FR;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anybody help me on this?&lt;/P&gt;&lt;P&gt;And also, Is there any way to DELETE the created index by DATA step (I don't want to DELETE using PROC SQL or PROC DATASETS) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;Yadaw&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Apr 2020 13:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INDEX-creation-using-DATA-step/m-p/642564#M191710</guid>
      <dc:creator>yadaw</dc:creator>
      <dc:date>2020-04-24T13:01:33Z</dc:date>
    </item>
    <item>
      <title>Index Creation using DATA step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INDEX-creation-using-DATA-step/m-p/642561#M191712</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a DATA SET called FR that has variables like: stu_id, name, age, gender. I want to create a simple index on stu_id using DATA step (Yes, we can do the same by PROC SQL or PROC DATASETS but here I want to create using DATA step).&lt;/P&gt;&lt;P&gt;I have written the below program but unable to create index:&lt;/P&gt;&lt;P&gt;DATA FR1 (INDEX=(stu_id=(stu_id)));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SET FR;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anybody help me on this?&lt;/P&gt;&lt;P&gt;And also, Is there any way to DELETE the created index by DATA step (I don't want to DELETE using PROC SQL or PROC DATASETS) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;Yadaw&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 12:53:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INDEX-creation-using-DATA-step/m-p/642561#M191712</guid>
      <dc:creator>yadaw</dc:creator>
      <dc:date>2020-04-24T12:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: INDEX creation using DATA step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INDEX-creation-using-DATA-step/m-p/642565#M191711</link>
      <description>&lt;P&gt;The tool for creating an index on an existing datset is PROC DATASETS.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 13:06:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INDEX-creation-using-DATA-step/m-p/642565#M191711</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-04-24T13:06:36Z</dc:date>
    </item>
    <item>
      <title>Re: INDEX creation using DATA step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INDEX-creation-using-DATA-step/m-p/642568#M191714</link>
      <description>&lt;P&gt;I could build an index, but don't know how to delete it yet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class(index=(name));
 set sashelp.class;
run;
proc contents data=class;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Composite index.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class(index=(comp=(name age)));
 set sashelp.class;
run;
proc contents data=class;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Apr 2020 13:11:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INDEX-creation-using-DATA-step/m-p/642568#M191714</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-04-24T13:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: INDEX creation using DATA step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INDEX-creation-using-DATA-step/m-p/642575#M191716</link>
      <description>You could just simple copy the table to eliminate the index.&lt;BR /&gt;&lt;BR /&gt;data x;&lt;BR /&gt;set class;&lt;BR /&gt;run;&lt;BR /&gt;proc contents data=x;&lt;BR /&gt;run;</description>
      <pubDate>Fri, 24 Apr 2020 13:21:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INDEX-creation-using-DATA-step/m-p/642575#M191716</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-04-24T13:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: INDEX creation using DATA step</title>
      <link>https://communities.sas.com/t5/SAS-Programming/INDEX-creation-using-DATA-step/m-p/642578#M191717</link>
      <description>&lt;P&gt;A data set index can be created in different ways&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;As specified by an output data set with option INDEX=
&lt;UL&gt;
&lt;LI&gt;Simple indices (single columns) can not be named something else&lt;/LI&gt;
&lt;LI&gt;Compound indices are specified &amp;lt;index-name&amp;gt;=(&amp;lt;column1&amp;gt; ... &amp;lt;column-n&amp;gt;)&lt;/LI&gt;
&lt;/UL&gt;
&lt;/LI&gt;
&lt;LI&gt;PROC DATASETS; MODIFY&lt;/LI&gt;
&lt;LI&gt;PROC SQL; CREATE INDEX&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Index management is done with either DATASETS or SQL.&amp;nbsp; Read the documentation for more information about uniqueness and non-null indices and other data index topics such as integrity constraints and foreign keys.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Examples:&lt;/P&gt;
&lt;PRE&gt;data cars(index=(Make Model type_drive=(Type DriveTrain)));
  set sashelp.cars;
run;

proc datasets nolist lib=work; 
  modify cars;
  index delete Make Model;
  index create Origin;
run;

proc sql;
  create index Make on work.cars;
  drop index type_drive from work.cars;
  create index type_cyl on work.cars(Type, Cylinders) ;&lt;/PRE&gt;
&lt;P&gt;NOTE: SAS data sets do not have RDBMS features such as triggers or sequence numbers.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Apr 2020 13:28:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/INDEX-creation-using-DATA-step/m-p/642578#M191717</guid>
      <dc:creator>RichardDeVen</dc:creator>
      <dc:date>2020-04-24T13:28:47Z</dc:date>
    </item>
  </channel>
</rss>

