BookmarkSubscribeRSS Feed
Haris
Lapis Lazuli | Level 10

I was surprised to learn that SAS syntax files when opened for editing are not locked!  If I open a syntax file for editing and my colleague opens the same file, we can both be saving changes to the same physical *.sas file overwriting each other's work and without any warning of the fact that this is happening.

There is a LOCK command and statement for datasets but I can't find anything for SAS syntax.  Setting file properties to read-only outside of SAS helps but one needs to remove that restriction to save one's work and, once open, the file can be overwritten by anyone else.

Is there a way to lock a syntax file for editing for the duration that it is open in SAS or Enterprise Guide?

What solutions do people on this list practice to prevent simultaneous editing when not in a SAS Server environment?

Thanks,

Haris

6 REPLIES 6
SASKiwi
PROC Star

You are correct. SAS uses the operating system's control of files when editing SAS programs. If the OS allows it, then that is the behaviour.

The best way to avoid this problem is to use a change management tool with your SAS programs, plus you get the added benefits of program versioning, team collaboration, automated code deployment etc. Examples of CM tools are GIT, Visual Studio/TFS. There are many others. 

MikA
Obsidian | Level 7
I have serious trouble regarding this question as well and we're considering trying out one of the solutions mentioned. Any recommendations - easy to use - CM tools? Any of them are free? Any links? Thanks 🙂
Patrick
Opal | Level 21

CVS and SVN are the two version controls which have also OOTB integration into SAS DI Studio. GITHUB is likely the one going forward though and also used by SAS, for example here: https://github.com/sassoftware

 

...and I personally take an approach that version control is a good thing but also adds overhead AND it's no replacement for having clean and enforced development processes in place.  

SASKiwi
PROC Star

I suggest you check out what CM tool(s) your company is already using. We use our company's standard tool (MVS/TFS) and it actually saves us a heap of time because all CM admin is taken care of.

 

Also using the tool is more efficient and quicker than not using it simply because storing and management of SAS program files is automated. 

Patrick
Opal | Level 21

@SASKiwi

I would be really interested to learn more in detail how and for what SAS objects you're using version control in your company, how this supports your processes, how much it takes to set this up and get up to speed, etc. etc.

 

I know that's asking for a lot from you. May be it's worth a paper for Global Forum?

 

I've been in multiple projects where version control was initially requested but it took always so much to get this properly set-up that the project was almost done before version control was really fully establishe.

SASKiwi
PROC Star

@Patrick Thanks for the kind words. Doing a paper at Global Forum on this is probably a bit of a stretch. I've never actually been to one given it is about half a planet away from where I live. Would be nice to do though. I'll give it some thought as a Community Article for now.

 

I'm lucky to work at a company where a corporate-wide solution for version control / change management is freely available to everyone and I'm a complete convert. The prevailing attitude by many is that it is a necessary evil that adds way too much extra work. In my experience the opposite is true. It saves us time by not having to manually manage application artifacts. We never lose our code because even if we delete something it will still be there in an old version. I'm also frequently comparing versions to confirm what changes I've made. It has become an essential part of our testing processes.

 

Truly version control makes us more productive (not an oxymoron). For example I can double click on any SAS program stored under VC and it automatically opens in EG ready for editing or running. Another - someone else checks in a program change and when I retrieve it, EG (7.11) prompts me to ask if I want to load the change - how good is that?!  No more emailing each other bits of code etc etc....collaboration is just so much easier. 

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 6 replies
  • 1895 views
  • 1 like
  • 4 in conversation