Stata failing to call global variable? -
the following simple thing doesn't work.
global inputfolder "c:\users\focus\google drive\1. hani and\raw data\2004" cd $inputfolder it says
invalid syntax but if
global inputfolder "c:\users" cd $inputfolder then works. tried, among others, adding "="
global inputfolder="c:\users\focus\google drive\1. hani and\raw data\2004" but didn't help.
what should make first thing work?
when write
global inputfolder "c:\users\focus\google drive\1. hani and\raw data\2004" cd $inputfolder stata substitutes global reference contents of global, cd sees
cd c:\users\focus\google drive\1. hani and\raw data\2004 but spaces problematic. advice prominent in cd (see e.g. http://www.stata.com/help.cgi?cd):
if directory_name contains embedded spaces, remember enclose in double quotes.
hence need
cd "$inputfolder" note difference between copying string global , assigning string global indeed makes no difference here, problem entirely in feeding cd string can't understand.
on point of terminology, note global macros not regarded variables in stata. term reserved columns in dataset.
Comments
Post a Comment