BookmarkSubscribeRSS Feed
BETO
Fluorite | Level 6

HI Ive a

proc append  base= myaccdb.table data=work.report4 force;

run;

i need to. Know how I can bypass the primary key that is in access when the primary key is removed it appends but I need the primary key to be there  to prevent duplicates..

5 REPLIES 5
ballardw
Super User

You might want to provide a few more details about what you mean by "bypass primary key".

BETO
Fluorite | Level 6

the proc append works great where it's appending data to the access table when the access table doesn't have a primary key. When I add the primary key to the access table and than run the proc append it fails I get and error message it can't insert data ... Im using force in the proc append but it doesn't append if there is a primary key...thanks again for your assistance

LinusH
Tourmaline | Level 20

Supplying the log would help. The cause of the error is usually written there.

But from the information that you give, I suppose that you are violating the PK during insert?

If so, you need to take action, primarily by fixing your data before the insert.

Data never sleeps
ballardw
Super User

By any chance is the Primary Key field in Access and automatic increment and the SAS data set you are appending have values for that field? You might be getting a collision of some sort.

Ksharp
Super User

Make a audit trace for Prime Key .

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 5 replies
  • 1164 views
  • 0 likes
  • 4 in conversation