BookmarkSubscribeRSS Feed
Pyrite | Level 9

Hi.....I am getting this error message: ERROR: A lock is not available for WORK.ListA. I have tried rebooting and sometimes its a different dataset that the error message pops up. I ran this same code before and never received this error message. Is this something that is on the SAS end or the Server where the datasets are stored. Thanks.

Opal | Level 21

This error is typically caused by another SAS tool or process having the SAS dataset open. Do you by any chance have this table open in a view-type window in SAS EG, SAS Studio or SAS Windowing System. If so you need to close it.

Pyrite | Level 9

Hi SASKiwi.....I run the code in SAS Enterprise and have been running the same code many times before. When I reboot it seems that dataset where a lock is not available for WORK changes. From the log, this error occurs during the process of deleting the datasets.  Thanks

2748       proc datasets nolist;
2749       	delete PostalCodesCorrections AddressList AddressList1 AddressList2 AddressList3 AddressList4 AddressList5 AddressList6
2749     ! AddressList7 AddressList8 CoRequisite AddressList9 AddressList10 ;

NOTE: Deleting WORK.ADDRESSLIST1 (memtype=DATA).
NOTE: Deleting WORK.ADDRESSLIST2 (memtype=DATA).
NOTE: Deleting WORK.ADDRESSLIST3 (memtype=DATA).
NOTE: Deleting WORK.ADDRESSLIST4 (memtype=DATA).
NOTE: Deleting WORK.ADDRESSLIST5 (memtype=DATA).
NOTE: Deleting WORK.ADDRESSLIST6 (memtype=DATA).
NOTE: Deleting WORK.ADDRESSLIST7 (memtype=DATA).
NOTE: Deleting WORK.ADDRESSLIST8 (memtype=DATA).
NOTE: Deleting WORK.ADDRESSLIST9 (memtype=DATA).
NOTE: Deleting WORK.ADDRESSLIST10 (memtype=DATA).
ERROR: A lock is not available for WORK.ADDRESSLIST10.DATA.
Opal | Level 21

The locking issue normally occurs if another SAS session locks the table or - depending on your settings - if it's open in your client (like in EG). 

If you're using SAS EG make sure to have setting "Unlock all open data before running code".



Because this is a WORK table it can't be another SAS session that locks the table. If the issue still exists even with the option set to unlock all data then the only other reason I can think of is some virus scanner or backup process that gets in the way. 


Let us know if the unlock option helps or not and we continue from there.

Pyrite | Level 9

Hi Patrick....The version of Enterprise Guide I have is 7.1 . I don't have "Unlock all open data before running code" as an option. Thanks





Opal | Level 21

I certainly would reduce the time for:


Is there any option in EG7.1 to automatically open (or not open) tables created by a run? If so make sure you don't automatically open such tables.

No more sure how this looks in EG7.1 but here from EG8: Make sure to not set the default to Table.



The usual question for "it used to work but doesn't anymore" issues is: What changed?

If it's not some EG setting then the most likely culprit in my experience is a virus scanner that doesn't exclude *.sas7b* files. I suggest you contact your SAS Admin and raise this issue. If it's a virus scanner then other people/processes should also have such intermittent problems.



Pyrite | Level 9

Hi Patrick.....I agree something has changes....I reached out to the IT department as more than likely they updated the system.

Opal | Level 21

I'd suggest talking to your SAS administrator. Are you the only user impacted by this problem or are other users as well? The fact that it is an intermittent problem and it is a different dataset each time could point to SAS server IO problems. Your administrator should be able to investigate this.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 3 in conversation