What if you would like to make a copy of an existing stored process to test out your changes before making them live? The copy command is available from within SAS Management Console or from the SAS Enterprise Guide Open Stored Process GUI as seen below (note you can only paste the object in a different folder). The server designation, the prompts, etc are copied. And this is great if you would like to change and test only a metadata modification (such as switching from 'Stored Process' to 'Workspace' servers) or adding descriptions to prompts. But what about the underlying .sas code if you want to edit the stored process itself?
(Need help with editing? Check out my co-author Tricia Aanderud's post about how to edit a stored process? )
Remember that in the majority of stored process implementations, there are two components to every stored process:
- the metadata registration
- the .sas code that runs on submission
(New in 9.3, you have the option to place sas code in the metadata registration itself, see my post about when this would be super useful.)
Anyhow, the copied metadata registration points to the original .sas code not a new .sas file. Modifying the stored process from Enterprise Guide immediately will cause you to edit BOTH the original stored process code and the new copy. (If you move to the Summary tab of a Stored Processes Properties, you can confirm that the source code path is identical to the original stored process.) You must make a copy of the .sas file in a subsequent step and edit the copied metadata to point to this second location before beginning any edits through the SAS Code window.
Included are the steps to do this full copy:
- Copy the stored process metadata registration and paste it in a separate folder
- Edit the stored process metadata registration to point to .sas copy
- Copy the .sas file on the server itself, rename to match #2.
This is a great tip to remember. Maybe Tricia & I should consider it in a second edition of the SAS Stored Process book. Just goes to show you how difficult it was to come up with only 50 Keys to Learning SAS Stored Processes.
5 Comments
Stunning story there. What occurred after? Thanks!
Hi there, just became aware of your blog through Google, and
found that it is really informative. I'm going to watch out from brussels. I will appreciate if you continue this in future. A lot of people will be benefited from your writing. Cheers!
Wow this site is just 1 of the most remarkable I ve seen online these days!
its whole of informations and genuinely has a thing unique that any other web-site has!
To the blog proprietor : thank you and I will occur back each day!
Great tip, thanks. I was just starting to wonder if moving a stored process would be simple, or if I would need to use SMC or a "metadata mover" or something. Nice to see it laid out so clearly. I would vote to include this in your excellent book. Maybe you guys will just have to bite the bullet and bump the second edition up to 75 keys (or 50 keys with an appendix on 25 bonus tips....)
Thanks Quentin! It was so difficult to limit ourselves to the 50 tips, might have to consider a follow up white paper or something similar. Course we had a fellow SAS Nerd complaining that 50 was way too many to remember, so a top 10 list is probably in order as well.