01-21-2016 05:08 PM
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!
01-21-2016 07:38 PM
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?
01-22-2016 10:29 AM
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.
Hopefully this helps!
01-22-2016 11:26 AM
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?
01-22-2016 11:41 AM
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.
01-22-2016 11:59 AM
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.