Character Separated Value (CSV) files and reports

You can download the CSV files and reports from the mainframe, or place them on the mainframe web server, and import them into many commonly used spreadsheets.

To create a CSV file, you use one or more DISPLAY statements with a SEP= parameter.

To create a CSV report , you code a standard REPORT statement with a SEP= parameter.

Syntax

Read syntax diagramSkip visual syntax diagramSEP=(' &char'MASK)
Where:
&char
One or more characters to insert
MASK
Mask option:

If MASK is coded, Migration Utility uses the field mask as coded on the field definition or the default mask. For example, 123,456.88.

If MASK is not coded, Migration Utility formats numeric fields without edit characters and inserts the decimal point and a leading sign. For example, -123456.88.

The SEP= parameter triggers Migration Utility to inserts the specified characters after each field.

Examples:

Create comma-separated fields to a file named CSVFILE1 (assume that all fields on the DISPLAY statement are defined and that FILE CSVFILE1 F (100) has been defined).

  1. To create field values for the CSVFILE1 file without edit characters, write:
    DISPLAY CSVFILE1 SEP=(',') FIELD1 'CSV TEST RECORD ' FIELD2 FIELD3
  2. To create fields for the CSVFILE1 file with the default MASK, write:
    DISPLAY CSVFILE1 SEP=(',' MASK) FIELD1 'CSV TEST RECORD '  FIELD2 FIELD3
  3. To create report RPT1 with CSV fields without edit characters, write:
    REPORT RPT1 SEP=(',') …
  4. To create report RPT1 with CSV fields with the default MASK, write:
    REPORT RPT1 SEP=(',' MASK) …

Job JCMUDRL2, located in SYS1.SFSYJCLS, contains a complete example of a program that creates a CSV file and a CSV report.