Previous Topic: Accessing Exported DataNext Topic: Sample JCL (Comma-Separated Values)


Comma-Separated Values

For this option, the output data set is a sequential file. The rows are variable length, blocked format with a block size of 4096. The maximum length of any data row is 4088.

The data rows are written in comma-separated value format, with leading zeros in numeric fields and trailing blanks in character fields being suppressed. All blank character fields and all zero numeric fields are indicated by a comma immediately following the comma for the preceding field. Each set of data is labeled by its set name specified in the EXPORT command. It is important that you give each set a unique name so that it can be easily located in the data set.

Sample Record

Following is a sample record:

Record Descriptor Word    FIELDA      FIELDB    FIELDC
                          Record      Data      Data
                          Type

The first 4 bytes of any record contain the record descriptor word.

The first 2 bytes of this record descriptor word contain the length of the record, including the RDW. The first field is a keyword indicating the record type. Types used are:

Every output data set contains these three record types. The remaining fields are data values, separated by commas.

The data set can be downloaded to a PC, since this is in PC file format known as CSV.

Procedure

When you create your JCL member for exporting data, you need to specify the name of the data set to which the export data is to be written. The JCL member can specify any device type supported by IBM QSAM (z/OS). You can specify either a tape or disk file in your JCL member.

CA Dataquery has specific requirements for the DDname in your export JCL member name. In z/OS, the DDname must be DQOUT. In z/VSE, the DLBL name must be DQOUTD; the tape is unlabled.

In Sign/On mode, you can execute more than one query per execution of CA Dataquery Batch. CA Dataquery allows multiple EXPORT control statements. The EXPORT statements should follow the EXECUTE statement.

EXPORT Control Statement (z/OS)

A sample format for z/OS EXPORT control statements follows:

►►─ EXPORT ─ 'setname' ─┬────────────┬────────────────────────────────────────►◄
                        ├─ DETAIL ◄ ─┤
                        └─ TOTALS ───┘

EXPORT Control Statement (z/VSE)

A sample format for z/VSE EXPORT control statements follows:

►►─ EXPORT ─ 'setname' ─┬─────────────────────┬─┬─ DISK ─┬────────────────────►◄
                        └─ DETAIL ◄ ─ TOTALS ─┘ └─ TAPE ─┘

The EXPORT command may specify two types of output, either DETAIL or TOTALS. DETAIL type formats the values of the columns in the PRINT statement of the query in the data row. TOTAL prints subtotals when the data in a SORT column changes.

Note: DETAIL is the default and can be omitted.

TAPE and DISK are used only in z/VSE and are ignored for z/OS. In z/VSE, you must specify either TAPE or DISK to indicate the output media.

If you execute more than one EXPORT per any execution of CA Dataquery, batch writes all of the output sets to the same output sequential data set. In Sign/On mode you can specify the device type on the EXPORT command input statement, but all exports in any execution must be to the same output data set. You can write only one output data set per one execution of DQBATCH.

Note: The job control statements used to execute DQBATCH must contain the necessary data definition statements to define the output data set for the EXPORT command.

The type of device is determined only by the data definition statements in the JCL.