BookmarkSubscribeRSS Feed
gabriel_k
Obsidian | Level 7

Hello,

 

working on an application in Excel that generates charts and tables from the tables previously analysed by SAS. I use VBA (Windows client and IOM Bridge connection) to run SAS stored macro and then getting results with ADODB. Once running the code SAS tables are locked even if the Workspace was closed and i'm getting  "lock is not available" error. How can i solve this problem ? (basicly i need to unlock the tables just to delete them).

3 REPLIES 3
Kurt_Bremser
Super User

I guess you meant "stored process".

Do you really need to update persistent files from the stored process?

Or do you simply create tables for transfer to Excel in a location other than WORK? In which case, I'd move that to WORK to avoid unnecessary collisions.

gabriel_k
Obsidian | Level 7

I use stored compiled macros:

http://support.sas.com/documentation/cdl/en/mcrolref/61885/HTML/default/viewer.htm#a001328775.htm

 

But You have a reason, i'll store my tables in Work library, i just wanted to have a possibility to look on tables thrue the SAS Guide.

 

There are some other tables i use to retrieve information from different libraries and change rows if needed, so i need to drop the lock anyway. 

 

Kurt_Bremser
Super User

@gabriel_k wrote:
..... i just wanted to have a possibility to look on tables thrue the SAS Guide.

 

 


This is probably the source of your problems. Viewing a dataset through EG will always prevent the lock that is needed for update.

 

If you just need to update specific parts of datasets, SAS/SHARE might help (if you have it licensed and set up).

 

My method to prevent ERRORs caused by open datasets is specific to UNIX. To update a dataset, I do the update in WORK, then I use the operating system to remove the link (directory entry) to the file (UNIX rm command), and then recreate the dataset from the table in WORK.

This is possible because the rm removes the reference, but not the file. Only when a file is found to have no further reference defined, the physical data is removed once the last handle closes.

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!

Discussion stats
  • 3 replies
  • 1109 views
  • 0 likes
  • 2 in conversation