Error : a lock is not available

Reply
Contributor
Posts: 26

Error : a lock is not available

Hi Guys

Im running a macro (code attached) keep on getting a lock is not availble when the programe is executed.

i have tried inserting : %lock(iDs=sashelp.class) & %unlock(iDs=sashelp.class).

with this it seem ti run then I get statement is invalid.

assiatince would be highlyappreciated.

Attachment
Super User
Super User
Posts: 7,942

Re: Error : a lock is not available

Posted in reply to Allistair

Where does the sashelp.class come into things?  It is not in the code attached, and sashelp is a SAS directory so not something you would process normally.

There are numerous reasons you are get that warning.  What it is telling you is that something is locked, this could be because someone else has the file open, you don't have permissions etc.  I can't tell you what you problem is, what I would suggest you do is to open that code interactively, then run it one step at a time.  Once you identify what step/macro is causing the error, then proceed to investigate that part i.e. if it accesses the DB then check you have permissions, if its accessing a file, ensure you have permission and no-one else is using it etc.

Contributor
Posts: 26

Re: Error : a lock is not available

Hi RW9 thank you for the feedback.

I do have access to the file and no one else is accessing the file other than me that is waht is strange.

I have tried running it step by step it works fine then but I cant be doing this everyday as the data is huge and takes on average 1 day to run.

Super User
Super User
Posts: 7,942

Re: Error : a lock is not available

Posted in reply to Allistair

Where are you getting the warning/error in your log?  Perhaps the size is your problem then.  If you are dealing with a large file is it being closed before some other operation is being done it.  For instance, if I have a large word file open and I close it and run a program immediately then the file is still locked as Word is closing it.  Not sure there is much else I can suggest, I suppose the task executing this daily has the correct permissions?  Also maybe check that at the time it is being run all the things are available, e.g. no other processes interfere.

Ask a Question
Discussion stats
  • 3 replies
  • 352 views
  • 0 likes
  • 2 in conversation