Date: Mon, 28 Jan 2008 05:23:48 -0800
Reply-To: Peter <crawfordsoftware@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Peter <crawfordsoftware@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: Windows installation directory
Content-Type: text/plain; charset=ISO-8859-1
On 27 Jan, 15:38, art...@NETSCAPE.NET (Arthur Tabachneck) wrote:
> Mehdi,
>
> I'm sure there is a more direct way to code it, but I think the following
> might capture what you are looking for:
>
> data _null_;
> %let percent=%nrbquote(%);
> filename sr pipe "echo &percent.systemroot&percent.";
> infile sr lrecl=300 truncover;
> input @1 sr $100.;
> %let sr=sr;
> put &sr.;
> run;
>
> HTH,
> Art
> ---------
> On Sun, 27 Jan 2008 00:49:32 -0500, Mehdi Soleymani
>
>
>
>
>
> <mehdi_soleym...@SOFTHOME.NET> wrote:
> >How can I retrieve Windows installation directory. for example I want
> have a
> >variable which contains windows installation directory, for example:
> >rc="C:\Windows"- Hide quoted text -
>
> - Show quoted text -
try
%put %sysget(sasroot) ;
The environment variable name is case sensitive on Unix platforms.
Review all environment variable names and values in data step( except
on EG with default NOXCMD option)
(untested)
data evars( compress= yes ) ;
length name $32 value $200 ;
filename pevars pipe 'set ' lrecl= 2000 ;
infile pevars truncover dlm='=' col= col;
input name @;
if name ne ' ' ;
value = substr(_infile_, col );
put name= / value /;
run;
PeterC
|