XCMD and SAS 9.3: working together again


It's been a well-known limitation for a long time.  When you connect to a SAS session using SAS Enterprise Guide, shell commands (including X command, SYSTASK, and FILENAME PIPE) are off-limits because the default SAS invocation disables them.  It does this by including -NOXCMD as a command-line option.

This makes perfect sense when working with a central SAS server that many people will access; it's not always prudent to allow the masses to have programmatic access to the OS shell of a shared resource.  But it makes less sense when SAS is running on your own desktop, where you typically have full access to shell commands in other contexts (such as within the Start menu, or in a command prompt window).

At least, that's what many SAS customers thought.  And at SAS, we agreed.  That's why beginning with SAS 9.3, the -NOXCMD option is no longer used as part of the default registered SAS command.  Put another way, shell commands such as XCMD, SYSTASK, and FILENAME PIPE are now allowed.  This affects only SAS for Windows, and only the case where you use a client such as SAS Enterprise Guide to launch a local SAS session.

If you are still using SAS 9.2, or if you want to change your local SAS command to customize a few options, you can do so by changing the registered SAS command.   Visit this blog post for instructions about how to alter your SAS command.  There's even a link to a tool that can help you.


About Author

Chris Hemedinger

Director, SAS User Engagement

+Chris Hemedinger is the Director of SAS User Engagement, which includes our SAS Communities and SAS User Groups. Since 1993, Chris has worked for SAS as an author, a software developer, an R&D manager and a consultant. Inexplicably, Chris is still coasting on the limited fame he earned as an author of SAS For Dummies


  1. Pingback: Calling Windows PowerShell from SAS: a simple example - The SAS Dummy

  2. Pingback: Query the Windows registry within your SAS program - The SAS Dummy

  3. Chris,

    We are using EG 5.1 and SAS 9.3 on AIX. A chmod works but SAS does not submit SAS code (no log). Is the xcmd off by default in a default configuration for the unix server and do you think that is what is happening?

    • Chris Hemedinger
      Chris Hemedinger on

      Alan, the XCMD option change was for Windows only, and only when relying on the registered COM server command (associated with the SAS.Workspace progID in the registry).

      On UNIX flavors and on any object-spawner-enabled environment, the command is going to be registered in the SAS metadata server. If you want to enable XCMD, you'll need to make that change in the server definition in SAS Management Console. Check out Paul Homes' blog on the topic.

  4. Pingback: The case for XCMD privileges in SAS Enterprise Guide - The SAS Dummy

Back to Top