Kourier Integrator Online Help

KMK.IMPORTASCII

Syntax

KMK.IMPORTASCII {FROM {INPATH| INFILE FROM-ID ITEM-ID}} {TO OUTFILE} {CLEAR} {OVERWRITING}

Description

This command can be used to execute one or more file imports in the context of a Kourier service.

It parses an ASCII FF-delimited file into individual records. Input files can be an input path, a record in a file, or messages from a service. If neither the FROM-PATH or FROM clause is specified, then messages are read from the service. 

The ID's are specified in the source file. When the TO clause is specified, each record is written to the file with the specified When the TO clause is omitted, messages are sent with the ID header set the ID from the source file.

If no outfile is specified, then each record is sent as a message to the service for further processing.

The CLEAR and OVERWRITING command options are only used when the TO clause is specified.

Options

INPATH

Path to input file to parse

INFILE

File containing input record

ITEM-ID

Item ID of record in infile

OUTFILE

File to write records to

CLEAR

Clear the target outfile before importing records.

OVERWRITING

Overwrite existing records in target outfile

Scope of Use

This subroutine MUST be used in a Kourier service, as part of the COMMAND.

Example - Inbound ASCII file

In this example, a Kourier Service must be defined with a SOURCE QUEUE that specifies a DSN that contains the inpath, while the SOURCE APPEND ADDRESS field specifies the infile (e.g., CUSTOMER.TXT). Then the following command is entered in the Service COMMAND field:

KMK.IMPORTASCII TO DEMO_TEMP_FILE CLEAR

Each time the Service is run, it will cause the CUSTOMER.TXT file to be read from the inpath, and then loaded into the DEMO_TEMP_FILE, after clearing the file first.

Related Topics: 

Kourier Service Commands

Kourier TCL Commands Overview

Kourier Command Keywords