VARCHAR keyword

VARCHAR defines a character string field that varies in length. For example, see the INTO example in Field specification (for BMC AMI Unload).

The following considerations apply to VARCHAR fields:

  • The format of the field overrides FIXEDVARCHAR YES.

  • To maintain consistency with your subsystem when converting from a DATE column, BMC recommends that you configure the ULDPARMS +DATEFMT parameter to DECP. To maintain consistency with your subsystem when converting from a TIME column, BMC recommends that you configure the ULDPARMS +TIMEFMT parameter to DECP.

MIXED

MIXED defines a mixed character field. BMC AMI Unload  converts the target field values to the MIXED CCSID encoding of the source column.

FILL

FILL tells BMC AMI Unload  how to handle leading zeros when converting data from a source with numeric data types. This capability supports applications such as COBOL that require leading zeros in order to edit and check unloaded data properly.

YES

When you specify FILL YES, BMC AMI Unload externalizes all leading zeros when converting numeric data types to their external representations. The first character in the external representation of the number is either a minus sign (-) or a plus sign (+). This capability supports applications such as COBOL that require leading zeros in order to edit and check unloaded data properly.

NO

When you specify FILL NO, BMC AMI Unload removes all leading zeros when converting numeric data types to their external representations.

(length)

The length indicates the number of single-byte characters. A 2-byte length field that contains the length of the character string in bytes precedes the VARCHAR string. This length does not include the two length bytes.

You can specify a length up to 32704 bytes.

The following considerations apply to length specifications:

  • Specifying a length shorter than the default can produce unpredictable results. For information about default lengths, see Character, graphic, and binary output.

  • When converting from a timestamp column and the specified length is greater than the default, BMC AMI Unload  pads the result with blanks.

  • For conversions from a CHARACTER or VARCHAR column, the following guidelines apply:

    • If the column length is greater than the specified field length, either the source values must contain blanks for the difference, or you must specify VARCHAR.

    • If the column length is less than the specified field length,  BMC AMI Unload adds blanks to the resulting value for the length difference.

  • For conversions from a GRAPHIC or VARGRAPHIC column when the column length is greater than two times the specified field length, either the source values must contain DBCS blanks for the difference, or you must specify VARCHAR.

TRIM

TRIM tells BMC AMI Unload to remove as many trailing blanks from the string as needed to make the string length match the length that you specify. If the string is still too long, a conversion error occurs. BMC AMI Unload applies TRIM before TRUNCATE.

TRIM is useful when you are converting from a VARCHAR column to a CHAR(n) or VARCHAR(n) field and you want to detect (by way of conversion error messages) nonblank data beyond position n.

TRIM does not remove trailing zeros when you are converting from a TIMESTAMP EXTERNAL or TIMESTAMP WITH TIME ZONE EXTERNAL field.

TRUNCATE

TRUNCATE tells BMC AMI Unload  to truncate a string if it is longer than the field (even after the TRIM option has truncated trailing blanks). BMC AMI Unload  performs TRUNCATE after TRIM.


Was this page helpful? Yes No Submitting... Thank you

Comments