Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Transferring between Mac And Windows versions

From   Andrés González Rangel <>
Subject   Re: st: Transferring between Mac And Windows versions
Date   Fri, 31 May 2013 21:38:58 -0500


Although Stata is very platform friendly, there is a couple of things that must be considered when working in two computers, one with Mac and the other with Windows:

- If you use special characters such as á, ö or ñ in your variable labels or in your comments, you will notice that in one of the computers those are displayed wrong. Windows uses ISO or UTF character encoding systems, while Mac uses its own. I still have no solution for that.

- In windows is easy to find user-written programs (what is called personal/plus ado files). Typing sysdir on each computer you will see where Stata keeps those files.

- If you manage do files (automated set of commands) and those files have instructions to open/save files or begin logs (record of the Stata session), the file path will be different, depending on which operating system you made the do file on the first place. You could have one do file for each platform, but that would be cumbersome if you make several changes. To make your do files "universal" across Mac and Windows, I suggest using macros:

	if regexm(c(os),"Mac") == 1 {
	local mypath = "/Users/youruser/custompath/myfolder"
	else if regexm(c(os),"Windows") == 1 local mypath = "c:/documents/custompath/my folder"

Translated that will be "If this computer has Mac, please create a macro called mypath with my custom Mac folder (in this example /Users/youruser/custompath/myfolder/), if it is Windows, please assign use this other custom Windows folder (in this example "c:/documents/custompath/my folder") to that macro"

After that, you can put the macro whenever you need a file path. For example:

	use "`mypath'/data.dta"
	log using "`mypath'/mylog.dta", replace

By doing that your do files will work perfectly in both operating systems.

Hope you can find this helpful in the future.

Kind regards,

*   For searches and help try:

© Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index