Folder stage Pattern

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
shrinivas
Participant
Posts: 53
Joined: Mon Sep 18, 2006 3:42 am
Location: hyd

Folder stage Pattern

Post by shrinivas »

Hi Guys ,

I am facing one issue while using Folder stage to read a particular pattern files .I am explaining my problem with an example .

I have two files of pattern ABC_MMDDYY and ABC_DEF_MMDDYY.
What I need is I have to pick all the files with pattern ABC_MMDDYY . SO what i did in the folder stage I gave the pattern as ABC_*.But its reading all the files including files with pattern ABC_DEF_MMDDYY.

How can read the files only with pattern ABC_MMDDYY.

Any help is appreciated.
kondeti
Premium Member
Premium Member
Posts: 67
Joined: Sat Mar 04, 2006 11:38 am

Re: Folder stage Pattern

Post by kondeti »

Try to read the file in this way ABC_MMDDYY*
mdan
Charter Member
Charter Member
Posts: 46
Joined: Mon Apr 28, 2003 4:21 am
Location: Brussels
Contact:

Re: Folder stage Pattern

Post by mdan »

kondeti wrote:Try to read the file in this way ABC_MMDDYY*
Pattern ABC_* matches both types of files.
Create two different folders, one for each file family: f_def_mmddyy and f_mmddyy and place the files accordingly.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

What kind of values are in the "_DEF_" portion of the filenames you want to avoid? Not sure how to do this on Windows, but if "DEF" is always character data, then something like this on a UNIX system would work:

Code: Select all

ABC_[0-9]*
You could also use '?' rather than '*' to specify a maximum number of character matches:

Code: Select all

ABC_??????
The "_DEF_" files would be 'too long' to match that pattern.
-craig

"You can never have too many knives" -- Logan Nine Fingers
JoshGeorge
Participant
Posts: 612
Joined: Thu May 03, 2007 4:59 am
Location: Melbourne

Post by JoshGeorge »

I don't think Folder stage will match the pattern the way you want with ABC_[0-9]* or ABC_?????? in Unix environment also. Help document for folder stage says you can use * or 3 dots (...) for pattern matching. I think, an operating system command is not really what the stage is expecting. Be glad to be proven wrong, however!
Joshy George
<a href="http://www.linkedin.com/in/joshygeorge1" ><img src="http://www.linkedin.com/img/webpromo/bt ... _80x15.gif" width="80" height="15" border="0"></a>
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Interesting... to be perfectly honest, all I've ever needed to use was a splat so just made an assumption that it was doing O/S pattern matching. You're right, the help notes only the use of '*' and '...' which implies Universe pattern matching, or so it seems to me. :?

Anyone done anything other than straight '*' pattern matching in the Folder stage?
-craig

"You can never have too many knives" -- Logan Nine Fingers
shrinivas
Participant
Posts: 53
Joined: Mon Sep 18, 2006 3:42 am
Location: hyd

Post by shrinivas »

So is that mean there is no other way ..
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Did you try any of the options given to see what happens? Verified that indeed they are not an option?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply