Backup or copy all components of your stored process before making changes

5

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?

Open Stored Process GUI with Copy Selection
Right click on the Stored Process and Select Copy

(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:

  1. the metadata registration
  2. 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:

  1. Copy the stored process metadata registration and paste it in a separate folder
  2. Edit the stored process metadata registration to point to .sas copy
    Modify the .sas file name to a new backup file
    Move to the Execution Options area of the Stored Process Properties to change the .sas file name.
  3. Copy the .sas file on the server itself, rename to match #2.
    Sample from Windows on Copying File and Renaming to Match Properties Screen
    Ensure that this name exactly matches the properties screen.

    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.

Share

About Author

Angela Hall

Senior Technical Architect

Angela offers tips on using the SAS Business Intelligence solutions. She manages a team of SAS Fraud Framework implementers within the SAS Solutions On-Demand organization. Angela also has co-written two books, 'Building BI using SAS, Content Development Examples' & 'The 50 Keys to Learning SAS Stored Processes'.

Related Posts

5 Comments

  1. Mel Cheatham on

    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!

  2. celinda dugger on

    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!

  3. 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....)

    • Angela Hall
      Angela Hall on

      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.

Back to Top