Hi,
I am using SAS on a server via Enterprise Guide. Can I also execute a SAS program on my local machine via the command line? Any pointer would be very much appreciated. Thanks.
Christian
Hi all,
I have got it to work using IOM in the end see:
http://support.sas.com/resources/papers/proceedings12/017-2012.pdf
I can write from Windows to the Unix file system and then use an include. The steps are generate SAS code, write it to file. Use include and IOM to execute SAS code. The SAS code writes to the file system as well, which I can see in Windows. Data can then be uses in C# code.
Thanks. Basically, I want to create SAS programs (text files) dynamically (via another program) and then execute the via the command line (in invoked by the program that creates the text files). EG runs on Windows and SAS in Unix, as far as I know. No chance that I can map any drives - our IT is pretty useless. I was also thinking about using stored processes. Ultimately, a stored process is a (restful?) API. This may work in theory but determining the URI of the stored process and authentication may be impossible - I do not expect any support from our IT. Thanks.
That's a really bad situation you are in. If you name an Processflow "autoexec" in EG, it will automatically run on loading the project - you have to check an option for the automatism to happen. This is a workaround and not a very good one, but the only one i can think of that does not need the IT involved. Can you create a stored process?
Thanks I can create stored processes, although there is no clear target operating model (e.g. best practice of deployment). I would also need to know the URI of my stored process. Is there a way of determining this? I intend to write a C# application to consume this. Another alternative is IOM. I once got some C# code working using IOM as a POC. Thanks!
You can only execute a SAS program on your PC if you have Foundation SAS also installed there. If this is the case then the option "local server" should display when you configure your EG connection profile. If you do have this then just make the local server your active one and you can still use EG to run code locally.
If what you mean is: can you run a command line process that will run a SAS program on your remote SAS server? Yes that is possible and one of the options would be the EG scheduling facility.
If your only link to the SAS server is EG (i.e. no FTP, no mapped drives, no access to the unix shell from windows, no windows SAS on your PC to talk to the server SAS) then the only way to create or modify or delete or run anything on the unix server is via this interface: EG.
In this case, this is not a SAS question, it is a general IT question. If you only have one access method, you can only use this one access method.
You can script a SSH client on the Windows side so that it automatically logs on to the UNIX server and executes a command there, that command then being a call of the sasbatch.sh script provided in the SASApp configuration tree.
@csetzkorn id not already did, you need to talk to your SAS server admin, and potentially UNIX/AD admin and an IT architect so you are not trying to implement a "bad" practice.
If you have a valid use case you should be able to set this up on the server. Driving jobs/batches from local machine is a 20th century thing.
Hi all,
I have got it to work using IOM in the end see:
http://support.sas.com/resources/papers/proceedings12/017-2012.pdf
I can write from Windows to the Unix file system and then use an include. The steps are generate SAS code, write it to file. Use include and IOM to execute SAS code. The SAS code writes to the file system as well, which I can see in Windows. Data can then be uses in C# code.
Do you have access to SAS Management Console? If you do there is a much easier way. SMC allows you to run SAS batch jobs on your Unix server via a point-and-click interface.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.