1

In Base SAS we can assign a custom command to one of the listed hotkeys and specifically we can assign a hotkey for rsubmitting under Tools -> Options -> Keys, say ctrl + F3.

The hotkeys for submitting code are F3 and F8.

Is there a way we can hotkey rsubmit selected code in SAS Enterprise Guide?

Community
  • 1
  • 1
Therkel
  • 1,379
  • 1
  • 16
  • 31

2 Answers2

1

If you select code and then press F3 on your keyboard, it will run the selected code. F8 if you want to submit the whole code.

You can customise hot keys in "program" => "enhanced editor keys"

Regards, Vasilij

Vasilij Nevlev
  • 1,449
  • 9
  • 22
  • I should have emphasized my question: I would like to be able to **rsubmit** code with a hotkey, as we can do with regular code submitting with F3 and F8. I cannot find such option under the *enhanced editor keys* - it does not seem to support reassigning "submit code" either (say, if one's F3 button broke). – Therkel Jul 04 '16 at 12:57
  • rsubmit? that's exactly what SAS EG does! SAS EG is only a client that is connected to your SAS instance that can be local or remote. so, technically speaking it always submits code to a remote machine. rsubmit is not relevant to SAS EG anymore. rsubmit was primarily used in SAS PC days when you had local SAS server and remote SAS server. Have I got something wrong here? – Vasilij Nevlev Jul 04 '16 at 13:31
  • Aha! I did not know this about SAS EG. However, it seems my code is run locally (I here use Windows paths) when I submit with F3, while if I wrap code between `rsubmit` and `endrsubmit` I submit it to a server (I have to use UNIX paths). Is this then a consequence of how I have setup my session? – Therkel Jul 04 '16 at 14:14
  • rsubmit would still work because your SAS/CONNECT would still handle these statemetns. Windows paths don't mean you are on local server. Have a look at your SAS EG profile. If you click on the bottom right corner of SAS EG window and examine your profiles, you should see if you are using a local server, or a metadata server for your workspace servers assignment. If metadata server administers your connections, you should see all the servers available to you in the SAS EG server list. You can submit your code to any of those servers just by picking them from a drop down list in your sas code. – Vasilij Nevlev Jul 04 '16 at 15:12
  • There are actually still many setups around where people work locally in the editor and use rsubmit to send everything to a remote server. But I agree, when using EG you should just use the logon credentials for the remote server to create an EG profile. – Jetzler Jul 05 '16 at 08:09
0

Not sure this helps. Only works when you have full SAS on the local machine and only works with the old text editor.

  1. You have full SAS and you use the old text editor on your local machine
  2. PuTty and SAS connect(SSH) to a unix/windows server

You can create a command macro and assign it to a function key.

If you highlight the code the function key will send the core to the server for execution.

Put something like this on the function key

store;note notesubmit '%rsubh';

The store command saves the highlighted text in the clipboard. The command macro reads the clipboard and submits the code to the unix server. The store command only works with the old text editor. It ws turned off in all subsequent editors.

%macro rsubhh /cmd;
   store;note;notesubmit '%rsubha;';
%mend rsubhh;

%macro rsubhha /cmd;
  FILENAME clp clipbrd ;
  DATA _NULL_;
    INFILE clp;
    INPUT;
    file "shared drive";
    put _infile_;
  RUN;
  dm "out;clear;";
  footnote;
  rsubmit;
    %inc "shared drive";
    run;clear;
  endrsubmit;
%mend rsubhha

;