USECSPRO: Dumping recordsDumping records is a process where all data records of a particular file are saved to multiple disk files accessible to Stata. 'Dumping' should not be confused with 'dropping'. usecspro never modifies original CSPro dictionary or data files. Think of dumping as a recursive repetitive operation which is data extraction from every record of every level of the specified file. In fact this is a utility, which is built on top of usecspro for convenience and demonstrates how it can be applied for common tasks. Warning: dumping all records is (potentially) a time-consuming operation and may take a while to complete. To dump all the data from a particular file type the following Stata command: cspro dump "file.dcf" and Stata will dump all records of all data levels as separate datasets into a subfolder. Datasets are nested into subfolders with name of the level. Note that target directory is not a parameter. Target directory is dictionaryname_DUMP in the folder where dictionary is located. The directory will be created if it does not exist. The subdirectories corresponding to data levels will also be created automatically. Also note that the data file is not specified. It is assumed to be named the same as the dictionary file, but with the extension *.dat. An equivalent Mata function to dump all data records from a CSPro database is: cspro_dump_simple("dictionary.dcf") A more flexible Mata function is: cspro_dump("dictionary.dcf", "data.dat", "folder") It allows specifying both data file to be used and destination directory. When cspro dump is started without a dictionary filename it pops up a dialog requesting it from the user: ![]() Warnings and notifications in the process are issued separately for each record and are sometimes quite numerous. In order to be able to review them with care, it is recommended to set up logging before initiating the data dump. |