BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Patrick
Opal | Level 21

Hi all,

Is there any SAS option I could change so that a unique index constraint violation leads to an Error instead of a Warning?

data target(index=(name /unique)) Change;
  set sashelp.class;
  output target;
  if _n_=5 then name='Neo' ;
  output Change; 
run;

proc append base=target data=change;
run;

Patrick_0-1668684393281.png

 

In an ideal world SAS would roll-back the insert - but I can understand that I'm not dealing with a database and why that's not possible and it's also not a real issue for my actual use case.

....but I'd really love if SAS would throw an Error and stop further processing instead of me having to check explicitly for a Warning and then issue an abort.

1 ACCEPTED SOLUTION

Accepted Solutions
Patrick
Opal | Level 21

Given that no one answered assumed that I didn't miss something and there isn't a SAS option/configuration that would allow me to instruct SAS to throw an error instead of a warning.

 

Going to mark my own answer as solution in order to close this track.

View solution in original post

2 REPLIES 2
Patrick
Opal | Level 21

Given that no one answered assumed that I didn't miss something and there isn't a SAS option/configuration that would allow me to instruct SAS to throw an error instead of a warning.

 

Going to mark my own answer as solution in order to close this track.

PeterClemmensen
Tourmaline | Level 20

I browsed The Complete Guide to SAS Indexes by Michael A. Raithel and did not find such an option either. 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 494 views
  • 0 likes
  • 2 in conversation