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.

tags: sas 9.3, SAS Enterprise Guide, systask, xcmd

2 Comments

  1. Posted August 7, 2012 at 11:57 am | Permalink

    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
      Posted August 7, 2012 at 12:02 pm | Permalink

      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.

3 Trackbacks

  1. [...] the ability to run system commands.  If you're running the program through SAS Enterprise Guide, you'll need to check that proper XCMD options are enabled. /* name of a machine on my network where I have admin rights */ %let machine = L73391; filename [...]

  2. [...] There is a REG QUERY command that is built into Windows. If you can run that command from within your program, then you can parse the result and get your [...]

  3. [...] These statements would have continued to work from SAS Enterprise Guide but for one decision that SAS R&D made back before the turn of the century (yes, 1999): by default, SAS workspace servers are configured with NOXCMD in place. (That decision applied even when using SAS Enterprise Guide and your local SAS install - a silly restriction that has been lifted in SAS 9.3.) [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <p> <pre lang="" line="" escaped=""> <q cite=""> <strike> <strong>