A flat file contains 200 records. I want to load first 50
records at first time running the job, second 50 records at
second time running and so on, how u can develop this job?



A flat file contains 200 records. I want to load first 50 records at first time running the job, se..

Answer / subhash

1st Way:
1. Add 'row number' column in Seq File stage, so that each
record has a number associated with it.
2. Add a job param with which we can provide the number of
record from where we want to run the job. We can pass this
either using Sequence Start LOOP(List type variables-
50,100,150,200) or by shell script.
3. In the tfm, use a stage variable to run only from the
record number till 50 records by counting each record.

2nd way:
Design the job like this:
1. Add 'row number' column in Seq File stage, so that each
record has a number associated with it.
2. Use filter stage and write the conditions like this:
a. row number column<=50(in 1st link to load the records
in target file/database)
b. row number column>50 (in 2nd link to load the records
in the file with the same name as input file name, in
overwrite mode)


So, first time when your job runs first 50 records will be
loaded in the target and same time the input file records
are overwritten with records next first 50 records i.e. 51
to 200.
2nd time when your job runs first 50 records(i.e. 51-100)
will be loaded in the target and same time the input file
records are overwritten with records next first 50 records
i.e. 101 to 200.
And so on, all 50-50 records will be loaded in each run to
the target

Is This Answer Correct ?    8 Yes 1 No

Post New Answer

More Data Stage Interview Questions

Hi,can any one please mention list of dimension and fact tables for Sales and Distribution System for a Pharmacutical company.

0 Answers   Syntel,


How to display all the duplicate records from the oracle Table?

3 Answers   IBM,


can we use sequential file as a lookup

7 Answers   Cognizant, Wipro,


Can you explain kafka connector?

0 Answers  


Differentiate between validated and Compiled in the Datastage?

0 Answers  






What is the Main difference between Lookup Failure and Lookup Not Met? Plz explain with Example.

2 Answers  


How to enter a log in auditing table whenever a job get finished?

2 Answers   L&T,


What is the difference between datastage and datastage tx?

0 Answers  


What are the main features of datastage?

0 Answers  


What all are the different way to run a job?

0 Answers  


How u implement the slowly changing dimensions if my source table is consisting of cid,cname,add,phno,email but i need to capture the changes for first three columns how u implement?

1 Answers   IBM,


I have file with empid,empname and I want to load these two fields along with sal in my target 1)salary must be same for all the records 2)I want pass the salary at run time

7 Answers   TCS,


Categories