DOS commands in SAS Enterprise Guide - sas

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?

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).

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.

Related

How to use a code node to list all of the datasets in a .egp file using SAS EG?

I want to get a list all of the datasets to enter them into an array.
I could then feed each item in the array into a macro to prevent me from having to do a repetitive task.
I don't recall EG having that level of introspection available to submitted code. However, an add-in tool can be programmed (as a Windows .dll) and the add-in will be able to examine the client (EG), project and other meta information not available to code submitted by the client (i.e. your SAS code that will run either locally or remotely depending on server settings of the active profile)
A link to reference documentation (SAS.EG.ADDins) and other add-in material can be found at http://support.sas.com/documentation/onlinedoc/guide/release30/addins/
The SAS.EG.Addins help states
Services Supplied by the Host Application (to the Add-in)
The following interfaces
surface information and services that are supplied by the host
application (for example, SAS Enterprise Guide and the SAS Add-in for
Microsoft Office). These are the interfaces that are supported by all
host applications:
ISASTaskConsumer Provides information about what the application
supports and access to other supported interfaces. Also provides
access to options specific to the particular instance of the add-in.
ISASTaskData, ISASTaskDataAccessor, ISASTaskDataColumn Provides access
to data services.
These are the interfaces that might be supported by a given host
application. If your add-in code takes advantage of any of these
interfaces/services, you should include checks to ensure that an
interface is supported before you attempt to use it.
ISASTaskSubmit Allows your add-in to submit a SAS program for
processing while the user interact with your user interface.
ISASTaskUtilities Supplies utility methods for use by your add-in.

issue where In SAS Deployment wizard SAS ODBC Driver for Web infrastructure platform Data Server is not downloaded

What if while installing SAS, I face issue where In SAS Deployment wizard SAS ODBC Driver for Web infrastructure platform Data Server is not downloaded , it is showing completed with error. What would happen if SAS Deployment wizard SAS ODBC Driver for Web infrastructure platform Data Server is showing this error. Can we code/program without the need of this fucntionality?
You are best contacting SAS support for a specific question like this - it is not a programming question, but rather a SAS administrator question.

SAS SID for Server

I am installing SAS and have a valid license, for Windows Workstation.
I found the following at the link below:
The operating system value in the SAS installation data file (SID
file) does not have to match the operating system of the machine that
SAS is installed on as long as the SAS client application is part of
the order that you are using.
http://support.sas.com/kb/49/003.html
Does this mean there is some way to change the SID file to allow this license to install on Windows Server? If so, how?
You need a server license to install on a server - ask your administrator or SAS Support (be aware that server licenses are much more expensive!)
The page you're linking here is not related to Base SAS but to SAS client applications, when used in a client-server relationship. This would be something like Enterprise Guide; something that itself doesn't do the work, but instead submits code to a server which does.
That page is saying that if (for example) you have a server license for SAS, you don't have to have a desktop license to install Enterprise Guide on a desktop. You would have to have a desktop license to install (base) SAS on a desktop, though.

How can I schedule a stored process in SAS DI Studio?

I would like to use Enterprise Guide as a development environment for creating a SAS job (Base SAS code only), but I then need to use DI Studio to schedule that job to run at a particular time.
I want to use EG for developing the job because I believe it is a better development environment (program editor etc.) than DI.
I also want the job to exist as a stored process so that users can run it outside the schedule if necessary.
Can I create a simple DI Studio job that merely calls an existing stored process?
Of course - there are many ways to achieve this. One is to create a separate job (with 'user written code' component) and Stored Process, both of which simply %include your Enterprise Guide program.
Another is to create your stored process using Enterprise Guide, and then in DI Studio (user written code) call the stored process directly using proc stp (see documentation)
Yet another is to paste your EG code into DI Studio and 'deploy job as stored process' - documentation for that is here.
Oh, and to answer your 'headline' question - you don't schedule jobs in DI! The deployed .sas code can be scheduled via Schedule Manager (SMC), the OS itself, or other third party tools (eg LSF).

How to run SAS using batch if I do not have it locally

Is there a way to run SAS using batch if I don't have the sas.exe in my machine?
My computer has the SAS EG but the code is ran on our companies servers
Thanks
If you are asking whether it is possible to run SAS batch on your local machine without having SAS on your local machine, the answer is no.
If you are using EG to connect to a SAS server, and you want to execute a batch job on the SAS server, that is possible (just not with EG). For example, if you have terminal access to the SAS server via putty or whatever, you can do a batch submit.
Enterprise Guide is quite capable of scheduling jobs, whether or not you have a local SAS installation.
Wendy McHenry covers this well in Four Ways to Schedule SAS Tasks. Way 1 is what you probably are familiar with ('batch'), but Ways 2 through 4 are all possible in server environments.
Way 2 is what I use, which is specifically covered in Chris Hemedinger's post Doing More with SAS Enterprise Guide Automation. In Enterprise Guide since I think EG 4.3, there has been an option in the File menu "Schedule ...", as well as a right-click option on a process flow "Schedule ...". These create VBScript files that can be scheduled using your normal Windows scheduler, and allow you to schedule a process flow or a project to run unattended, even if it needs to connect to a server.
You need to make sure you can connect to that server using the credentials you'll schedule the job to run under, of course, and that any network connections are created when you're not logged in interactively, but other than that it's quite simple to schedule the job. Then, once you've run it, it will save the project with the updated log and results tabs.
If your company uses the full suite of server products, I would definitely recommend seeing if you can get Way 3 to work (using SAS Management Console) - that is likely easier than doing it through EG. That's how SAS would expect you to schedule jobs in that kind of environment (and lets your SAS Administrator have better visibility on when the server will be more/less busy).