1

I have SAS specific example but I'm really hoping there is a shell solution that would work for other interactive modes (thinking specifically of python...)

I connect to linux server through SSH (putty client). that server has SAS installed. I don't have access to any xterm/gui through putty, and no SAS on my local machine, so SAS/Connect is not available. I am trying to come up with a way to have some sort of interactive mode. VIM is awesome for editing files but i've been submitting everything in batch mode (and have short cuts in my .vimrc to do so). However, everytime i submit i am starting a new session. Id like a way to keep a persistent session alive, and submit blocks of code to it. I have no admin rights, and building from source is frowned upon.

My thought is to push commands to existing interactive line mode of SAS (or python!) open in a separate terminal, and keep it alive as I throw chunks of code at it.

  • for example:

dummy1.sas:

   data temp;
      ...stuff...;
   run;

dummy2.sas:

data temp2;
    set temp;
   ... more stuff ...
run;

Id like to be able to submit dummy1.sas let that finish, and then run dummy2.sas, without creating permanent data sets.

The closest I have gotten pushing the code over is:

cat dummy1.sas > /dev/pts/8

Where SAS is waiting in interactive mode in pts/8. This resulted in code printed to pts/8, but not picked up by SAS to execute.

Looked into fifo, and that sort of worked, but would end the SAS/python session after one execution.

Thank you all! Any help or direction is greatly appreciated.

Here are some things similar: How can I pipe initial input into process which will then be interactive?

https://unix.stackexchange.com/questions/207487/how-do-i-close-a-fifo-pipe

4
  • I don't think I fully understand what you're doing, but you might want to look at how utilities like Ultraedit execute SAS scripts. Lots of folks I know use ultraedit to edit things and have a button/command in UE to submit to a SAS session, and I think they keep the SAS session alive. Alternately, SAS/CONNECT allows you to submit code via RSUBMIT from one session to another, or even use Enterprise Guide which seems like it might be appropriate for this kind of use case...
    – Joe
    Feb 24, 2017 at 21:59
  • Joe - thank you for the comment. I have updated to try and make my question a little more coherent. I looked into ultraedit like you said. very cool, but i don't think its what i need, looks like that would only work executing SAS on a local windows machine, and i am trying run SAS on a remote linux server that I SSH into through putty. We do have SAS Studio that allows me to submit interactivly to the remote server. But SAS studio horrible, unstable, laggy and overall just bad. We do not have Base SAS or EG available. Thanks again for the response!
    – utkuxx0
    Feb 25, 2017 at 2:30
  • If your server has SAS Integration Technologies, this paper describes an approach: support.sas.com/resources/papers/proceedings13/003-2013.pdf
    – Quentin
    Feb 25, 2017 at 12:08
  • Quentin - I believe you linked me to the the best course forward. Its more SAS specific and less script based than i would like, but given the programs i have available It is the best I'm going to get. If you want, copy this into the answer section and i will mark it as correct. BTW I found this link that is almost exactly what i want, but wont work given lack of admin rights. unix.stackexchange.com/questions/48103/…
    – utkuxx0
    Feb 27, 2017 at 13:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.