%macro OpenTable(table=&syslast) / des="Open a table";
dm "vt %sysfunc(compress(&table))" vt;
%mend OpenTable;
dm "vt %sysfunc(compress(&table))" vt;
%mend OpenTable;
Set the macro to a keyboard shortcut by typing the following code into the keyboard shortcut editor window (F9):
gsubmit '%opentable;'
By default, the macro opens the last table created, and the argument can be modified for any table.
I'm so glad I found a way to do this! This should save a lot of time!
Update:
I added more to the macro code in case the table doesn't exist. Here's the new code:
%macro OpenTable(table=&syslast) / des="Open a table";
/* Check if table exists */
%if %sysfunc(exist(&table))=1 %then %do;
dm "vt %sysfunc(compress(&table))" vt;
%end;
/* Otherwise pop-up a message that it does not exist. */
%else %do;
dm 'postmessage "The specified table does not exist."';
%end;
%mend OpenTable;
/* Check if table exists */
%if %sysfunc(exist(&table))=1 %then %do;
dm "vt %sysfunc(compress(&table))" vt;
%end;
/* Otherwise pop-up a message that it does not exist. */
%else %do;
dm 'postmessage "The specified table does not exist."';
%end;
%mend OpenTable;
Update Update:
I've developed a rather complex macro now that does the same thing:
OpenTable.sas