DOS commands in SAS Enterprise Guide

295 Views Asked by At

I'd like to run some DOS commands in SAS Enterprise Guide. I did it in 9.3 and used the X command. For example: x 'mydir';

X is disabled in Enterprise Guide, as far as I can tell. Mine hangs when I try to use it.

Is there a straightforward way to run DOS commands in Enterprise Guide?

2

There are 2 best solutions below

0
Tom On

Enterprise Guide is just a front end to submit SAS code to a remote process/server where SAS itself is running. So Enterprise Guide is never going to run any commands.

If the XCMD option is turned on in the SAS session that your Enterprise Guide project is using to run SAS code then the SAS code submitted by your Enterprise Guide process could use the X, SYSTEM or a filename PIPE to run operating system commands. And if the system where that SAS session is running is using the Windows operating system then you could submit "DOS" commands from your SAS code.

But if the system where SAS is running is using UNIX then you could only submit UNIX commands.

And if the XCMD option is disabled then you cannot submit any commands.

If you want to submit commands to run on the machine where you are running Enterprise Guide then you would need to have SAS for Windows installed on that same machine and be connected to that version of SAS (versus some other SAS application server you might have access to).

0
Richard On

In order to have Enterprise Guide perform local operating system interactions you can also create a custom add-in. From the documentation

Overview
Custom add-in tasks are .NET assemblies (DLL files) that you create, deploy, register in SAS Enterprise Guide, and execute from the SAS Enterprise Guide task list or add-in menu.

To provide access to custom tasks based on the job responsibilities, you can register custom tasks as capabilities, assign capabilities to roles, and assign users to roles.

Create Custom Tasks
To create custom tasks, you develop Windows executables and package them as .NET assemblies. It is convenient to assemble multiple tasks in a single .NET assembly so that you can share code and implementation among the tasks. For additional information, sample DLLs, and sample executable source files, see the topic “Creating Custom Add-In Tasks for SAS Enterprise Guide,” at Custom Tasks.