<?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: Extract PK from Phys. table, load it to new table. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Extract-PK-from-Phys-table-load-it-to-new-table/m-p/163803#M42479</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaap,&lt;/P&gt;&lt;P&gt;Thanks, it actually what was needed.&lt;/P&gt;&lt;P&gt;I thought contents procedure should also have that output table, but looks like datasets procedure is more useful for that case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Sep 2014 10:10:24 GMT</pubDate>
    <dc:creator>Yura2301</dc:creator>
    <dc:date>2014-09-29T10:10:24Z</dc:date>
    <item>
      <title>Extract PK from Phys. table, load it to new table.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-PK-from-Phys-table-load-it-to-new-table/m-p/163799#M42475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi ,&lt;/P&gt;&lt;P&gt;Stuck on simple task -just write columns belongs to tables PK to separate phisical(not metadata) table.&lt;/P&gt;&lt;P&gt;I tried a few codes but always got same error, f.e.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;ods&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;_all_&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;close&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;ods&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;&amp;nbsp; IntegrityConstraints=outputPK;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;contents&lt;/STRONG&gt;&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;data&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;=&amp;amp;tableName ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: navy; font-size: 11pt; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;ods&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;output&lt;/SPAN&gt; &lt;SPAN style="font-family: 'Courier New'; background: white; color: blue; font-size: 11pt;"&gt;close&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; background: white; color: black; font-size: 11pt;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Waring put's to the log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008080; font-size: 12pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;WARNING: Output 'IntegrityConstraints' was not created. Make sure that the output object name, label, or path is spelled &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;correctly. Also, verify that the appropriate procedure options are used to produce the requested output object. For &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #008000;"&gt;example, verify that the NOPRINT option is not used.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But "IntegrityConstraints" should be right name for output table:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/viewer.htm#a002649072.htm"&gt;http://support.sas.com/documentation/cdl/en/odsug/61723/HTML/default/viewer.htm#a002649072.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Same results when I used "describe table constraints" to get PK.&lt;/P&gt;&lt;P&gt;When I used "Attributes" instead of "IntegrityConstraints" - code worked ok&amp;nbsp; and output table,as expected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If there is more clever approach to get PK from physical table - please share, the code should work as quick as possible and return only list of PK columns.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 09:18:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-PK-from-Phys-table-load-it-to-new-table/m-p/163799#M42475</guid>
      <dc:creator>Yura2301</dc:creator>
      <dc:date>2014-09-29T09:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extract PK from Phys. table, load it to new table.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-PK-from-Phys-table-load-it-to-new-table/m-p/163800#M42476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Well, that link isn't working in my Internet Explorer (no suprises there).&amp;nbsp; I would suggest that you put before your procedure:&lt;/P&gt;&lt;P&gt;ods trace on;&lt;/P&gt;&lt;P&gt;This will output to the log all selectable tables that the procedure creates when it runs.&amp;nbsp; I have done this on 9.3 and see only EngineHost, Varibles, SortedBy as selectable tables from that procedure, hence you get an Error saying IntegrityConstraints not created.&amp;nbsp; I don't know where you go the ide from?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 09:34:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-PK-from-Phys-table-load-it-to-new-table/m-p/163800#M42476</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-09-29T09:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extract PK from Phys. table, load it to new table.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-PK-from-Phys-table-load-it-to-new-table/m-p/163801#M42477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Strange that you can't open the link, anyway it's just list of ods output tables,topic name&amp;nbsp; &lt;STRONG&gt;"ODS Output Object Table Names".&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Thanks for the tip with trace on, it shows that there are really no table with PK, only with indexes , attributes.&lt;/P&gt;&lt;P&gt;I'm need to run code on SAS 9.1 under Windows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can use describe table write log to external file and then parse it to get PK columns, but it's not the best solution for sure.&lt;/P&gt;&lt;P&gt;Looks like&amp;nbsp; I can get PK cols from ods indexes table, filter by Unique Index.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 09:51:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-PK-from-Phys-table-load-it-to-new-table/m-p/163801#M42477</guid>
      <dc:creator>Yura2301</dc:creator>
      <dc:date>2014-09-29T09:51:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extract PK from Phys. table, load it to new table.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-PK-from-Phys-table-load-it-to-new-table/m-p/163802#M42478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;why not use the proc datasets with contents out= out2= ?&amp;nbsp; It is a direct way to put that info in a dataset.&lt;BR /&gt;It could be there are no constraints. In that case to ODS table is not created (nothing to print). Why doing difficult as it can be done easy.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 09:52:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-PK-from-Phys-table-load-it-to-new-table/m-p/163802#M42478</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-09-29T09:52:43Z</dc:date>
    </item>
    <item>
      <title>Re: Extract PK from Phys. table, load it to new table.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Extract-PK-from-Phys-table-load-it-to-new-table/m-p/163803#M42479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jaap,&lt;/P&gt;&lt;P&gt;Thanks, it actually what was needed.&lt;/P&gt;&lt;P&gt;I thought contents procedure should also have that output table, but looks like datasets procedure is more useful for that case.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 10:10:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Extract-PK-from-Phys-table-load-it-to-new-table/m-p/163803#M42479</guid>
      <dc:creator>Yura2301</dc:creator>
      <dc:date>2014-09-29T10:10:24Z</dc:date>
    </item>
  </channel>
</rss>

