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 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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