Stored Processes: 3 Ways to Edit a Stored Process

Edit Stored Process from Source Code Repository

Some may not realize that you can edit a SAS Stored Process in multiple ways (depending on your permissions).  Today I show you three different ways to reach the stored process code.  By the way, I’m using SAS Enterprise Guide 4.3 and SAS Management Console 9.3 – so your windows may look different.

Method 1: SAS Enterprise Guide

Many of you are aware of this method already.  Just for review – here’s how you open a stored process and then change it with SAS Enterprise Guide.  You have to be connected to the metadata server to reach the stored process.

  1. From the SAS Folders pane, select the SAS Folders icon.
  2. Navigate to the stored process location.  Right-click the stored process and select Add to Project.  The stored process appears in the Process Flow and Project Tree areas.
  3. From the Process Tree or the Project Flow area, right-click the stored process name and select Modify <stored process name>.  The Stored Process Manager window appears and you can make changes to your code.  I use this method most often because I like the help I get from SAS Enterprise Guide.
Edit Stored Process with SAS Enterprise Guide

Method 2: SAS Management Console

If you  have access to the SAS Management Console 9.3, you can edit the stored process directly.  This functionality is not available in earlier releases.  

  1. In the SAS Management Console from the Folders tab, navigate to the stored process location.
  2. Double-click the stored process. The Properties window appears.
  3. From the Execution tab, select the Edit button.  The Edit Source Code file appears.  You can make any desired edits from this window.

 Edit Stored Process with SAS Management Console 9.3

Method 3: File System/Source Code Repository

If you have to access the source code repository, you can edit the stored process code directly.  [Learn more about the source code repository in this post.] In the previous screen capture, you can see the location of the source code repository.  From the SAS Enterprise Guide screen capture, you would click on the Execution options choice.

  1. Navigate to the file location on the operating system.
  2. Open the stored process program (SAS program).  You may have a preferred editor that you like to use or just good ole’ Base SAS.

 Edit Stored Process from Source Code Repository


Learn More about SAS Stored Processes and Prompts

You can learn more tips and tricks for creating, debugging, and using SAS stored processes in the 50 Keys to Learning SAS Stored Processes book. It's a complete guide to SAS stored processes. Check Amazon for best pricing and quick shipping!

6 thoughts on “Stored Processes: 3 Ways to Edit a Stored Process

  1. Pingback: Backup or copy all components of your stored process before making changes | Best Analytics
  2. Let me know if it works for you. Sounds okay to me.

    You may find you have different methods based on the complexity of the stored process. If it’s a simple stored process – I just edit it in the Stored Process Wizard. More difficult ones I use the source code.

  3. Intereting. I had another thought on this (which I’m unable to test now). Maybe after making a stored process, I should use EG to make an new project, mystoredprocess.egp. And in that project, I would put the stored process. I would then open the source code (.sas) in the project as well. So I would have one icon for the stored project. And one for the .sas file in the source code repository. And they wouldn’t appear to be linked in EG. So then when I want to edit the source code, I would open that item (helpful cuz we have a linux server, and I never learned vi). When I wanted to update prompts, I would double click the stored process icon. Does that make sense? There could even be %include files involved. So I would have one EG project that just has bascially one icon for the stored process, and one icon for each of the source .sas files. Seems like this could be useful.

    Unfortunately on my current setup, when I create the stored process the .sas file in the source code repository is owned by the SASSRV account, and I only have read access to the file. But if I can get the admins to change that, I think this might be a good setup.


  4. I actually use the method you describe most of the time – especially during the initial development phases. SAS EG has more robust editing, error finding, and search capabilities.

    I’ll think about your request – it’s very environment dependent. I typically organize my information by projects – however at my last company I worked for 3 different departments – so I had it organized by department. I try to think how it would be easiest for the end user. Hope that helps.

  5. Good tip. As a newbie to EG and stored processes, I’ve actually been doing this the long (wrong?) way. I have a EG project. In the EG project I have my original program (which I used to create the stored process), and the stored process itself. And they are connected. When I want to make changes to the code, I’ve been opening the original program and updating it. Then I right click on the stored process and select “synchronize stored process code with…. ” Guess I hadn’t realized that the SAS code tab in the stored process manager is really a full editor. Good to know.

    Do you take requests? I would love to see a post about best practices for organizing directory structures (both on the source code repository side and the SAS Folder/metadata directory side).


Comments are closed.