BookmarkSubscribeRSS Feed
ajaybetham
Calcite | Level 5

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

13 REPLIES 13
ChrisNZ
Tourmaline | Level 20

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

ajaybetham
Calcite | Level 5

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 🙂

ChrisNZ
Tourmaline | Level 20

"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

Reeza
Super User

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

ajaybetham
Calcite | Level 5
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.
error_prone
Barite | Level 11

@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?

ajaybetham
Calcite | Level 5

No, I am not using error control mechanism.

ajaybetham
Calcite | Level 5
I am not using version* control mechanism.
Reeza
Super User

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

mkeintz
PROC Star

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

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
ajaybetham
Calcite | Level 5

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

mkeintz
PROC Star

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.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
ajaybetham
Calcite | Level 5
it is not solved. You can close the thread though.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 13 replies
  • 819 views
  • 1 like
  • 5 in conversation