Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: SAS libname equivalent


From   Fred Wolfe <[email protected]>
To   [email protected]
Subject   Re: st: SAS libname equivalent
Date   Wed, 28 Jan 2004 14:48:48 -0600

At 01:54 PM 1/28/2004, you wrote:
What is the correct way in Stata to establish pointers to paths in Windows XP, something along the lines of the LIBNAME and FILENAME statements in SAS? Can this be done using Windows environment variables? Can it be done without? Can it be done at all?! I've found the ability to do this in other environments critical to maintaining shared code.
We put lines in our profile.do file like these


global pdox c:/statdata/pdox232e/
global sql c:/statdata/sql232e/


We then reference them in our programs like this:

use ${sql}drugfile, clear

In our system, all folders (directories) are placed in c:\statdata\

To use a different set of directories or files in different locations, change the global macro content but always use the same macro name. This can be done at the command line or with a simple program

. dversion 231f
Databank version set to 231f

. dversion 232e
Databank version set to 232e




Fred Wolfe



Fred Wolfe
National Data Bank for Rheumatic Diseases
Wichita, Kansas
Tel (316) 263-2125 Fax (316) 263-0761
[email protected]


*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index