UNLD FORMAT
nullspec
fieldspec
The following table lists valid formats and their valid abbreviations:
Valid formats and abbreviations
Format | Abbreviation |
---|---|
DSNTIAUL | DSN or IBM |
EXTERNAL | EXT |
UNLOAD | UNL |
DELIMITED | DEL |
ASCIIDEL | ASC |
For more information about these formats, see Output-file-formats.
DSNTIAUL and EXTERNAL
You can use the NULLCHAR keyword with the FORMAT DSNTIAUL and FORMAT EXTERNAL options. For the NULLCHAR syntax, see the nullspecsyntax diagram.
When you download a nullable field from the table, BMC AMI Unload places a marker in the unloaded data trailing the field, leading it, or in front of the unloaded record. The marker may have from one to four characters.
With the UPFRONT specification, BMC AMI Unload places all nullable column markers in the entire record at the beginning of the record in an array format. For example, if four nullable columns are in the record and the null marker is ?, the first and third are nulls, but the second and fourth are not. Therefore, there are four characters at the beginning of the record corresponding to the four nullable columns. These characters have the values in hexadecimal X'6F006F00', where X'6F' is ?. BMC AMI Unload uses this hexadecimal when converting from CA unload. The generated load statement has a NULLIF clause with correct position values in the null markers array.
The NULLCHAR specification must be coded immediately after FORMAT DSNTIAUL or FORMAT EXTERNAL.
The default value for string is a question mark ('?'). The default position is TRAILING.
The field content when its value is null is binary zeros. Conversely, when the nullable field is not null, the null marker is set to binary zeros.
UNLOAD
The following considerations apply to FORMAT UNLOAD:
- Do not use MODE(DB2SQL) or MODE(AUTO) with FORMAT UNLOAD.
If you specify a SELECT statement that uses a subset of columns in the table, you cannot reload the results into any table. Use this type of SELECT statement with FORMAT UNLOAD only to produce an output file that you can then reference in a WHERE or WHEN clause of a discard specification in BMC AMI Reorg, as shown in the following example:
DISCARD FROM TABLE tableName WHERE colName IN
(FILE(fileName),FORMAT(UNLOAD)
DELIMITED
You can use the following additional keywords with the FORMAT DELIMITED option.
COLDEL | Specifies the column delimiter to use in the unload file. The default value is a comma. For ASCII and UTF-8 data, this is X'2C'; for EBCDIC data it is X'6B'. |
---|---|
CHARDEL | Specifies the character string delimiter to use in the unload file. The default value is a double quotation mark. For ASCII and UTF-8 data this is X'22'; for EBCDIC data, it is X'3F'. Character strings that contain the character string delimiter repeat the character string delimiter where it is used in the character string. BMC AMI Load interprets any pair of character delimiters found between the enclosing character delimiters as a single character. For example, the phrase 'FRED''S JOB' is interpreted as 'FRED'S JOB'. BMC AMI Load recognizes these character delimiter pairs for only the CHARACTER, VARCHAR-keyword, and CLOB fields. Character string delimiters are required only when the string contains the CHARDEL character. However, you can put the character string delimiters around other character strings. |
DECPT | Specifies the decimal point character to use in the unload file. The default value is a period. For ASCII and UTF-8, this is t is X'2E'. The only allowed delimiters for DECPT are the period (.) or the comma (,), or their equivalents in ASCII or UNICODE. |
ASCIIDEL
You can use the following additional keywords with the FORMAT ASCIIDEL option.
FIELDSEP | Overrides the ULDPARMS FIELDSEP parameter for an individual unload statement You can specify any single character. |
---|---|
CHARFLDDLM | Overrides the ULDPARMS CHARFLDDLM parameter for an individual unload statement The specification allows a single character to the left of the field and a single character to the right of the field. If the AND is omitted, then BMC AMI Unload uses the same character for left and right. |
NULLSTRING | Sets a value for a nullable field that is NULL The maximum length of the null string is four and it defaults to none (for example, a string of length 0). |