To run a production sort, you need to customize its behavior by creating a PFF file. You can then use the PFF file as a command line parameter for CSSort.exe (the associated filename of this utility). For example, if you name your PFF file MySort.ssf.pff, then you run the sort program by invoking:
"C:\Program Files (x86)\CSPro 8.0\CSSort.exe" MySort.ssf.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 (a) launching CSSort, (b) making your desired field and sort type selections to the chosen dictionary, (c) saving your selections to a sort specification file (.ssf), and then (d) running CSSort. You can also manipulate PFF files in logic by using the
Pff object.
Note that when CSSort generates a PFF file it automatically appends .pff to the sort specification file name; for example, MySort.ssf.pff. If a sort specification file is not created, then no PFF file will be created after its run.
The following section shows the options available to you in a sort 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=Sort
Description=My Program
ShowInApplicationListing=Always
[Files]
Application=.\MySort.ssf
InputData=.\MyData.dat
OutputData=.\MySortedData.dat
Listing=.\CSSort.lst
[Parameters]
ViewListing=Always
ViewResults=Yes
The [Run Information] block is required. While Version and AppType must appear exactly as shown in the example above, the other two properties are optional:
- Description=if specified, it will be used instead of the name of the file in the list of applications (mobile only).
- ShowInApplicationListing=determines whether the application associated with this PFF is displayed on the mobile Entry Applications screen. The possible options are: Always (default), Never, and Hidden. Operators must manually elect to show hidden applications, whereas PFFs with the Never option will never be shown.
The [Files] block is required and defines all files used in the sort run. InputData is the file to be sorted, and it must be a .dat file (i.e., a text-based file). If the file you wish to sort is a .csdb file, then you must first create a .dat file. You can do this by launching DataViewer and choosing File > Save As > Data. Be sure the file extension is .dat.
OutputData is the sorted data file. Note the sorted data can be written to either a .dat file (i.e., a text-based file) or to a .csdb file.
The file given in the Listing entry determines what the sort's report will be named.
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 the sorted data file is displayed at the end of the run. Your options are "Yes" or "No." If the ViewResults line is missing, the sorted data file will not be displayed. By default CSPro creates this option and sets it to No.