To reformat data in production mode, you'll need to customize its behavior by creating a PFF file. You can then use the PFF file as a command line parameter for CSReFmt.exe (the associated filename of this utility). For example, if you name your PFF file MyReFmt.pff, you can run CSReFmt by doing the following from the command prompt or a desktop icon:
"C:\Program Files (x86)\CSPro 8.0\CSReFmt.exe" MyReFmt.pff
This assumes that CSPro was installed in the default directory. Your PFF file must have a .pff extension.
The PFF file is a text file so you can create and modify it using any text editor (such as Notepad or Wordpad). A PFF file is not case sensitive, so you can use any combination of upper and lower case text. Or, you can run CSReFmt once, and a PFF file will be automatically created for you—it will be named CSReFmt.pff, and will be placed in the same folder as your input dictionary. You can also manipulate PFF files in logic by using the
Pff object. The following is an example of a CSReFmt PFF file.
[Run Information]
Version=CSPro 8.0
AppType=Reformat
Description=My Program
ShowInApplicationListing=Always
[Files]
InputData=.\MyInput.dat
OutputData=.\MyOutput.dat
Listing=.\CSReFmt.lst
InputDict=.\Input.dcf
OutputDict=.\Output.dcf
[Parameters]
ViewListing=Always
ViewResults=No
DisplayNames=Yes
The [Run Information] block is required. While Version and AppType must appear exactly as shown in the example above, there are two optional properties:
- 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 that could be used in the reformat process.
- At a minimum, the Listing=, InputDict=, and OutputDict= lines must be provided. If only these files are defined, then CSReFmt will compare the dictionaries and report what fields will be dropped, added, resized, or otherwise modified if the reformat were to occur. If the InputData and OutputData files are defined, then the reformat operation will actually take place.
- InputData is the data file to reformat from, and OutputData is the reformatted data file.
- By default, the listing file will be placed to the same folder as the OutputData file.
If
InputData points to a
data source with an embedded dictionary, then
InputDict does not need to be specified.
The [Parameters] block is optional.
- ViewListing= determines whether or not the report on the reformat operation is displayed with Text Viewer at the end of the run. The report only indicates what fields were dropped, modified, etc., it does not actually show you the newly reformatted data file. If ViewListing=Never, then the report is not displayed. If ViewListing=OnError, then you will only see the report if any error occurred during the compilation of the report. If ViewListing=Always, then the results will always be shown. If the line is missing the listing will be displayed by default.
- ViewResults= determines whether you view the newly reformatted data file. Available options are "Yes" and "No." If the PFF file was automatically generated, this entry will default to "No." If the line is missing the results will not be shown.
- DisplayNames= determines whether or show names or labels in the listing file. Available options are "Yes" (names) and "No" (labels).