BookmarkSubscribeRSS Feed
David_Fuertes
Calcite | Level 5

Good Morning.

We are having a problem that occurs punctually when performing an insert in SAS tables. Next I show you the log that shows the output.

 

36276  proc sql;
36277  insert into Tempmi.Mi_grupos (entity, id_tipo,id_criterio_asignacion, id_grupo, desc_grupo, usucrea, fecdesde,tipo_grupo)
36277! values (49,2,1,13905,'XXXXXXXX','AAAAAAA',1835946673.608,'G');
ERROR: Unexpected ERROR from SHRWTSK20 detected by TERMINATE WORK TASK in "SQL"(906):  ERROR: Generic critical error.
ERROR: PROC SQL could not undo this statement if an ERROR were to happen as it could not obtain exclusive access to the data set.
       This statement will not execute as the SQL option UNDO_POLICY=REQUIRED is in effect.
36278  quit;
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.07 seconds
      cpu time            0.00 seconds

 

This occurs on time and do not know why it should, the library is assigned and mapped to the share but the service is up and running. As you can see, it is a normal insert and the access to the table at that moment is unique due to the action of the described insert.

You can guide us or give some solution to avoid this type of error since the insert of the data is not produced and we lose trace of the records.

3 REPLIES 3
victorhugorodmo
Calcite | Level 5

Hi,

 

As per your log states, please check the Undo_Policy Option which specifies whether the SQL procedure keeps or discards updated data if errors occur while the data is being updated.

 

Regards.

 

Victor.

David_Fuertes
Calcite | Level 5

I changed the options to verify that.

options SQLUNDOPOLICY= NONE;

ballardw
Super User

It sounds like this is attempting to modify a table in an external database (guessing because of the reference to SHRWTSK20 looks like a server or connection of some sort and way the first error is phrased) and someone else or another process is using the target table in such a manner that your process cannot gain appropriate access ("obtain exclusive access").

 

As such it is not a code error so much as a timing or process scheduling issue.

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!

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
  • 3 replies
  • 716 views
  • 0 likes
  • 3 in conversation