Date: Sat, 5 Jul 2008 07:57:04 -0700
Reply-To: KL <Kev.L.Scott@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: KL <Kev.L.Scott@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: Extending the power of SAS software using other software
packages
Content-Type: text/plain; charset=ISO-8859-1
On Jul 5, 2:57 am, RolandRB <rolandbe...@hotmail.com> wrote:
> On Jul 5, 7:55 am, KL <Kev.L.Sc...@gmail.com> wrote:
>
>
>
>
>
> > On Jul 4, 5:03 am, RolandRB <rolandbe...@hotmail.com> wrote:
>
> > > On Jul 4, 6:21 am, KL <Kev.L.Sc...@gmail.com> wrote:
>
> > > > On Jul 3, 2:20 pm, RolandRB <rolandbe...@hotmail.com> wrote:
>
> > > > > Extending the power of SAS software using other software packages
>
> > > > >http://www.datasavantconsulting.com/roland/sasplus.html
>
> > > > Useful information. Some useful tools that I use when I have to
> > > > utilize R, MATLAB, and other system executables are the %xlog %xlst
> > > > macros. These are delivered in sas/core which is associated with every
> > > > SAS install. These macros pipe commands to the OS which allows for
> > > > more information to be gathered with respect to OS errors.
>
> > > > %xlog takes one argument which is to be executed with the command
> > > > shell of the OS you are running and it returns STDOUT and STDERR back
> > > > to the SAS log location(unless they are redirected).
>
> > > > %xlst takes one argument which is to be executed with the command
> > > > shell of the OS you are running and it returns the STDOUT and STDERR
> > > > back to the SAS output location(unless they are redirected).
>
> > > > Unix directory listing example:
>
> > > > %xlog(ls -la);
> > > > %xlst(ls -la);
>
> > > > Windows example:
>
> > > > %xlog(dir);
> > > > %xlst(dir);
>
> > > I tried calling those macros from version 8.2 SAS and it couldn't find
> > > them. I'll try with SAS v9.1.3 this evening, but I could not find the
> > > documentation on them. Is there a URL you know of?- Hide quoted text -
>
> > > - Show quoted text -
>
> > The following clones xlog:
>
> > %macro xlog_clone(cmd);
>
> > %let sysrc=0;
>
> > %if %nrbquote(&sysscp)=OS %then %do;
> > %put %nrstr(%%xlog is not supported on) &sysscp &sysscpl;
> > %let sysrc=1;
> > %goto exit;
> > %end;
>
> > option nonotes;
> > filename cmd pipe "&cmd";
> > data _null_;
> > file log;
> > infile cmd;
> > input;
> > put _INFILE_;
> > run;
> > option notes;
>
> > %exit:
>
> > %mend xlog_clone;- Hide quoted text -
>
> > - Show quoted text -
>
> %xlog and %xlst works fine in sas v9.1.3 . I like it. Very useful! I
> can't understand why it is not documented, though. I'm a bit reluctant
> to use undocumented features.- Hide quoted text -
>
> - Show quoted text -
filename pipe is a fully documented feature in SAS, in additio to all
the macro/base SAS functions and statements which are used in the
macro. I would not worry about using it.
|