<?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 primary key explanation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/primary-key-explanation/m-p/352272#M82085</link>
    <description>&lt;P&gt;Can anyone explain this with example?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting an error when defining composite primary key through proc sql&amp;nbsp;create table statement. Always a problem with syntax but I cannot figure out what is the problem..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PRIMARY KEY (&lt;SPAN class="xis-userSuppliedValue"&gt;column-1&lt;/SPAN&gt; &lt;SPAN class="xis-argOption"&gt;&amp;lt;, &lt;SPAN class="xis-userSuppliedValue"&gt;column-2&lt;/SPAN&gt;, &lt;SPAN class="xis-symbolHEllipsis"&gt;...&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;DIV class="xis-argumentDescription"&gt;&lt;P class="xis-paraSimpleFirst"&gt;specifies one or more primary key columns, that is, columns that do not contain missing values and whose values are unique.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Restriction&lt;/TD&gt;&lt;TD&gt;When you are defining overlapping primary key and foreign key constraints, the variables in a data file are part of both a primary key and a foreign key definition. If you use the exact same variables, then the variables must be defined in a different order.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;</description>
    <pubDate>Fri, 21 Apr 2017 18:07:15 GMT</pubDate>
    <dc:creator>swar</dc:creator>
    <dc:date>2017-04-21T18:07:15Z</dc:date>
    <item>
      <title>primary key explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/primary-key-explanation/m-p/352272#M82085</link>
      <description>&lt;P&gt;Can anyone explain this with example?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting an error when defining composite primary key through proc sql&amp;nbsp;create table statement. Always a problem with syntax but I cannot figure out what is the problem..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PRIMARY KEY (&lt;SPAN class="xis-userSuppliedValue"&gt;column-1&lt;/SPAN&gt; &lt;SPAN class="xis-argOption"&gt;&amp;lt;, &lt;SPAN class="xis-userSuppliedValue"&gt;column-2&lt;/SPAN&gt;, &lt;SPAN class="xis-symbolHEllipsis"&gt;...&lt;/SPAN&gt;&amp;gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;DIV class="xis-argumentDescription"&gt;&lt;P class="xis-paraSimpleFirst"&gt;specifies one or more primary key columns, that is, columns that do not contain missing values and whose values are unique.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Restriction&lt;/TD&gt;&lt;TD&gt;When you are defining overlapping primary key and foreign key constraints, the variables in a data file are part of both a primary key and a foreign key definition. If you use the exact same variables, then the variables must be defined in a different order.&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 21 Apr 2017 18:07:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/primary-key-explanation/m-p/352272#M82085</guid>
      <dc:creator>swar</dc:creator>
      <dc:date>2017-04-21T18:07:15Z</dc:date>
    </item>
    <item>
      <title>Re: primary key explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/primary-key-explanation/m-p/352276#M82086</link>
      <description>&lt;P&gt;The code you're using and log with errors would be helpful here.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 18:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/primary-key-explanation/m-p/352276#M82086</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-21T18:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: primary key explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/primary-key-explanation/m-p/352282#M82089</link>
      <description>After creating your table, execute this step:&lt;BR /&gt;&lt;BR /&gt;PROC SQL;&lt;BR /&gt;ALTER TABLE MANUFACTURERS&lt;BR /&gt;ADD CONSTRAINT PRIM_KEY PRIMARY KEY (MANUNUM);&lt;BR /&gt;QUIT;</description>
      <pubDate>Fri, 21 Apr 2017 18:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/primary-key-explanation/m-p/352282#M82089</guid>
      <dc:creator>thomp7050</dc:creator>
      <dc:date>2017-04-21T18:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: primary key explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/primary-key-explanation/m-p/352334#M82111</link>
      <description>&lt;P&gt;This is the code I am executing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The primary key should have claim_id,patient_id,Seq_no) but it is not executing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;109 proc sql;&lt;/P&gt;&lt;P&gt;110 create table swar_am.diagnosis&lt;/P&gt;&lt;P&gt;111 (Claim_id char(6) references 'claims',&lt;/P&gt;&lt;P&gt;112 Patient_id char(6) references 'patient',&lt;/P&gt;&lt;P&gt;113 Seq_no char(6),&lt;/P&gt;&lt;P&gt;114 code_set char(50),&lt;/P&gt;&lt;P&gt;115 code char(20),&lt;/P&gt;&lt;P&gt;116 primary key(Seq_no,Claim_id,Patient_id);&lt;/P&gt;&lt;P&gt;---&lt;/P&gt;&lt;P&gt;22&lt;/P&gt;&lt;P&gt;76&lt;/P&gt;&lt;P&gt;ERROR 22-322: Syntax error, expecting one of the following: CHAR, CHARACTER, DATE, DEC, DECIMAL,&lt;/P&gt;&lt;P&gt;DOUBLE, FLOAT, INT, INTEGER, NUM, NUMERIC, REAL, SMALLINT, VARCHAR.&lt;/P&gt;&lt;P&gt;ERROR 76-322: Syntax error, statement will be ignored.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 21:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/primary-key-explanation/m-p/352334#M82111</guid>
      <dc:creator>swar</dc:creator>
      <dc:date>2017-04-21T21:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: primary key explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/primary-key-explanation/m-p/352337#M82113</link>
      <description>&lt;P&gt;This is another error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;142 proc sql;&lt;/P&gt;&lt;P&gt;143 create table swar_am.claims&lt;/P&gt;&lt;P&gt;144 (Patient_id char(6) references 'patient',&lt;/P&gt;&lt;P&gt;145 Claim_id char(6) ,&lt;/P&gt;&lt;P&gt;146 claim_type char(10),&lt;/P&gt;&lt;P&gt;147 dt_admission num format = mmddyy10.,&lt;/P&gt;&lt;P&gt;148 dt_discharge num format = mmddyy10.,&lt;/P&gt;&lt;P&gt;149 dt_service num format = mmddyy10.,&lt;/P&gt;&lt;P&gt;150 val_pmt_total num format= Dollar6.3)&lt;/P&gt;&lt;P&gt;151 ;&lt;/P&gt;&lt;P&gt;ERROR: Creation of integrity constraint _FK0001_ failed because half of the referential integrity&lt;/P&gt;&lt;P&gt;constraint would reside within a temporary library. WORK is a temporary library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here claim_id and patient_id should be primary key..&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 21:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/primary-key-explanation/m-p/352337#M82113</guid>
      <dc:creator>swar</dc:creator>
      <dc:date>2017-04-21T21:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: primary key explanation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/primary-key-explanation/m-p/352389#M82129</link>
      <description>&lt;P&gt;Thank you. it worked&lt;/P&gt;</description>
      <pubDate>Sat, 22 Apr 2017 03:50:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/primary-key-explanation/m-p/352389#M82129</guid>
      <dc:creator>swar</dc:creator>
      <dc:date>2017-04-22T03:50:24Z</dc:date>
    </item>
  </channel>
</rss>

