dm "vt &syslast";
The above command opens the last created dataset in work library. How do I make it work for RWORK library?
dm "vt &syslast."
will open the most recently created table, regardless of what location it is stored in. So if the most recently created table is in RWORK
, that should not be a problem.
What might be a problem is the definition of &syslast
, however. If you are doing something like:
rsubmit;
data class;
set sashelp.class;
run;
endrsubmit;
dm "vt &syslast.";
That won't work - &syslast
is defined on the remote computer, not on your local computer. You either need to use %sysrput
to put the macro variable onto your local machine, or know the name of the dataset you want to open.
rsubmit;
data class;
set sashelp.class;
run;
%sysrput rdata=&syslast;
endrsubmit;
dm "vt &rdata";
Or something along those lines. I think you'd probably have to translate the libname - &rdata
would contain WORK.CLASS
here, and you'd have to add an R - but it might be as simple as:
dm "vt R&rdata";
since you just want to prepend an R.
You could also directly specify the table, dm "vt rwork.tablename"
, and open any arbitrary table.
DM
commands only work in SAS Display Manager environment (often called "Base SAS") and will not work in Enterprise Guide or SAS Studio. Both EG and Studio automatically open tables created during the current submission, by default, though the option to do so can be turned off.