Date: Thu, 2 Dec 2004 12:41:53 -0500
Reply-To: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM>
Subject: Re: Saving the log from the Display Manager
Ed Heaton wrote:
> Good morning, all;
>
> I want to program a Macro button to save the log from an interactive
> SAS session as the name of the file in the Program Editor with LOG for
> the extension rather than SAS -- Somewhat like would be the case if I
> were running batch SAS. Can anybody help? (No, I haven't searched
> the archives!)
>
What's a Macro button ? Is it a toolbar button that will run a macro that
will save the log likenamed as the file loaded into the program editor ?
As for program editor, is it the old style program editor, of which there
can be only of; or the enhanced editor (EE) of which there can be many
(making the likenaming difficult if >1 EE are open, which EE controls the
name)
If your program does not make temporary filerefs, you can use this fact:
The highest valued #LN* fileref in SASHELP.VEXTFL (aka SQL DICTIONARY.FILES)
is the most recent file loaded into a SAS editor of the DMS session.
A toolbar button could do
GSUBMIT 'proc sql noprint;select xpath into :XPATH from dictionary.extfiles
where fileref like "#LN%" having
fileref=max(fileref);quit;';%LOGSAVE(ofSourceMVAR=XPATH)
LOGSAVE would have to be 'pure macro' and emit texts that can be interpreted
as commands.
You would have to write LOGSAVE. It would extract dir and name parts of
&ofSourceMVAR and construct the filename you want to save to. Finally
generate text that looks like
LOG;FILE "<somepath>\<somefile>-<sometimestamp>.log";
Its possible that the LOGSAVE macro could text-gen the GSUBMIT. Note: I
call it text-gen instead of code-gen because the context that the macro is
running in is the command processor (not the submit executor.)
--
Richard A. DeVenezia
http://www.devenezia.com/