Kourier Integrator Online Help

KMK.SERVICE

Syntax

KMK.SERVICE SERVICE_ID {EXPORT-NETCHG | EXPORT-DELETES}{HEADERS "STRING"}

Description

This command can be used to execute a Kourier service from the command line or from within a UniBASIC program.

Options

SERVICE_ID

The name of a service in the KT_SERVICES file.

EXPORT-NETCHG

Indicates that all exports listed in the service are to run in net change mode.

EXPORT-DELETES

Indicates that all exports listed in the service are to run in net change with deletes mode. This keyword must be used in combination with the EXPORT-NETCHG keyword. 

HEADERS

Creates a substitution parameter as specified in "string" where "string" is a named value pair in the format of "name=value".  The substitution value can be referenced by using the %name syntax.

Determining if Another Process is Running

If you attempt to execute a Kourier service when another service is running, you will receive an error. If you want to check to see if a service is “running” before executing a Kourier service, you can try to read the service record from KT_SERVICES with a READU statement. If the record is locked, then 99.9% of the time this means the service is running. The other .1% is when someone is writing the record from the GUI, in which case it is safe to ignore. Following is some sample code that you can use for your READU statement:

0001: OPEN 'KT_SERVICES' TO F.SERVICES ELSE STOP
0002: READU SERVICE FROM F.SERVICES, 'SQL_CUSTOMER' LOCKED
0003:   PRINT 'Service is running'
0004: END THEN
0005:   PRINT 'Service is NOT running'
0006: END

Examples

Related Topics: 

Kourier TCL Commands Overview