Reading Multiple Files from a source Directory

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
Gokul
Participant
Posts: 74
Joined: Wed Feb 23, 2005 10:58 pm
Location: Mumbai

Reading Multiple Files from a source Directory

Post by Gokul »

Hi ,

I am trying to read multilpe files from a file landing directory and also obtain the individual file name as one of the output column
I have used Sequential file stage's File Pattern Property to read multiple files and File Name Column option to get the individual File Name.

There are 2 source files in the landing directory. When I execute the job, the first file name is also repeated for the records of the second file .

I even tried using the environment variable APT_IMPORT_PATTERN_USES_FILESET . But the ouput was same.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Well, that $APT variable ( and perhaps one more) have made this work for others. What 7.x version are you running?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Gokul
Participant
Posts: 74
Joined: Wed Feb 23, 2005 10:58 pm
Location: Mumbai

Post by Gokul »

The other variable $APT_IMPORT_PATTERN_USES_FILESET_MOUNTED is not in the version 7.5x2 ( which I am currently using).
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So your O/S is actually Windows? :?

What happens if you simply add it? I would suspect if it still doesn't work it's an issue in that old/unique version.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Gokul
Participant
Posts: 74
Joined: Wed Feb 23, 2005 10:58 pm
Location: Mumbai

Post by Gokul »

The variable $APT_IMPORT_PATTERN_USES_FILESET_MOUNTED is not supported in version I am using.

I tried a workaound and its working.
In the sequential file stage, I used Read Method = Specific Files and used 15 different File properties. Each property specifiying name of one of 15 files.

Also the option Missing File Mode = OK was set.

With these setting I was able to extract the file names of the records I was reading and this worked even if some of the files were missing.
DSDexter
Participant
Posts: 94
Joined: Wed Jul 11, 2007 9:36 pm
Location: Pune,India

Post by DSDexter »

Gokul wrote:The variable $APT_IMPORT_PATTERN_USES_FILESET_MOUNTED is not supported in version I am using.

I tried a workaound and its working.
In the sequential file stage, I used Read Method = Specific Files and used 15 different File properties. Each property specifiying name of one of 15 files.

Also the option Missing File Mode = OK was set.

With these setting I was able to extract the file names of the records I was reading and this worked even if some of the files were missing.

I hope that you wont get more than 15 files using this method, Else that could recall trouble :twisted:
Thanks
DSDexter
Gokul
Participant
Posts: 74
Joined: Wed Feb 23, 2005 10:58 pm
Location: Mumbai

Post by Gokul »

Not until , we are upgrading to DS 8
Post Reply