I have set up a schedule program (the one sas have developed themself) which open my SAS EG and runs it, and it is normally working fine then I run on my local server, but if I run through SAS app it fails.
My question: Do you know a way I can schedule SAS EG running on a SAS app?
If your "schedule program" runs locally you may need to wrap your SAS code in rsubmit and endrsubmit statements to ensure it is submitted remotely (on the SASApp server).
See documentation.
If you want to run your code on the GRID , use rsubmit and endsubmit statements at the beginning and end of your code respectively.
Related
I'm running SAS EG 7.1 on a Citrix machine at work. I'm trying to do a very large sql pull and keep running out of disk space. Our server drive has plenty of storage, so I assume switching the working directory to a folder on that drive temporarily will avoid this error?
The error says "insufficient disk space....file is damaged. I/O processing did not complete. You may be able to execute sql statement successfully if you allocate more space to the WORK library." I don't seem to have access to the config file and I've tried to change it programmatically with no luck. I am trying to save the resulting dataframe to a server folder already with a LIBNAME statement, but I think the temporary files created in WORK during the process are too much to handle. Any help?
I've tried both:
x 'cd "Q:\folder"';
and
data _null_;
rc = system( 'cd "Q:\folder"' );
if rc = 0
then putlog 'Command successful';
else putlog 'Command failed';
run;
These run fine, but in the log it still says my working directory is unchanged:
SYMBOLGEN: Macro variable SASWORKLOCATION resolves to "C:\Users\user\AppData\Local\Temp\SEG5432\SAS Temporary
Files\citrixMachineDrive\Prc2/"
The current directory is relevant for file references and such, but it's not related to your Work or Util directories.
WORK and UTIL are only settable at startup, and are either set in the arguments for sas.exe or in the sasv9.cfg configuration file. How you solve your particular problem depends on whether EG is connecting to a SAS server, or if it's just running locally. If it's running locally, you may be able to modify the startup options. If it's connecting to a server, you will have to talk to your SAS administrator.
However, it's highly unlikely you would want to use the network folder as your WORK folder. SAS expects high speed disk connected directly to the machine for WORK; if you set it to a network drive, your performance would be extremely poor.
Also note that "C:" is on the machine the SAS server is running on - it might be the same machine, if you're running SAS locally (on Citrix), but if it's a remote SAS server then the C:\ is on that server.
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).
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).
I use pc sas 9.4. But the server is on Linux, so instead of running my program in batch on the server I have a little script I run at the top of my program which uses a remote engine to connect. I also assign a libname and run my datasteps which create permanent datasets. However when I do this, my program runs for 6 hours, but when I run the program without a libname, meaning the datasets are generated in my work directory, the same program runs in 10 minutes. No one seems to know why that is, and I was told to just run my code directly on the unix server. I don't like the look of sas on unix, and using unix editors, saving .sas files to run them. I prefer using the sas windows GUI. Why is there such a difference in runtime?
Many thanks in advance.
As you are not using rsubmit; you are actually not working on the server, only your data is stored on the server. You are downloading the data from the server to your PC before performing any calculations. Depending on your network, this will take some time.
Try this:
rsubmit XXX_server_name;
... Your Code ...
endrsubmit;
That way you will be working on the server, not just using data in a library on the server.
I have a prompt that generate a variable across all my project (the SET_ENVIRONMENT macro variable).
I then run my programs on by one in my process flow.
The only problem is that some of them are local (when I want to upload data), and some of them are remote (using sas metadata server).
A solution would be to run my SET_PROMPT program twice, once on my local, once on my SAS Metadata Server.
I was wondering if it was possible to do set both prompts at the same time?
If this works like a SAS/CONNECT session, then what you might do is link your prompt to a program in the local session. Have that program then be responsible for using %SYSRPUT to assign the variable on the metadata server, and have that program be always the first program you execute. That way you don't need two prompts (which is annoying for the user) but get it assigned in two places at once.