User:Audi/BlogEntry: 2007 July 23 11:55:21 EDT

From sasCommunity

Jump to: navigation, search

[edit] How do SAS programmers create and manage their projects?

I have the impression that very few SAS programmers use a tool (outside of SAS) to create and manage their projects. Those who use Enterprise Guide know how convenient it is to manage and revisit a project once it is created. But how many can afford EG?

I have tried EG's interface but prefers a Visual Studio-style layout, where the project components are accessible from a right dockable window. This bias stems from the fact that I use Visual Studio to create and manage my C#/VB projects. I now use C# exclusively, but was once a VB programmer (before I took a C++ programming post-baccalaureate course at NC State University). My VB knowledge came to the rescue when scouring the SAS/Integration Technologies documentation on how to connect to a local and remote SAS server, and read/write/save SAS datasets. Most of the outdated samples are in Visual Basic!

To get a sense of what I'm talking about, download Roland's free SPECTRE clinical reporting system and manage it using my Notebook. Here's how I would setup the project:

  o Create a folder on your hard drive and name it "Spectre". 
  o Create two (2) subfolders under the "Spectre" folder -- name them "macros" and "scripts". 
  o Extract the "macros.zip" file into the "macros" subfolder, the "scripts.zip" into the "scripts" subfolder, 
    and the "spectre.zip" file into the "Spectre" main folder.
  o Open Notebook and click on the "New Project" button. Name the new project "Spectre". Browse to the location
    of the "Spectre" folder for the "Create Project In:" info. Check the "Just create a blank project" option,
    and click "OK".
  o On the right dockable window, right-click on the "Spectre" node and select "Show All Files".
  o Right-click on the "macros" node (subfolder) and select "Include in Project". Do the same for the "scripts" node.
  o Right-click on the "Spectre" node and select "Add Existing Item...". Browse to the location of the "Spectre"
    main folder and select all the non-folder items (excluding the Spectre.npj file) -- use the Shift key to select
    a range of files, or the Ctrl key to select individual files. Click OK after making the selection.
  o That's all you need to do to manage Spectre. Try double-clicking a SAS program/macro or an HTML file from the
    project treeview to open it. 

You should be able to apply the same steps to create and manage your SAS projects! You can set any SAS program as the startup program using the "Set as Startup Program" menu. Then use the "Run Project" button (with the green-colored triangular icon) to run your project. If the program has no errors, you will see the "Submit succeeded" message on the status label on the bottom left corner. Otherwise, you get a "Submit failed" message, with the number of errors shown! The "Errors" tab enables you to access each error message individually.

I don't believe in the saying that it's difficult to teach old dogs with new tricks. :-) A good tutorial is all we need.

Regards, Audi

P.S. Notebook's code indenter is currently being edited to correct an issue when there are quote/parenthesis pairs with an embedded ";" character, or quotes/parentheses in a statement following a SAS code label.

Personal tools