Information icon IBM InfoSphere DataStage and InfoSphere QualityStage, Version 8.5
space Feedback

Export: syntax and options

Terms in italic typeface are option strings you supply. When your option string contains a space or a tab character, you must enclose it in single quotes.

export
  { -file filename | -fileset listName.fs
  -destination  progname  [ args ] | destinationlist  filename  }
  { -schema  schema  | -schemafile  schemafile  }
  [-add_bom { utf16be | utf16le | utf8 }
  [-append]
  [-create | -replace | -discard_records | -discard_schema_and_records]
  [-diskpool  diskpool ]
  [-dontUseOffsetsWithDestinations]
  [-filter  command ]
  [-firstLineColumnNames]
  [-maxFileSize  numMB ] [-nocleanup]
  [-overwrite]
  [-prefix  prefix ]
  [-rejects continue | fail | save]
  [-single[FilePerPartition]]
  [-suffix suffix]
  [-writeSchema | -omitSchema]
Note: The following option values can contain multi-byte Unicode characters:

There are two types of required options:

Table 1. Export operator options
Option Use
-add_bom -add_bom { utf16be | utf16le | utf8 }

With this option you can add a BOM to your exported file.

The utf16be value specifies FE FF, utf16le specifies FF FE, and utf8 specifies EF BB BF.

-append -append

Append exported data to an existing file. By default the step terminates if you attempt to export data to a file that is not empty. This option overrides the default behavior.

You cannot use this option with -overwrite.

-destination -destination prog_name [args]

In single quotation marks specify the name of a program that reads the data generated by the export operator. Specify the program's arguments, if any. InfoSphere® DataStage® calls prog_name and passes to it any specified arguments.

You can specify multiple -destination options to the operator: for each -destination, specify the option and supply the prog_name and args (if any). The prog_name and args values might contain multi-byte Unicode values.

If this export operator runs as part of a checkpointed step, InfoSphere DataStage calls prog_name once for each iteration of the step.

InfoSphere DataStage always appends three additional arguments to prog_name:

prog_name [ args ] -s H L

where H and L are 32-bit integers. For the first step iteration, or if the step is not checkpointed, H and L are set to 0.

For each subsequent iteration of a checkpointed step, H and L specify the (64-bit) byte offset (H = upper 32 bits, L = lower 32 bits) of the exported data in the total export stream from the operator.

After all data has been written to the program, prog_name is called once more with an appended switch of -e (corresponding to end of file) and is not passed the -s switch. On last call prog_name can perform any final operation, for example, write a trailing label to a tape.

If the export operation fails, InfoSphere DataStage calls prog_name once with the appended switch -c (cleanup) and no -s switch. This gives the program an opportunity to clean up.

You cannot use this option with -filter.

-destinationlist -destinationlist file_name

Specifies in single quotation marks file_name, the name of a file containing the names of multiple destination programs, where each command line is listed on a separate line of the file. file_name might contain multi-byte Unicode characters.

InfoSphere DataStage calls the programs as if you specified multiple -destination options. See the description of -destination for more information.

-dontUseOffsetsWith Destinations -dontUseOffsetsWithDestinations

Do not supply the -s, H, L arguments to destination programs. This means that the byte offset is always 0. See the -destination option for more information.

-file -file [nodeName:]outFile0

Supply the name of an output file or pipe. The file or pipe must be empty unless you specify either the -append or -overwrite option. You can include multiple -file options to specify multiple input files. For each one, specify -file and supply the file name. The file name can contain multi-byte Unicode characters.

Note: You can specify a hyphen to signal that export writes its output to the stdout for osh.

You cannot use this option with -fileset.

-fileset -fileset filesetName.fs {-create | -replace | -discard_records |-discard_schema_and_records} [-diskpool diskpool] [-maxFileSize numMB] [-prefix prefix] [-single[FilePerPartition]] [-suffix suffix] [-writeSchema | -omitSchema]

Specifies the name of the file set, filesetName, a file into which the operator writes the names of all data files that it creates. The suffix .fs identifies the file to InfoSphere DataStage as a file set. filesetName can contain multi-byte Unicode characters.

The name of each export file generated by the operator is written to filesetName.fs, one name per line.

The suboptions are:

-create: Create the file set. If it already exists, this option generates an error.

-replace: Remove the existing fileset and replace it with a new one.

-discard_records: Keep the existing files and schema listed in filesetName .fs but discard the records; create the file set if it does not exist.

-discard_schema_and_records: Keep existing files listed in filesetName .fs but discard the schema and records; create the file set if it does not exist.

The previous suboptions are mutually exclusive with each other and also with the -append option.

-diskpool diskpool: Specify the name of the disk pool into which to write the file set. diskpool can contain multi-byte Unicode characters.

-maxFileSize numMB: Specify the maximum file size in MB. Supply integers. The value of numMB must be equal to or greater than 1.

-omitSchema: Omit the schema from filesetName .fs. The default is for the schema to be written to the file set.

-prefix: Specify the prefix of the name of the file set components. It can contain multi-byte Unicode characters. If you do not specify a prefix, the system writes the following: export username, where username is your login.

-replace: Remove the existing file set and create a new one.

-singleFilePerPartition: Create one file per partition. The default is to create many files per partition. This can be shortened to -single.

-suffix suffix: Specify the suffix of the name of the file set components. It can contain multi-byte Unicode characters. The operator omits the suffix by default.

-writeSchema: Use only with -fileset. Write the schema to the file set. This is the default.9

You cannot use -fileset with -file or -filter. "File Sets" discusses file sets.

-firstLineColumnNames [-firstLineColumnNames]

Specifies that column names be written to the first line of the output file.

-nocleanup -nocleanup

Configures the operator to skip the normal data file deletion if the step fails. By default, the operator attempts to delete partial data files and perform other cleanup operations on step failure.

-overwrite -overwrite

The default action of the operator is to issue an error if you attempt to export data to a file that is not empty. Select -overwrite to override the default behavior and overwrite the file.

You cannot use this option with -append or -replace.

-rejects -rejects continue | fail | save

Configures operator behavior if a record is rejected. The default behavior is to continue. Rejected records are counted but discarded. The number of rejected records is printed as a log message at the end of the step.

However, you can configure the operator to either fail and terminate the job or save, that is, create output data set 0 to hold reject records.

If you use -rejects fail, osh generates an error upon encountering a record that cannot be successfully exported; otherwise osh generates a warning upon encountering a record that cannot be successfully exported.

-schema -schema record_schema

Specifies in single quotation marks the export record schema. You can also specify a file containing the record schema using the syntax:

-schema record @file_name

where file_name is the path name of the file containing the record schema. The file_name and record_schema can contain multi-byte Unicode characters.

You cannot use this option with -schemafile.

-schemafile -schemafile schema_file

Specifies in single quotation marks the name of a file containing the export record schema. The file name can contain multi-byte Unicode characters.

This is equivalent to:

-schema record @ schema_file

You cannot use this option with -schema.

-filter -filter command

Specifies a UNIX command to process all exported data after the data set is exported but before the data is written to a file. command can contain multi-byte Unicode characters.

You cannot use this option with -fileset or -destination.


PDFThis topic is also in the IBM InfoSphere DataStage and QualityStage Parallel Job Advanced Developer's Guide.

Update timestamp Last updated: 2012-10-8