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

4) source target c1 c1 c2 c3 c2 c4 c4 c5 c3 c6 c7 c4 c5 c6 c7 please send me answer this question my mail

1 Answers  


sed,awk,head

0 Answers   CTS,


can we use sequential file as a lookup

7 Answers   Cognizant, Wipro,


explain about citrix scheduling tool in datastage

0 Answers   HSBC,


I am having two tables called MASTER and DETAIL. I want to insert records to both tables. But one condition is that whenever the insert for MASTER table is success then only the records will inserted into the DETAIL table, otherwise abort the job. How can u design this job?

1 Answers   TCS,






in one scenario source flat file like Fileld1 00122001550056200568 00256002360014500896 00123004560078900258 00147004560025800256 divide each 5 numbers as one column i.e here i need field1 field2 field3 field4 00122 00155 00562 00568 00256 00236 00145 00896 00123 00456 00789 00258 00147 00456 00258 00256 plz help me....

4 Answers  


How to clean the datastage repository?

0 Answers  


Give an idea of system variables.

0 Answers  


i want job aborted after some records are loaded into output by using only sequential stage and dataset

1 Answers   IBM,


I want capture UnMatched records from Primary source and secondary source in JOIN stage?

3 Answers   TCS,


Why we use surrogate key?

0 Answers  


i have 4 jobs i want run 1job should run on 1node and 2job runon 2node and.... how to make it possible?

1 Answers  


Categories