To run a production export data, you need to customize its behavior by creating a PFF file. You then use the PFF as a command line parameter for CSExport.exe (the associated filename of this utility). For example, if you name your PFF file MyExport.exf.pff, then you run the export program by invoking:
"C:\Program Files (x86)\CSPro 8.0\CSExport.exe" MyExport.exf.pff
This assumes that CSPro was installed in the default directory. Your PFF file must have a .pff extension.
You can create a PFF file in one of two ways: either [1] create one with a text editor (such as Notepad or Wordpad), or [2] have it generated automatically for you by launching CSExport, making desired field and export type selections to the chosen dictionary,
saving your selections to an export specification file, then running CSExport. You can also manipulate PFF files in logic by using the
Pff object.
Note that when CSExport generates a PFF file it automatically appends .pff to the export specifications file name, e.g., MyExport.exf.pff. If the export specification is not saved then the generated PFF file will be deleted after the run.
The following examples show the options available to you in an export PFF file. A PFF file is not case sensitive, so you can use any combination of upper and lower case text.
[Run Information]
Version=CSPro 8.0
AppType=Export
[Files]
Application=.\MyExportSpecs1.exf
InputData=.\MyData.dat
ExportedData=.\Exported.dat
Listing=.\MyExportSpecs1.exf.lst
SPSSDescFile=.\Exported.sps
SASDescFile=.\Exported.sas
STATADescFile=.\Exported.dct
STATALabelsFile=.\Exported.do
RDescFile=.\Exported.R
[ExternalFiles]
MY_DICT=.\MyData.dat
[Parameters]
ViewListing=Always
ViewResults=Yes
Language=LN
[Run Information]
Version=CSPro 8.0
AppType=Export
[Files]
Application=.\MyExportSpecs2.exf
InputData=.\MyData.dat
ExportedData=.\Housing.dat
ExportedData=.\People.dat
Listing=.\MyExportSpecs2.exf.lst
[ExternalFiles]
MY_DICT=.\MyData.dat
[UserFiles]
FILE_HOUSING=.\Housing.dat
FILE_PEOPLE=.\People.dat
[Parameters]
ViewListing=OnError
ViewResults=No
Language=LN
The [Run Information] block is required and must appear exactly as shown in the example above.
The [Files] block is required and defines all files used in the export run. A description of the files is as follows:
- Application=the export specification file that you created.
- InputData=the data file that will be exported from.
- Listing=a report of the export operation.
- ExportedData=a text file that will contain the exported data.
- SPSSDescFile=an SPSS file, if the chosen export format was SPSS.
- SASDescFile=a SAS file, if the chosen export format was SAS.
- STATADescFile=a Stata description file, if the chosen export format was Stata.
- STATALabelsFile=a Stata labels file, if the chosen export format was Stata.
- RDescFile=a R script file, if the chosen export format was R.
The [ExternalFiles] block is required. It relates the dictionary name to the data file that will be exported from.
The [UserFiles] block is required only when there are multiple exported files. It relates the internal names to the exported data files.
The [Parameters] block is optional. ViewListing determines whether the listing file is viewed. There are three options:
- ViewListing=Always means you will always see the generated listing file.
- ViewListing=Never means you will never see the generated listing file.
- ViewListing=OnError means you will see the generated listing file only if an error(s) occurred during the run.
If the ViewListing entry is missing, the default action will be OnError.
ViewResults determines whether or not the exported file(s) are displayed with Text Viewer at the end of the run. The available choices are Yes or No. If the ViewResults entry is missing, the resultant data file(s) will be displayed by default.
Language specifies the language that is used when exporting labels.