June 13, 2011 at 2:50 pm
Hi,
I have to process some flat files from a network folder based on date range and some variable number formats.
e.g D220531.ABCD.MH0A,
D220531.ABCD.MH0C,
D220531.ABCD.MH0G,
D220531.ABCD.MH0B,
D220531.ABCD.MH01,
D220531.ABCD.MH02,
D220531.ABCD.MH04,
D220531.ABCD.MH05
0531 = last day of previous month
They are inserted into staging first and then into the main table.
I have done everything that needs to be done to import the data except handling these variable filenames.
I am using a foreach loop container and using a variable filename to get the filename.
Please help.
June 13, 2011 at 2:57 pm
I'm not entirely sure I understand what the question was.
You're on the right track, as far as I can tell. You want the ForEach Loop control in the Control Flow. In there, you can wildcard pattern to D22*.ABCD.MH* from your load directory. You can also control it via variables and expressions to be more complex and precise.
Where are you having trouble in particular?
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
June 13, 2011 at 3:04 pm
How to use wildcard pattern in Foreach loop container ? I am stuck here. 🙁
Should I use Enumerator configuration : Name and extension only ?
June 13, 2011 at 5:01 pm
PSB (6/13/2011)
How to use wildcard pattern in Foreach loop container ? I am stuck here. 🙁Should I use Enumerator configuration : Name and extension only ?
Kinda.
In the FILES component, you can use wildcarding on the file name. In the Folder component, you path it to where to loop at.
The Name and Extension part is what you want it to return to your variable that you'll use elsewhere: as the name in the expression in the flat file connection, for example. For that I'd use Fully qualified so I didn't have to re-read the pathing.
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
June 16, 2011 at 4:51 am
I'm sure I'm late, but I'll try anyway.
Make sure you map a variable to that file name in your container and that the variable is scoped at least as high as the container level (package level if you'll be using the file name outside the container). Otherwise, the tasks in the container that might be looking for that file name, or path & filename, won't be able to find it.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply