DATA Step, Macro, Functions and more

ERROR: Unexpected ERROR from SHRWTSK22 detected by TERMINATE WORK TASK in "SQL"(440)

Reply
New Contributor
Posts: 2

ERROR: Unexpected ERROR from SHRWTSK22 detected by TERMINATE WORK TASK in "SQL"(440)

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.

Frequent Learner
Posts: 1

Re: ERROR: Unexpected ERROR from SHRWTSK22 detected by TERMINATE WORK TASK in "SQL"(440)

Posted in reply to David_Fuertes

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.

New Contributor
Posts: 2

Re: ERROR: Unexpected ERROR from SHRWTSK22 detected by TERMINATE WORK TASK in "SQL"(440)

Posted in reply to victorhugorodmo

I changed the options to verify that.

options SQLUNDOPOLICY= NONE;

Super User
Posts: 13,046

Re: ERROR: Unexpected ERROR from SHRWTSK22 detected by TERMINATE WORK TASK in "SQL"(440)

Posted in reply to David_Fuertes

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.

Ask a Question
Discussion stats
  • 3 replies
  • 63 views
  • 0 likes
  • 3 in conversation