Recently I was tasked with implementing version control for SAS programs in my programming shop.
I have successfully set up a Subversion Server, and I have created a TEST Repository containing a couple of simple .SAS programs.
Is Base SAS able to directly run the programs stored in the repository or do the programs need to be copied back out to the file server after I commit them?
I ask because once I place a .SAS program in the repository I can no longer see a typical Windows file path (e.g. c:\testRepos\test.sas ) for the file.
Thanks!
Hi,
You need to create what is known as a Working Copy. This is basically an area on your network or local machine which is an extract of what is on the repository. Use SVN checkout where you want to have your working copy. Once it is extracted there will be overlays (small icons over the file icons) which indicate status of the file in conjunction with the repository, tick = same, exclamation mark means changed. SVN handles a link between the repository and the copy on the network by using a small hidden file. Also I would recommend, presuming you are on Windows, to get Tortoise SVN which is an Explorer plugin, saves having the command line access: TortoiseSVN - Home
RW9,
Thanks for your speedy response. I have installed TortoiseSVN, and it seems to work great.
I have successfully checked a .SAS program out of the repository into my working copy folder on my PC.
I can make changes to the program and commit those changes back to the repository.
I can also use Tortoise Diff to view the changes.
However, I don't know how to tell SAS to look inside the repository and run the program.
Normally, I would lauch SAS in batch mode and tell it to run the program c:\sasPrograms\test.sas.
Once the programs are inside the repository, a normal Windows file path is not apparent to me.
Thanks again!
Yes, as Jaap has mentioned. SVN is a repository for version history. You would right click batch submit your SAS programs from the working copy as you would have done before. SVN has nothing to do with running SAS programs.
The only way to have SAS (*.sas) programs being run is having all code readable open available at the OS level. You cannot run it for a version-tool
For a structured organized approach of all SAS code a well designed directory structure at the OS level is needed. Formats and macro-s are different type of objects in SAS (there are many more). SAS is behaving for the *.sas artifacts as an interpreter, there are no compilation object parts. This is different behavior as in languages like JAVA (and othere languages).
.................
Review your goal for version-control there is often a big misunderstanding.
.................
Regulators are asking for being capable on underpinning having used the correct version of code in production environments. eg look at: AS/NZS ISO/IEC 27001:2006
You have to be able to do that by proving out of some logging / events / security protecting against updates. This is wit ITSM part of Release management and security with an RBAC implementation. Version control tools are having their goal on "collaboration across a group of developers". That is an other stage another viewpoint.
Both are requiring you do something on your DTAP (Develop Test Acceptance Production) environments and processes.
The difference is as big as the difference between horizontal and vertical.
EGP and version control (https://communities.sas.com/thread/61534)
There was a time auditors did only ask you could make a backup. Being able to restore data was not relevant.
After some debacles they are now starting to ask whether you can prove you are capable to do a restore can do a DR (part of Business Continuity).
.......
Probably someone came to you and wanting you to do something about version control and his dogma is using a version control tool.
By that you are satisfying his dogma but ingoring the real question to be solved. At the end of the day having more troubles to be faced.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: