views:

143

answers:

1

When submitting SAS code via the SAS Toolbar (eg cmjohns response) the compiler knows that the code is being "DM'd" and will not run certain code (eg %window).

Is there a way to trick SAS into believing that code submitted from the Toolbar is coming from the Editor, therefore allowing interfaces (using %window) to be triggered via point and click?

+1  A: 

It isn't super clean, but this will do it. The only downside is a program editor window will be open after it runs. There's probably a way to close it when it's done but I don't know what that is off hand.

pgm; clear;include "C:\path\code.sas"; submit;

Basically, this says to open a new program editor window and make sure no other code is in it, then include the contents of code.sas into the editor, then submit all the code that's in the program editor.

As a side note, in addition to a toolbar button, I think you could map a function key to a command like this as well. Press F9 to pull up the current mapping. There is a limit to the length of the command mapped to a key though so no long paths.

cmjohns