/OUTPROCEDURE - Connect_ETL - 9.13

Connect ETL Data Transformation Language (DTL) Guide

Product type
Software
Portfolio
Integrate
Product family
Connect
Product
Connect > Connect (ETL, Sort, AppMod, Big Data)
Version
9.13
Language
English
Product name
Connect ETL
Title
Connect ETL Data Transformation Language (DTL) Guide
Copyright
2023
First publish date
2003
Last updated
2023-09-11
Published on
2023-09-11T19:01:45.019000

Purpose

To specify a procedure within a program as the target for records.

Format

/OUTPROCEDURE [record_attribute...]

where

record_attribute =

{field_delimiters}

{record_numbering} {encoding_attribute}

field_delimiters = [FIELDSEPARATOR separator] [enclosedby_setting]
enclosedby_setting = {ENCLOSEDBY leading_character [,trailing_character]]} {NOTENCLOSED }
record _ numbering = RECORDNUMBER [START recnum_start]
encoding_attribute = ENCODING encoding_value
encoding_value = {SOURCEENCODING}{encoding_name }

Arguments

separator

A single byte or multibyte character string that separates adjacent fields in delimited text records.

You can specify the character string in single-quoted or double-quoted format as outlined in Appendix B Constants

At runtime, field separators are treated as follows:

  • Character text constant field separators are treated as locale encoded.
  • Hex text constant field separators are treated as binary representations of the source or target encoding. Hex text constant field separators within the /OUTPROCEDURE option are encoded in the same encoding as specified in the individual target records in memory.
leading_character The character in the field-delimited text records that optionally precedes the data in each delimited field.
trailing_character The character in the field-delimited text records that optionally follows the data in each delimited field.
recnum_start The number assigned to the first record in the individual target records in memory. The minimum value is zero. The default is 1.
encoding_name The encoding of the character data in the individual target records in memory. See dmexpress data types/text data type in the Connect help for a list of the valid values.

Location

This option may appear anywhere in the task definition.

Defaults

Field Separator

The default field separator for the output is the same as the single byte or multibyte field separator of the first input that is different than UNIXSORTDEFAULT. If all inputs have either a UNIX default separator or no separator, then the default output field separator is a space. If none of the inputs are delimited, the output is not delimited.

Encoding

Use the ENCODING option to describe the character encoding of your target procedure. The encoding will be used to generate stream record terminators as well as any field delimiters or enclosing characters specifed. An encoding of LOCALE will use the system’s character set.

When no encoding is specified, a target procedure will have the same encoding as the first source file or pipe, if present. Otherwise, the target encoding defaults to ASCII. If UTF-16 or UTF-32 is specified for a target procedure, the byte order will be determined by the byte order of the first source file or pipe. However, if the first source file or pipe is not a variation of UTF-16 or UTF-32, respectively, the byte order is assumed to be big-endian.

Notes

You can invoke dmexpress through a program that defines an output procedure as a target of records from a copy task. An output procedure cannot be defined as a target of records from a Connect ETL join task.

The program calls the output procedure iteratively until all target records are retrieved by the Connect ETL get routine, dmx_get_record, and supplied to memory, where they are accessible to the program.

All source types except procedures are valid source types for the Connect ETL copy task from which the target of records is output.

Field Separator

A field-delimited text record consists of consecutive fields, with adjacent fields separated by single byte or multibyte separator characters. When you want the field separator to be different than the default, specify the output separator through the separator argument.

When the ENCLOSEDBY characters are different from input, a target reformat is required. 

Record Numbering

When you want to add a record number to the records in the individual records in memory, specify the RECORDNUMBER argument. To start the numbering at other than 1, provide START recnum_start.

If you do not specify a /REFORMAT option for the procedure, Connect ETL will automatically add a record number to the beginning of each record. The number appears as a 10- digit, unsigned decimal number. When the records in the file are field-delimited text records, leading zeroes in the number do not appear and a field separator follows the number.

If you do provide a /REFORMAT, Connect ETL does not automatically add a record number. See /REFORMAT for details on how to add the record number to a reformatting.