File Name Issue....

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
ravitell1
Participant
Posts: 12
Joined: Wed Aug 11, 2010 12:28 pm

File Name Issue....

Post by ravitell1 »

Hello All,


I have a situation where a file comes everyday with the name
"20101023000004_Sample_File" ....
File schedule for everyday
So the file name changes everyday... How to approach this issue...

Help appreciated...
Ravi.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Have the file land in a particular folder. In a sequence use a DIR /B command to get the file name and feed it to your job. Move the file to a different folder when done.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Shruthi
Participant
Posts: 74
Joined: Sun Oct 05, 2008 10:59 pm
Location: Bangalore

Post by Shruthi »

One another option is File Pattern.

You can choose "Read Method" property to "File Pattern" and File name as "*_Sample_File"

But this can be used if any specific pattern there in file.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Not in a Server job, I'm afraid.
-craig

"You can never have too many knives" -- Logan Nine Fingers
koolsun85
Participant
Posts: 36
Joined: Tue Jun 15, 2010 3:30 pm
Location: Tampa

Post by koolsun85 »

I think its better to go with a shell script.It gives you more flexibility.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If your scripting or command line skills leave something to be desired, another option is the Folder stage. It can return filenames based on a wildcard pattern if all you define is a single column in it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ravitell1
Participant
Posts: 12
Joined: Wed Aug 11, 2010 12:28 pm

Post by ravitell1 »

ray.wurlod wrote:Have the file land in a particular folder. In a sequence use a DIR /B command to get the file name and feed it to your job. Move the file to a different folder when done. ...


Thanks it worked...
Post Reply