Wildcard option for filenames in DS-TX

Formally known as "Mercator Inside Integrator 6.7", DataStage TX enables high-volume, complex transactions without the need for additional coding.

Moderators: chulett, rschirm

Post Reply
kiranredz
Premium Member
Premium Member
Posts: 21
Joined: Wed Aug 06, 2008 8:34 am
Location: United States

Wildcard option for filenames in DS-TX

Post by kiranredz »

Hi,

I was looking for an option to read the file for processing, from an input directory based on a particular naming convention.
For Ex: my filenames are expected in the format - ABC_YYYYMMDD.txt.

Just like data stage PX, Is there an option to pick the files starting with ABC_*.txt?

I tries using * wildcard to match the inputfile name. I dint get the expected result.

Please let me know whether I can achieve this in TX.

Thanks
Kiran
rep
Participant
Posts: 82
Joined: Tue Jun 19, 2007 8:04 am
Location: New York City

...

Post by rep »

You should have no problems using wildcards; I haven't. I usually use something like;

*.txt

I haven't had the need to use ?. I have had wierd error messages on "shadow file rename failure" inregards to using wildcards, but after messing around with it, trying different things, I would always get it to work. It's been a while, but I think if you use wildcards in the input filename, you may have to use them in the output filename, but I could be wrong.

So if my input filename is;

*.txt

my output may have to be;

*.output.txt

for example. Try different things.


There's a lot of info in the documentation, such as;

General rules for using wildcards in adapter names: v

Directories cannot have wildcard notation in their names. v
A database source name cannot contain wildcard notation. v
If wildcards are used as sources or targets, at least one source trigger must have a wildcard. v
Question marks cannot be used in target file names. v
Multiple wildcards can be used in a source trigger name of a map, as long as there are no other source triggers. v
If more than one source file name contains a wildcard, that wildcard must be the same wildcard. v
Sources that are not event triggers and target names can contain at most one asterisk.

Wildcards v Can be used within a file name v
Cannot be used for directory names v
Can be used in Audit Log file names providing the input that is a trigger has the necessary wildcards to resolve the name for resource coordination


Multiple wildcards in a source name

If a source name has multiple wildcards and the target name has a single asterisk wildcard, the target name asterisk is replaced with the first wildcard value, next wildcard value, and any characters that exist between the wildcards. For example, with a source name of *a???b.c and a target name of *.d , if the source file name instance is: xyazzzb.c the target name assigned by the Launcher is: xyazzz.d
Post Reply