How to find if a program or macro is currently being used by other users

Reply
Occasional Contributor
Posts: 11

How to find if a program or macro is currently being used by other users

Hi there,

I would like to know if there is a way to find out if the program or macro is currently used by any other user.

 

For Example:

There is a macro with the name macro1.sas. It is currently opened for edititing in a Sas studio or Sas EG. How to find out that macro1.sas is opened for edititng. Please suggest a programmatic way to do this. I am assuming there might a procedure or macro that helps me achieve this.

 

Thanks for your help!

 

Regards,

Ajay

PROC Star
Posts: 2,319

Re: How to find if a program or macro is currently being used by other users

[ Edited ]
Posted in reply to ajaybetham

EG does not lock program files, so any number of users can open them without anybody knowing. 

Occasional Contributor
Posts: 11

Re: How to find if a program or macro is currently being used by other users

Thanks Chris!

I understand EG doesn't lock. But my requirement is to know if the program is open for editing by any other user. I want to know this programmatically.

 

Thanks Smiley Happy

PROC Star
Posts: 2,319

Re: How to find if a program or macro is currently being used by other users

Posted in reply to ajaybetham

"without anybody knowing" answers your question.

 

Since files are not marked or locked by EG, there is no way.

 

If you want to keep track of versions, this may interest you however:

 

http://support.sas.com/resources/papers/proceedings14/SAS179-2014.pdf

http://www.sascommunity.org/wiki/Version_control

Super User
Posts: 23,346

Re: How to find if a program or macro is currently being used by other users

Posted in reply to ajaybetham

Are you using a version control system where someone has to check out their code to edit it?

Occasional Contributor
Posts: 11

Re: How to find if a program or macro is currently being used by other users

No. I just need to find out if a program is opened by other user in Sas Studio or Sas Eg. I know when you open a program in Sas studio, you can see ~ before the program.
Regular Contributor
Posts: 204

Re: How to find if a program or macro is currently being used by other users

Posted in reply to ajaybetham

ajaybetham wrote:
No. I just need to find out if a program is opened by other user in Sas Studio or Sas Eg. I know when you open a program in Sas studio, you can see ~ before the program.

 

As @ChrisNZ already mentioned: "Since files are not marked or locked by EG, there is no way."

Program-files are simple text files, that can be viewed and edited by any text editor.

 

Please explain why you need to know if a program is opened by other users?

Occasional Contributor
Posts: 11

Re: How to find if a program or macro is currently being used by other users

No, I am not using error control mechanism.

Occasional Contributor
Posts: 11

Re: How to find if a program or macro is currently being used by other users

Posted in reply to ajaybetham
I am not using version* control mechanism.
Super User
Posts: 23,346

Re: How to find if a program or macro is currently being used by other users

Posted in reply to ajaybetham

ajaybetham wrote:
I am not using version* control mechanism.

I think that's your answer though, if you want to know who's using a file and make sure changes are not overwriting each other you should be implementing a version control system. Git interfaces with SAS.

Trusted Advisor
Posts: 1,312

Re: How to find if a program or macro is currently being used by other users

Posted in reply to ajaybetham

You didn't get the answer you want, but you got a correct answer.  How about marking this topic as solved?

Occasional Contributor
Posts: 11

Re: How to find if a program or macro is currently being used by other users

I am surprised to know that there is no way to know the files being edited in Sas.

Trusted Advisor
Posts: 1,312

Re: How to find if a program or macro is currently being used by other users

Posted in reply to ajaybetham

Yes, you may be "surprised to know", but you now do know.   Basically it just says that the task you want is handled by special purpose software (version control) that handles "content management" of all sorts of files, not just sas programs.

 

So how about helping the rest of the community by marking this question as solved?  If, contrary to the responses of very experienced participants in this topic, you learn of a way to solve this entirely within sas, then edit this topic with that solution.

Occasional Contributor
Posts: 11

Re: How to find if a program or macro is currently being used by other users

it is not solved. You can close the thread though.
Ask a Question
Discussion stats
  • 13 replies
  • 356 views
  • 1 like
  • 5 in conversation