Data Transformation Engine Execution Commands Reference Guide

Chapter 3 - Examples Executing a Command File
Execution Commands Reference Guide
55
Executing a Command File
As an alternative to typing execution commands on the command line, you can
run maps using maps and execution commands in a command file. To use a
command file named cmd_file.txt, from a UNIX command line, enter:
mercator @cmd_file.txt
A command file can contain spaces and/or new lines to separate arguments and
maps to be run. The following is an example of a command file to be executed on
a UNIX platform:
/x12/edi.mmc -TIO -IF2!WXR5:1 dtin -OF1B out.txt
/maps/invoices.mmc -AE -T -WD=/tmp
mymap.mmc -R2 –D1949
flatfile.mmc -F –Y10:2
/maps/daily/multitran.hp –G –OD4R5:3B ‘-DELETE –TRACE ERROR’
Using this command file, the maps are executed sequentially. These command
files may be manually created or can be generated by the Integration Flow
Designer for systems with an execution mode of Command.
Using a Run Function and Echoed Outputs in Memory
When using the Output Target Override – Echo execution command (-OE) with the
X option, the output is stored in memory and is not echoed back to the calling map
or application. A typical scenario in which this is useful and can serve to optimize
performance is the situation in which a map has an output that is only used as a
scratch card (that is, it is built to be used only by a subsequent output).
For example, if used in a RUN() function:
RUN (“some_map.mmc”,“–WM –OE1 –OE3X –OE4”)
In this example, a memory-based WorkSpace is used and the data for output
cards 1 and 4 are echoed back to the rule in which the
RUN function is located. All
other map settings and input and output card settings for executing this map,
such as MapAudit, Century, and so on, would use the settings compiled into
some_map.mmc.
This results in the execution of some_map.mmc. The data produced for output
card 1 and 4 is concatenated and echoed back to the rule containing the RUN
function. The data for output card 3 is not echoed back to the rule because of the
use of the X option. Given that output card 1 builds 103910^ABC, output card 3
builds justsomedata, and output card 4 builds 01/23/98, the RUN function returns
103910^ABC01/23/98.