Loading two or more files in a single job run

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
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Loading two or more files in a single job run

Post by DSRajesh »

Hi All,

I need to pick two 0r more than two files for which file name starts with similar word say file 1 name : HFDC_0101.csv,HDFC_08082012.csv.

Can we able to process these two files in a single job run and load into the target table?
RD
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yes, take a look at the server "folder file" stage, that will let you use wildcards and other rules to select files to process from a directory.
ssreeni3
Participant
Posts: 29
Joined: Fri May 18, 2012 1:35 am

Post by ssreeni3 »

Hi,
1)ensure metadata is same?If Yes,use sequential file stage:File pattern option to import multiple files.specify the value is HFDC_*.csv
It will work.

-----Sreeni
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

ssreeni3 - This is posted in the server forum, and the server sequential file stage does not offer this option.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

There are 'issues' with the Folder stage as it was built for XML processing and passes in the file contents in one lump. You could leverage the Filter option in the Sequential File stage to 'type' those files to standard out using a wildcard pattern.
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSRajesh
Premium Member
Premium Member
Posts: 297
Joined: Mon Feb 05, 2007 10:37 pm

Post by DSRajesh »

Hi Chullet,

Do you mean sequential file stage will handle more than 1 file in a single job run?
RD
sathya_anjan
Participant
Posts: 20
Joined: Tue Feb 02, 2010 4:49 am
Location: United Kingdom

Post by sathya_anjan »

The Answer to your above question is NO. Sequential file Stage cannot handle multiple input streams

However, you can combine the multiple streams of data (multiple sequential files) into a single stream and feed that into the Sequential File Stage, provided they have consistent Metadata. In this way you can handle multiple Sequential files

To acheive the above please follow the posts from ssreeni3 and chulett and use the Filter command option. This will create a single data stream from multiple inputs and hence can be parsed through the Sequential file stage

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

Post by ray.wurlod »

The Sequential File stage can readily handle multiple input files, provided that they have the same record structure.

The Sequential File stage can use a Filter command. In this case the filter command should be TYPE file1 file2 (or COPY file1 file2). (If you were on UNIX, the command would be cat file1 file2.) The stage then reads stdout from the command rather than trying to read the file named in the File property (which is still required, even though ignored).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply