Data Transformation Engine Functions and Expressions Reference Guide

Chapter 3 - Function Reference GETDIRECTORY
Functions and Expressions Reference Guide
119
Suppose you want to run the map, MyMap, from a component rule on Record
in your input to determine whether input customer names are valid. MyMap
has two inputs and one output. The first input is the customer name to up. The
second input is a lookup file. The output is a text item whose value is VALID or
ERROR.
The name of the lookup file is constant; it is always XREF_TBL.TXT. However,
its location may vary; it will always be in the same directory as the data file
used as the source you are trying to validate. For example, if the name of the
data file used as the source is C:\SHR\ABC\INPUT.TXT, the lookup file
name is C:\SHR\ABC\XREF_TBL.TXT. If the data file name is
/local/data/somefile, the lookup file name is /local/data/XREF_TBL.TXT,
and so on.
You could use this component rule on Record to determine whether the
customer name is valid:
RUN ( "MyMap.mmc" , "-IE1S10" + CustomerName:$ + " -IF2 " +
GETDIRECTORY ( ) + "XREF_TBL.TXT" + " -OE1" ) = "VALID"
Uses
Use
GETDIRECTORY in a map rule or component rule when you need the full
path (directory) of either the compiled map or of a data source or destination.
Related Functions
GETFILENAME, GETRESOURCENAME