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?
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.
Can you delete that IC ?
proc datasets lib=.........
modify DST_A;
ic delete PK_COL1;
quit;
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.