How to read multiple files at different directories using a
single Sequential File stage in DS Enterprise Edition

Answers were Sorted based on User's Feedback



How to read multiple files at different directories using a single Sequential File stage in DS Ent..

Answer / subhash

If all files having same Metadata,

Select Read method as 'specific file(s)'
then u Can add as many files as you want to run by selecting 'file' property from the 'available properties to add'.
It locks like below:

File= /dsg/work/temp/Employee1.txt
File= /dsg/work/Employee2.txt
File= /dsg/Employee3.txt
Read Method= Specific file(s)

Is This Answer Correct ?    14 Yes 0 No

How to read multiple files at different directories using a single Sequential File stage in DS Ent..

Answer / pvn

using file pattern

Is This Answer Correct ?    16 Yes 6 No

How to read multiple files at different directories using a single Sequential File stage in DS Ent..

Answer / venkata ramana

To read given number of files, one can use follow below

In the sequential file stage, Use
Read Method =File Pattern
File Pattern=`ls /* | head -<Number of files to be read>`

For example, I had 5 files, with similar pattern (as
date*.txt), in working folder say "/data/working/". If we
want to read three files out of these five files, one can
use following command:
`ls /data/working/date*.txt | head -3`

Just modified Venkat's Answer based on tested job.

Is This Answer Correct ?    0 Yes 0 No

How to read multiple files at different directories using a single Sequential File stage in DS Ent..

Answer / satyam

sequential file stage in that option is available you can observe that, ok i will send how to process later ok

Is This Answer Correct ?    4 Yes 5 No

How to read multiple files at different directories using a single Sequential File stage in DS Ent..

Answer / pooja

To read multiple files in a sequential file follow the
below process..

1. Enable "Allow Multiple Instances" in the Job Properties.
2. Add a job parameter in the sequential file stage where
the input file needs to be defined.
3. Compile and execute the job.
4. During execution, a value needs to be passed to the job
parameter..here pass the input file path placed in
different directories.
5. Execute the job for all the multiple files using the
same job by passing the input file path for each run.
6. An invocation id needs to be provided for each run. This
id indicates the no. of times the job has been executed.
Can be observed in the log.

Is This Answer Correct ?    5 Yes 6 No

How to read multiple files at different directories using a single Sequential File stage in DS Ent..

Answer / venkat

To read given number of files, one can use follow below
steps:
1. In the sequential file stage, Use Read Method as
Specific File(s).
2. Now in the file text field, Put below command.
`ls /* | head -<Number of files to be read>`

This will read given number of files.

For example, I had 5 files, with similar pattern (as
date*.txt), in working folder say "/data/working/". If we
want to read three files out of these five files, one can
use following command:
`ls /data/working/date*.txt | head -3`

Hope this helps.


venkat
09940692102

Is This Answer Correct ?    0 Yes 7 No

Post New Answer

More Data Stage Interview Questions

Hi, I have 3 records, 1 Srini 1 vasa 2 reddy now i want o/p like this 1 Srinivasa 2 reddy could u please help in this Thanks in advance.

6 Answers   Teradata,


What are the processing stages?

0 Answers  


Source contains the metadata source ----- hyderabad,chennai,bangalore by using nested loop sequence select source as hyderabad in target just run target as hyderabad only not others please give me answer thanks in advance(give reply how to wrote logic using nested loop sequence)

1 Answers   IBM,


What are the different types of lookups in datastage?

0 Answers  


What is the use of datastage designer?

0 Answers  






What r the existing server jobs in parallalism?

0 Answers   ITC Infotech,


i have a some records eno ename acono amount 1001 suresh sbi101 12000 1001 suresh sbi101 14000 1001 is dublicata how can i remove duplicate?

4 Answers  


how can we extract data with out having any common column

7 Answers   IBM, Switch2iTech,


what is mapping lookup

1 Answers  


Define Merge?

0 Answers  


file1 1 2 3 4 file2 3 4 5 6 output should be in three targets T1 T2 T3 1 3 5 2 4 6 how to do this? can any one help? Thanks

5 Answers   Cap Gemini,


What is the difference between in process and inter process?

0 Answers  


Categories