Hello all:
I was trying to clean my code generating 4 temp files to hold 4 sheets of an imported excel file. While executing this outside a loop works perfectly, looping the process hang after the first sheet. -set trace on- gives me a r(602) error which indicates "master.dta already exists".
I was playing around with all possible double quotes in the local and realized I had no method to my trouble shooting after a point.
The usual way outside the loop works perfectly as below
I was trying to clean my code generating 4 temp files to hold 4 sheets of an imported excel file. While executing this outside a loop works perfectly, looping the process hang after the first sheet. -set trace on- gives me a r(602) error which indicates "master.dta already exists".
I was playing around with all possible double quotes in the local and realized I had no method to my trouble shooting after a point.
Code:
// Generate 1 master and 3 other temporary files to hold each of the sheets *--------------------------------------------------------------------------- clear frames reset local sheets "master ngs clinical transplant" set trace on foreach sheet of local sheets { tempfile `sheet' save "`sheet'", emptyok }
The usual way outside the loop works perfectly as below
Code:
* Unlooped version works *------------------------ tempfile master // pathology data sheet--all identifier sheet save "`master'" , emptyok tempfile ngs // ngs datasheet tempfile clinical // clinical datasheet tempfile transplant // transplant datasheet save "`ngs'" , emptyok save "`clinical'" , emptyok save "`transplant'", emptyok
Comment