BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
nrk1787db1
Obsidian | Level 7

Hi,

 

Getting below warning message while running a PROC APPEND step to append a WORK.DST_A_WRK to PRMLB.DST_A.

 

PROC APPEND BASE = PRMLB.DST_A 
DATA = WORK.DST_A_WRK ;

 

WARNING: Add/Update failed for data set PRMLB.DST_A because data value(s) do not comply with integrity constraint PK_COL1, 999 observations rejected

 

PK_COL1 is a primary constraint defined on managed ID key field COL1 (Numeric) in the table PRMLB.DST_A. First run went fine as it was first time the dataset PRMLB.DST_A getting loaded. Getting above warning message during the second run.

 

DST_A has around 16 variables (COL1 - COL16).

 

Statement used to create integrity constraint is as below

 

CONSTRAINT PK_COL1 PRIMARY KEY (COL1)

 

Dataset WORK.DST_A_WRK used in PROC APPEND has difference in number of observations than PRMLB.DST_A

 

I have gone through link http://support.sas.com/kb/38/162.html but it mentions about order of many integrity constraints causing above warning, in my case I just have one integrity constraint PK_COL1.

 

Could someone please help me with what may be the reasons?

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20

The reason is clear: you are violating the PK by adding those rows.
If the PK is relevant you need to change your update approach. Like decide whether you only wish to add records for new keys, or update rows with a key match.

Data never sleeps

View solution in original post

2 REPLIES 2
Ksharp
Super User

Can you delete that IC ?

 

proc datasets lib=.........

modify DST_A;

ic delete PK_COL1;

quit;

LinusH
Tourmaline | Level 20

The reason is clear: you are violating the PK by adding those rows.
If the PK is relevant you need to change your update approach. Like decide whether you only wish to add records for new keys, or update rows with a key match.

Data never sleeps

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2389 views
  • 1 like
  • 3 in conversation