Usage Note 38162: Misleading integrity constraint warning message with PROC APPEND
The following warning message might be generated by PROC APPEND during a check to see whether an observation adheres to the PRIMARY KEY condition:
WARNING: Add/Update failed for data set WORK.CLASS_BASE because data value(s)
do not comply with integrity constraint _PK0001_, 18 observations rejected.
This warning is generated in error. This warning message can mislead customers about which constraint is truly failing. There are no issues surrounding data integrity; the data is correct.
The code below will generate the warning message. However, if the integrity constraints are in the reverse order, the message will not be generated.
data class_base class_data;
length name $32;
set sashelp.class;
run;
data class_data;
set class_data;
name = "Alternative " || name;
height = .;
run;
proc datasets library=work nolist;
modify class_base;
ic create primary key (name age); /*By placing the not null in the first position*/
ic create not null (height); /*the error will not be generated*/
run;
quit;
proc print data=work.class_base;
run;
proc print data=work.class_data;
run;
proc append base=class_base data=class_data;
run;
Operating System and Release Information
SAS System | Base SAS | Linux for x64 | | |
Linux | | |
IRIX | | |
HP-UX | | |
HP-UX IPF | | |
AIX | | |
ABI+ for Intel Architecture | | |
64-bit Enabled Solaris | | |
64-bit Enabled HP-UX | | |
64-bit Enabled AIX | | |
Windows Vista | | |
Windows Millennium Edition (Me) | | |
Microsoft Windows XP Professional | | |
Microsoft Windows Server 2008 | | |
Microsoft Windows Server 2003 Standard Edition | | |
Microsoft Windows Server 2003 Enterprise Edition | | |
Microsoft Windows Server 2003 Datacenter Edition | | |
Microsoft Windows NT Workstation | | |
Microsoft Windows 2000 Professional | | |
Microsoft Windows 2000 Server | | |
Microsoft Windows 2000 Datacenter Server | | |
Microsoft Windows 2000 Advanced Server | | |
Microsoft Windows 95/98 | | |
Microsoft Windows 7 | | |
OS/2 | | |
Microsoft® Windows® for x64 | | |
Microsoft Windows XP 64-bit Edition | | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | | |
OpenVMS VAX | | |
z/OS | | |
Linux on Itanium | | |
OpenVMS Alpha | | |
OpenVMS on HP Integrity | | |
Solaris | | |
Solaris for x64 | | |
Tru64 UNIX | | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
A misleading integrity constraint warning message is generated when using PROC APPEND to append data.
Date Modified: | 2010-03-30 15:11:14 |
Date Created: | 2009-12-15 14:59:54 |