<?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: bypass foreign key in proc step sas in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/bypass-foreign-key-in-proc-step-sas/m-p/485683#M126219</link>
    <description>&lt;P&gt;Your data has to meet the integrity constraints defined for that table. Consult your DBA people, they should be able to help you make your data compatible.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Aug 2018 08:07:13 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2018-08-10T08:07:13Z</dc:date>
    <item>
      <title>bypass foreign key in proc step sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bypass-foreign-key-in-proc-step-sas/m-p/485671#M126208</link>
      <description>&lt;DIV class="trans-verified-button-small"&gt;&lt;SPAN&gt;It is possible to skip foreign keys when requesting.&lt;BR /&gt;There is a table in which you want to write data. This table has a primary and foreign keys. The table entry is made from a temporary table. but an error occurs because there are no foreign keys in the temporary table. How can I solve this problem?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV class="clear-button goog-toolbar-button"&gt;&amp;nbsp;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  CREATE TABLE "MAIN"."TABLE_FOR_TEST2" 
   (	"ONE" VARCHAR2(20 BYTE), 
	"TWO" VARCHAR2(20 BYTE), 
	 CONSTRAINT "PRIMARY" PRIMARY KEY ("TWO")
  USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS 
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "U"  ENABLE
   ) SEGMENT CREATION IMMEDIATE 
  PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 
 NOCOMPRESS LOGGING
  STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
  PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
  BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
  TABLESPACE "U" ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro test;
%macro dummy; %mend dummy;
data test(keep=ONE TWO);
		length ONE $20 TWO $20;
		ONE="wdq";
		TWO="dadf";
run;


proc sql noprint;
							create table test2(ONE char(20), TWO char(20), constraint prim primary key(TWO)); 							insert into test2 select * from test;
quit;

proc append base MAIN.TABLE_FOR_TEST2  data=test2 nowarn force ; quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 Aug 2018 06:52:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bypass-foreign-key-in-proc-step-sas/m-p/485671#M126208</guid>
      <dc:creator>Liliya95</dc:creator>
      <dc:date>2018-08-10T06:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: bypass foreign key in proc step sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bypass-foreign-key-in-proc-step-sas/m-p/485672#M126209</link>
      <description>&lt;P&gt;Why do you need foreign keys? It would be better to upload your SAS data to a staging table in the database first which doesn't have constraints or indexes. Then load from the staging table using passthru SQL designed to handle constraints.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 07:06:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bypass-foreign-key-in-proc-step-sas/m-p/485672#M126209</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2018-08-10T07:06:35Z</dc:date>
    </item>
    <item>
      <title>Re: bypass foreign key in proc step sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bypass-foreign-key-in-proc-step-sas/m-p/485673#M126210</link>
      <description>Not sure if I follow you here.&lt;BR /&gt;FK in a target tables doesn't relate to keys in a source table. It relates to a PK in another (hopefully) permanent table.</description>
      <pubDate>Fri, 10 Aug 2018 07:08:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bypass-foreign-key-in-proc-step-sas/m-p/485673#M126210</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2018-08-10T07:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: bypass foreign key in proc step sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bypass-foreign-key-in-proc-step-sas/m-p/485674#M126211</link>
      <description>&lt;P&gt;When a target table has constraints set, new data added to the table has to meet those constraints. That is the purpose of constraints and integrity rules.&lt;/P&gt;
&lt;P&gt;I have never seen the necessity to have integrity rules on data warehouse tables. In fact, they would only get in the way.&lt;/P&gt;
&lt;P&gt;If this is not a production database table, have the constraints/IR removed. Otherwise you have to prepare your data so that it meets the IR&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 07:09:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bypass-foreign-key-in-proc-step-sas/m-p/485674#M126211</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-10T07:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: bypass foreign key in proc step sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bypass-foreign-key-in-proc-step-sas/m-p/485681#M126217</link>
      <description>Foreign key is specified in the table when it is created. and I can not delete it. but the data in the table must be written. I try use insert, but have error</description>
      <pubDate>Fri, 10 Aug 2018 07:57:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bypass-foreign-key-in-proc-step-sas/m-p/485681#M126217</guid>
      <dc:creator>Liliya95</dc:creator>
      <dc:date>2018-08-10T07:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: bypass foreign key in proc step sas</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bypass-foreign-key-in-proc-step-sas/m-p/485683#M126219</link>
      <description>&lt;P&gt;Your data has to meet the integrity constraints defined for that table. Consult your DBA people, they should be able to help you make your data compatible.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 08:07:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bypass-foreign-key-in-proc-step-sas/m-p/485683#M126219</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-08-10T08:07:13Z</dc:date>
    </item>
  </channel>
</rss>

