Data Transformation Engine Functions and Expressions Reference Guide
Chapter 3 - Function Reference GETFILENAME
Functions and Expressions Reference Guide
120
GETFILENAME
The GETFILENAME function returns the file name for a file adapter source or
target of a specified card object. Without an argument, it returns the adapter
command associated with the active source or destination.
Syntax
GETFILENAME ( [ single-simple-object-name ] )
Meaning
GETFILENAME ( [ card_for_which_resource_info_is_needed ] )
Returns
This function returns a single-text-item.
With an argument, returns the file name for a file source or target of a
specified card object. Without an argument, returns the source or destination
name associated with the active source or destination.
Examples
GETFILENAME (OrderFile)
If the card OrderFile is associated with the data file, c:\
<install_dir>\order.txt,
GETFILENAME returns c:\ <install_dir>\order.txt.
Suppose you want to run the map MyMap from a component rule on Record
in your input to determine if input customer names are valid. MyMap has two
inputs and one output. The first input is the customer name to be looked 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 may vary; it must correspond to the name of the
data file used as the source you are trying to validate. For example, if the data
file name is c:\DATA.AAA, the lookup file name is c:\LOOKUP.AAA. If the
data file name is c:\DATA.XYZ, the lookup file name is c:\LOOKUP.XYZ, 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
LOOKUP." + RIGHT ( GETFILENAME ( ) , 3 ) + " -OE1" ) = "VALID"