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.