![]() Delimiter Separated Lists |
![]() DEVELOPER |
![]() |
A new mode can be set to specify that report output is to be formatted as a Delimited Separated List (DSL). This is typically used where the output needs to be processed by another program. This could be the application that is using the P4API, or it could be a third party program.
The Delimiter is normally a comma or a tab character. The terms CSL or CSV are often used for Comma Separated List (or Values), and TSL or TSV for Tab Separated List (or Values). A delimiter sequence of up to four bytes may be used.
DSL mode can be used for any report destination type, not just for API output. Each record of the report output will be passed back to the calling program as the report is executed.
The returned data has the following characteristics:
Each field will be separated from the next by a delimiter string of one or more characters. The delimiters used are defined in the PROIV report destination settings.
Numeric fields are formatted as specified by the display code. This includes a numeric field with a value of zero (in contrast to non-DSL mode, where a zero numeric field produces blank output).
Fields that specify a Standard Validation, such as SSN, DATE or TIME, are formatted as specified.
Non-numeric fields are output with any leading or trailing spaces in the field data variable being preserved.
Data incorporating one or more delimiters (double quotes), or non-numeric fields that contain leading or trailing spaces will be surrounded by double quotes then separated by the specified delimiter. A double quote will be inserted before each double quote in the data.
Fields will be output in the order they are processed in the report. The column and row values are ignored.
All fields in one logical record will be sent as a single DSL record. So a report that normally prints fields across two or more print lines will be sent as a single DSL output record.
Blank lines are suppressed.
Page heading and Footer data is suppressed.
Control Break output data will be suppressed
End-of-report is signalled in a particular way through P4API.
Typically, the format of the report should be designed to be simple, to make it easy for the calling program to parse. For example, easy-to-parse reports might have the following attributes:
No dashed lines above and below totals and subtotals (in DSL mode Control Break data is suppressed);
The same number of fields on every line.
The PROIV function is constructed in the same way as any other PROIV report function. All the same features are available to the programmer.
One additional item needs to be set up: the Report Destination needs to specify DSL Mode. This is described in the next section. That definition also sets the separator characters used between fields in the returned data stream.
Topic ID: 540037