BookmarkSubscribeRSS Feed
twildone
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.

7 REPLIES 7
SASKiwi
PROC Star

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.

twildone
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.POSTALCODESCORRECTIONS (memtype=DATA).
NOTE: Deleting WORK.ADDRESSLIST (memtype=DATA).
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.COREQUISITE (memtype=DATA).
NOTE: Deleting WORK.ADDRESSLIST9 (memtype=DATA).
NOTE: Deleting WORK.ADDRESSLIST10 (memtype=DATA).
ERROR: A lock is not available for WORK.ADDRESSLIST10.DATA.
Patrick
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".

Patrick_0-1693873144113.png

 

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.

twildone
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

 

 

twildone_0-1693920336096.png

 

Patrick
Opal | Level 21

I certainly would reduce the time for:

Patrick_0-1693957625345.png

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.

Patrick_1-1693958031924.png

 

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.

 

 

twildone
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.

SASKiwi
PROC Star

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.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 7 replies
  • 4240 views
  • 2 likes
  • 3 in conversation