Source URL: https://docs.surveycto.com/05-exporting-and-publishing-data/02-exporting-data-with-surveycto-desktop/06.using-stata.html
Last updated: 2023-01-25
Integrating with Stata
Generating .do file templates
See Using Stata for details on how to generate Stata .do file templates for your SurveyCTO forms. These templates import, merge, and label your data, using your form definition as a guide. They help you to get quickly up-and-running with Stata.
Automatically running your .do files
You can configure SurveyCTO Desktop to automatically run your .do files whenever you export new data. Just do the following:
- Create a subdirectory named thenrun within your chosen destination directory for Desktop exports. (This should be the directory you choose for the data destination when you sync data in Desktop, and it should match the CSV directory you choose when generating your .do file templates.)
- Save your .do files in that thenrun subdirectory.
- Configure Desktop to Auto-run other processors after export in its Export options. (See How do I automatically execute processes when new data becomes available? for more details.)
Whenever you export new data into the destination directory with the thenrun subdirectory, your .do files (and anything else in that thenrun subdirectory) will be run.