Using a set-up file to read ASCII data into Stata The download file is saved to the desktop. The first step is to remove the files from the zip folder that are needed to read in the data. Double-click on the icon to open the folder. Look for the file that ends with.do. This is the set-up file. The other two files that are needed are the data.txt file, and the dictionary file, which ends with set-up.dct. Simply drag and drop these files to the desktop. When using a study with multiple dataset, be sure to use the Set-up, Data, and Dictionary files that have the same dataset number. The next step is to modify the Set-up file. To open the Stata set-up file, right-click on the icon and select the OPEN WITH option and select WordPad. Or launch WordPad from the Start menu and point to this file on the desktop. The first line in this file is the set mem command. This line tells Stata how much available RAM to use running this file. A large dataset may require that the default,6 mg, be increased. When using INTERCOOL version, the study size should be checked. Some ICPSR studies are very large and may not run with this version.
To display the box, put the cursor on the icon and right-click. Go to Properties. And left-click. Set the box next to WordPad. Look for the section that begins with Local raw_data DATA-FILENAME Each line in this section must have the place-holder, seen here with quotation marks, replaced with the location of the actual files. Edit DATA-FILENAME by replacing it with information from the Data file s Properties Box. Highlight only DATA-FILENAME. Click on the Properties Box and go to the line, Location. Select the text and copy it. Click on WordPad and, as DATA-FILENAME is already highlighted, paste over it. Then, add a backslash.
Now, we need to add the filename. Go back to the Properties Box. At the top, find the notepad icon. The name of the file is next to the icon. Select and copy the filename. Click on WordPad. As the cursor is still in the line being edited, we can paste it right in. Close the Data.txt file s Properties Box. Make the same change to the next line. This time, edit DICTIONARY- FILENAME, with information from the Dictionary file s Property Box. Highlight only DICTIONARY-FILENAME. To display the Dictionary file s Property Box, put the cursor on the icon and right-click. Go to Properties. And left-click. Set the box next to WordPad.
Click on the Properties Box and go to the line, Location. Select the text and copy it. Click on WordPad and, as DICTIONARY-FILE- NAME is already highlighted, paste over it. Then, add a backslash. Next, add the filename. Go back to the Properties Box. At the top, find the notepad icon. The file name is next to the icon. Select and copy the filename. Click on WordPad. As we left the cursor in the line that we are editing, we can paste it right in. The Location line from this Property Box is needed. So, leave the box open, for now.
The last line to edit is STATA-DATAFILE. The new name and location of this file need to be specified. Save it to the desktop, and name the file icpsr2167. Highlight only STATA-DATAFILE. The Properties Box for the Dictionary file is still open, so that the desktop path can be copied. Copy the Location line, that points to the desktop, and paste it over the highlighted STATA-DATAFILE. Then add a backslash. Then, name the file in a descriptive manner, icpsr 2167.
Finally, save the set-up file. Name it EDITED2167. setup.do and save it to the desktop. With all of the paths defined and the output file specified, this file is ready to run. From the Start menu, launch Stata. Go to File, then, DO, switch to Desktop view and select the file, EDITED2167.setup.do. 6
When the program indicates that the requested process has been executed, the file is ready to be used. To open the file next time, launch Stata from the start menu. The commnand line for opening the file is: use FILE-NAME clear. When data loads, the variable list will be visible, and the current status will be in the Results window. 7