Desktop productivity for business analysts and programmers

Libname Locking File

Accepted Solution Solved
Reply
Contributor
Posts: 30
Accepted Solution

Libname Locking File

Is it possible to write a LIBNAME statement for an excel file in EG without locking it?  i just want to read in contents of the excel file; not lock it for read/write purpose. 

Proc Import is no longer an option as my environment is migrating from Windows to Linus.  I've read several posts about LibName locking files excel files, but i had not seen anyone ask if there was a option in the Libname statement to prevent the lock in the first place.

 


Accepted Solutions
Solution
‎01-17-2018 02:45 PM
Super User
Posts: 10,592

Re: Libname Locking File

Posted in reply to utrocketengineer

Do

libname xxxxx clear;

immediately after reading your Excel data.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code

View solution in original post


All Replies
Solution
‎01-17-2018 02:45 PM
Super User
Posts: 10,592

Re: Libname Locking File

Posted in reply to utrocketengineer

Do

libname xxxxx clear;

immediately after reading your Excel data.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 30

Re: Libname Locking File

Posted in reply to KurtBremser

that currently is my plan...  thank you for the confirmation!

Super User
Posts: 24,025

Re: Libname Locking File

Posted in reply to utrocketengineer

You can also check the ACCESS=READONLY option:

 

libname census xlsx "path to file" access=readonly;
Contributor
Posts: 30

Re: Libname Locking File

Posted in reply to utrocketengineer
I will try that tomorrow. Thank you.
Contributor
Posts: 30

Re: Libname Locking File

Posted in reply to utrocketengineer

Reeza, i tried the 'access=readonly'; and the excel file was still locked.  i really do not care for excel.  :/

 

thank you again for the feedback!

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 279 views
  • 0 likes
  • 3 in conversation