04-03-2018 10:31 AM
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.
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.
04-03-2018 10:55 AM
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.
04-03-2018 10:56 AM
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.