sas >> Relative v.s. Full paths

by webonomic » Thu, 18 Jan 2007 13:49:19 GMT

In my sas code located in C:\folder1\folder2\file.sas, I have this
code:
%INCLUDE "C:\folder1\test.sas";

Can I use a relative path to test.sas instead of the full path? Can I
do the same for Libnames?

I tried %INCLUDE "../test.sas"; and it could not find test.sas. Maybe
different syntax is needed?

When I try creating relative libnames in file.sas, it always ends up
pointing to c:\documents and settings\username even though my Sasuser
and Work stuff is on my E drive.

Example
libname rel "../";


Thanks,
Jared


sas >> Relative v.s. Full paths

by art297 » Thu, 18 Jan 2007 21:04:09 GMT


Jared,

Take a look at http://xrl.us/ubb8 .

Art
--------

sas >> Relative v.s. Full paths

by tobydunn » Thu, 18 Jan 2007 22:02:20 GMT

Define a filename and use that instead. YOu might want to look it up in the
docs it shows how to do this.

Filename Programs
"/abcd/DiseaseAndInjury/blah blah/Base" ;

%Include Programs( CreateFolders.sas
Universe.sas
UniverseProfile.sas
Rates.sas
Reports.sas
Graphs.sas ) ;


Toby Dunn

To sensible men, every day is a day of reckoning. ~John W. Gardner

The important thing is this: To be able at any moment to sacrifice that
which we are for what we could become. ~Charles DuBois

Don't get your knickers in a knot. Nothing is solved and it just makes you
walk funny. ~Kathryn Carpenter






From: webonomic < XXXX@XXXXX.COM >
Reply-To: webonomic < XXXX@XXXXX.COM >
To: XXXX@XXXXX.COM
Subject: Relative v.s. Full paths
Date: Wed, 17 Jan 2007 21:49:19 -0800

In my sas code located in C:\folder1\folder2\file.sas, I have this
code:
%INCLUDE "C:\folder1\test.sas";

Can I use a relative path to test.sas instead of the full path? Can I
do the same for Libnames?

I tried %INCLUDE "../test.sas"; and it could not find test.sas. Maybe
different syntax is needed?

When I try creating relative libnames in file.sas, it always ends up
pointing to c:\documents and settings\username even though my Sasuser
and Work stuff is on my E drive.

Example
libname rel "../";


Thanks,
Jared

_________________________________________________________________
Type your favorite song. Get a customized station. Try MSN Radio powered
by Pandora. http://radio.msn.com/?icid=T002MSN03A07001

sas >> Relative v.s. Full paths

by webonomic » Fri, 19 Jan 2007 05:21:17 GMT

Very nice, that is just what I was looking for. Thanks!

jared

sas >> Relative v.s. Full paths

by spam » Fri, 19 Jan 2007 05:53:52 GMT

All you need to do, is making sure SAS starts in the folder where your
program is and not in (c:\documents and settings\username. This will always
happen when you run your program in batch and can be setup easily on
Windows when you work inter-actively: see http://xrl.us/ubjj and
http://xrl.us/ubjo

After this you can use relative pathnames.

Lex Jansen

Please reply to the newsgroup. In order to fight spam and virusses replies
to my email address listed in this post will be deleted without reading.
If you want to reply to me personally, please replace "spam" with "admin"
in the e-mail address.
An alternative means of contact is the form at:
http://www.lexjansen.com/feedback





the
you
powered

Similar Threads

1. PROC PRINT TO using relative path

Hi
Can we use PROC PRINTTO to pring log using relative paths. Hardcoding
the path is creating probblems when moving code from Dev to Test
servers.
or, is there any alternative to it.

Thanks,

Current Environment: Windows 2003, SAS Stored process server, SAS
Metadata server

2. Getting full path without filename

3. Getting Script Full File Path using

4. Obtaining the Filename and Full Path of Submitted Programs

5. Using genmod to obtain relative risks and adjusted relative risks

I'm using the following code to generate relative risks


PROC GENMOD DATA=SAVE.TTIF
;


  CLASS ID  CM01
;


    MODEL TNTR=CM01          / DIST=POI
LINK=LOG;


       REPEATED SUBJECT = ID /
TYPE=UNSTR;




*                                  Y  N                                ;

     ESTIMATE 'Y > N'   CM01        1 -1               /  EXP ALPHA=.05 ;

with over 100,000 cases, this is taking a long time, and I have a number of
predictors
I want to look at.

I realize I can get the relative risks in this bivariate model more easily
with proc freq
but plan to add additional variables to obtain adjusted relative risks.

Is the large sample size a known concern with genmod?  Proc logistic
handles this sized
data set with no problem even when adjusted for other categorical and
continuous predictors,
although I get Odds Ratios rather than relative risks.

If so, is there a "work around?"

As always, thanks in advance for your help.






______________________________________________________________________

Kevin F. Spratt, Ph.D.
Department of Orthopaedic Surgery
Rubin 561
One Medical Center Drive
Lebanon, NH 03756-0001

(603) 653-6012                  (voice)
(603) 653-6013                  (fax)
 XXXX@XXXXX.COM     (e-mail)
_______________________________________________________________________

6. Is it possible to specify a relative path in an SQL view?

7. FW: x command to start a window program with the full path?

The problem is that I have to specify the full path of distiller. While
Robin's tip is good in that I don't have to specify the path of
distiller, it also will not accept the two switches :-(

-----Original Message-----
From: data _null_, [mailto: XXXX@XXXXX.COM ]
Sent: Friday, January 11, 2008 7:09 AM
To: Huang, Ya
Cc:  XXXX@XXXXX.COM 
Subject: Re: x command to start a window program with the full path?

From your somewhat related tread from 20NOV09.

You wrote...

I actually found the same document before seeing your post, and yes,
there are two 'switches' that I have to use to make it work:

x "'C:\Program Files\Adobe\Distillr\AcroDist.exe' /n/q
""&dir.temp.ps""";

/n to initiate new instance, /q to stop distiller. They have to be used
in pair.

On Jan 10, 2008 8:12 PM, Ya Huang < XXXX@XXXXX.COM > wrote:
> Robin,
>
> Thanks for the tip. I tested it and it dose bring up the application I
> need: Acrobat distiller, as long as the file is *.ps. The problem is
> that distiller wouldn't quit after finish the distill.
>
> I'm working on the 'start' command as Art suggest. It works fine,
> except I have to use xsync xwait options which will leave an opened
> DOS window.
>
> Ya
>
> On Thu, 10 Jan 2008 20:14:39 +1300, Robin Templer
> < XXXX@XXXXX.COM >
> wrote:
>
>
> >Ya
> >
> >This is the method I use in an AF application under SAS V9.  Use the
> >sas command 'winexecfile'  either from a DM statement or in SCL using

> >Call
> >ExecCMD() ;
> >
> >For exemple:
> >dm 'winexecfile "c:\temp\test.doc"' ;
> >
> >Will launch Word and open and EXISTING doc named c:\temp\test.doc.
> >Works for me with Word 2007 - which is installed in a different place

> >from Word
> >2003 (and other versions)  !
> >
> >Cheers
> >Robin
> >
> >-----Original Message-----
> >From: SAS(r) Discussion [mailto: XXXX@XXXXX.COM ] On Behalf Of
> >Arthur Tabachneck
> >Sent: Thursday, 10 January 2008 2:28 p.m.
> >To:  XXXX@XXXXX.COM 
> >Subject: Re: x command to start a window program with the full path?
> >
> >Ya,
> >
> >I was glad to see that you received an answer that worked.
> >Unfortunately, someone like me (whose server doesn't show where
> >winword exists or someone who doesn't have the authority to reset
> >paths) still wouldn't know what to do.
> >
> >Try the following command and let me know if it works as well:
> >
> >x "start winword.exe";
> >
> >It worked for me!
> >
> >Art
> >--------
> >On Wed, 9 Jan 2008 15:49:25 -0800, Huang, Ya < XXXX@XXXXX.COM >
wrote:
> >
> >>Thanks Ken,
> >>
> >>I tried it and it worked!
> >>
> >>Ya
> >>
> >>-----Original Message-----
> >>From: Ken Barz [mailto: XXXX@XXXXX.COM ]
> >>Sent: Wednesday, January 09, 2008 3:38 PM
> >>To: Huang, Ya
> >>Subject: RE: x command to start a window program with the full path?
> >>
> >>I believe that you can add C:\Program Files\Microsoft
> >>Office\OFFICE11 to the windows path variable.  This is found under
> >>the advanced tab in the system properties window, button called
Environment Variables.
> >>
> >>-----Original Message-----
> >>From: SAS(r) Discussion [mailto: XXXX@XXXXX.COM ] On Behalf Of

> >>Ya Huang
> >>Sent: Wednesday, January 09, 2008 4:26 PM
> >>To:  XXXX@XXXXX.COM 
> >>Subject: x command to start a window program with the full path?
> >>
> >>Hi there,
> >>
> >>x "'winword.exe'";
> >>x "'C:\Program Files\Microsoft Office\OFFICE11\winword.exe'";
> >>
> >>Is there a way to configure windows, so that when I use x command in

> >>SAS, I don't have to give the full path of the windows program?
> >>
> >>The first line won't work. The second line works.
> >>
> >>There must be a way, since I can type in the program name in the
> >>start/run window without having to give the full path.
> >>
> >>Thanks
> >>
> >>Ya
>

8. x command to start a window program with the full path?