When all the parameters are known, it is sufficient to submit one command to import the data from CSPro into Stata:
usecspro using "data.dat", dictionary("dictionary.dcf") level("levelname") record("recordname")
one can add a 'clear' option to the above command if necessary.
Since -usecspro- is written in Mata language, it naturally provides a user accessible Mata function, which is equivalent to the above command:
cspro_convert("dictionary.dcf", "data.dat", "levelname", "recordname")
To request information about the program, author, and version, call the following Mata function:
cspro_about()
Or from Stata command line:
mata cspro_about()
There are also commands that control the interactive mode that can be issued to start a particular interactivity:
Stata | cspro dir ["path"] | Shows a list of CSPro files in the current (or specified) directory. |
Stata | cspro use ["file.dcf"] | Shows the data levels of the specified dictionary. If the file is not specified, opens a dialog to pick a file. |
Stata | cspro import ["file.dcf"] | same as above. |
Mata | cspro_import("folder") | Writes to the output a clickable list of the CSPro dictionary files in the specified directory. |
Mata | cspro_list_levels("dictionary.dcf") | Writes to the output a clickable list of data levels contained in the specified dictionary file. |
Mata | cspro_list_level_records( "dictionary.dcf", "levelname") | Writes to the output a clickable list of records for the specified data level in the dictionary file. |