Dear Statalisters:
I have been re-trying every possible fix for the above-mentioned
problem, about which I contacted the list on Friday.
I was looking in the wrong place for the error, which turns out to be
trivial. The code that works appears below.
The problem was not with the global statements, but with the ensuing
display statements, which needed the -{- and -}- to force the
evaluation of the `ct' before expanding the global. The global
statements were apparently working just fine. It was the display
statements that were tripping me up by showing something else.
Have a good holiday weekend,
Trudy
foreach ct of numlist 1/$MAXLINES {;
global LINK_`ct'
"recordcase+z+lstatute_`ct'+z+lsystem_`ct'+z+lsourceid_`ct'+z+vlink_`c
t'";
global PROFILE_`ct'
"recordcase+z+pstatute_`ct'+z+psystem_`ct'+z+psourceid_`ct'+z+vprofile
_`ct'";
global INSPECT_`ct'
"recordcase+z+istatute_`ct'+z+isystem_`ct'+z+isourceid_`ct'+z+vinspect
_`ct'";
global ENFORCE_`ct'
"recordcase+z+estatute_`ct'+z+esystem_`ct'+z+esourceid_`ct'+z+venforce
_`ct'";
display "${LINK_`ct'}";
display "${PROFILE_`ct'}";
display "${INSPECT_`ct'}";
display "${ENFORCE_`ct'}";
}; * end setup of global statements for use in writing output data;
*
* 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/