Submit Clipboard Shortcut

Reply
Frequent Contributor
Posts: 101

Submit Clipboard Shortcut

Hey All,

 

I use a text editor that is better with autofill and syntax highlighting than the SAS editor, however it is cumbersome to submit code in SAS this way.  What I currently have to do is copy the code I want to run in my text editor, move over to the SAS editor window, make sure that window is active, and then go up to the toolbar, select run, and then go down to submit clipboard and select that.

 

Is there a better way to do this?

 

Thanks for your help!

Trusted Advisor
Posts: 1,114

Re: Submit Clipboard Shortcut

A minor simplification might be to assign a shortcut key, e.g. F12, to the command gsubmit buf=default (which is equivalent to the menu command Run --> Submit Clipboard, cf. this older thread), i.e. enter this command into the KEYS window. It seems that GSUBMIT does not require the editor window to be active.

 

I once worked in a Unix environment where they had set up a text editor (NEdit) so that you could send a submit command to SAS. This was actually rather a batch submit, so you could have opened the log and output file of the SAS program in separate text editor windows and these would then be updated upon confirmation (like "abc.log has changed. Reload? Ok/Cancel"). This was convenient when you made the last few changes to a program until the log was clean and the output perfect. However, it was not possible to submit only parts of the editor window's content, hence less useful in earlier stages of program development.

 

Interesting topic, alternative program editors. I'm still using the SAS Enhanced Editor and have defined a large number of "abbreviations" which primarily correct spelling errors (like "porc priont"), perform command completion and other things.

 

May I ask which text editor is better with syntax highlighting than the SAS (Enhanced) editor?

Frequent Contributor
Posts: 101

Re: Submit Clipboard Shortcut

Thank you very much for your response.  I am going to try to get that worked out.

 

I am currently using SublimeText 2, with a plugin that a member here (I believe) made that works with SAS programming. It is not perfect, and there are some things that don't work.  i.e. it sometimes gets confused with the highlighting if there are tons of quotation marks in certain procedures. 

 

But it works pretty well, and the things like block indenting and autofill make life a lot easier.

 

Here is the link for the plugin that you have to download.

 

https://github.com/rpardee/sas

 

Hopefully this helps!

Trusted Advisor
Posts: 1,114

Re: Submit Clipboard Shortcut

Thanks for your reply and the link. I've heard about Sublime Text, but I've never seen or used it.

 

How is "block indenting" in Sublime Text different from indenting blocks of consecutive selected lines in the SAS Enhanced Editor (using the Tab key)?

 

Does "autofill" include auto-completion of variable and dataset names? Or does it create syntax templates for SAS procedures and functions?

 

Frequent Contributor
Posts: 101

Re: Submit Clipboard Shortcut

I guess the block indenting is no different from the editor, being that I didn't know how to do that in editore before you just mentioned it!

 

But the autofill does automatically complete variable names, dataset names as well as common SAS functions and variables, such as _type_ etc.

 

It's by no means perfect, but so much better than the enhanced editor.

Trusted Advisor
Posts: 1,114

Re: Submit Clipboard Shortcut

Interesting! As mentioned earlier, I frequently use the "abbreviations" feature of the SAS Enhanced Editor. For the completion of variable and dataset names, of course, this requires that I set up the corresponding abbreviations individually (which I did, in fact, for frequently used long names in a project). I assume that Sublime Text "learns" new names dynamically without any effort on the part of the programmer.

Frequent Contributor
Posts: 101

Re: Submit Clipboard Shortcut

That's correct! It does learn right away, which makes things very easy.  

Ask a Question
Discussion stats
  • 6 replies
  • 725 views
  • 0 likes
  • 2 in conversation