A flatfile 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 the job?pls
give the steps?pls pls

Answers were Sorted based on User's Feedback



A flatfile contains 200 records.I want to load first 50 records at first time running the job,seco..

Answer / varun

Design the job like this:
1. Read records from input flat file and click on option of
rownumbercolumn in the file. It will generate a unique
number corresponding to each record in that file.
2. Use filter stage and write the conditions like this:
a. rownumbercolumn<=50(in 1st link to load the records
in target file/database)
b. rownumbercolumn>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 ?    19 Yes 9 No

A flatfile contains 200 records.I want to load first 50 records at first time running the job,seco..

Answer / sreekanth reddy peddakkagari

Answer given by varun is exactly correct but there is a
small correction in the answer, as varun told that at the
same time we can not use same file name as the source as
well as target , so we need to read from actual file
(Ex:Source.txt) write it to new file(Ex:New_Source.txt),
after that we need to rename the new file to old file using
after Subroutene(mv New_Source.txt Source.txt).

Is This Answer Correct ?    7 Yes 1 No

A flatfile contains 200 records.I want to load first 50 records at first time running the job,seco..

Answer / subhash

other than VARUN solution

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.

Is This Answer Correct ?    2 Yes 0 No

A flatfile contains 200 records.I want to load first 50 records at first time running the job,seco..

Answer / sarath

i think using global parameter we can achieve this in transformer . first set the parameter value to 0 or 1 and finally after transforming set the parameter value to max(rownum) so that the value will b updated. for the next time using use that parameter as the starting point to load the data.

sorry if it is wrong.

Is This Answer Correct ?    1 Yes 1 No

A flatfile contains 200 records.I want to load first 50 records at first time running the job,seco..

Answer / siva

i thing we can solve this problem using mapping paraeter,workflow variable

Is This Answer Correct ?    0 Yes 0 No

A flatfile contains 200 records.I want to load first 50 records at first time running the job,seco..

Answer / msk22

Follow the steps:
1: import source definition(relational or flat file)
2: create mapping parameter $$m_count with datatype double
3: create expression transformation map all the output ports of source qualifier to expression.
4: create a variable port v_cnt and in expression write v_cnt+1
5: create an output port o_cnt and assign v_cnt to it.
6: take filter transformation, map all the output ports to filter and in filter condition write o_cnt<$$m_count and o_cnt>$$m_count-50
7: map all the output ports to target and save the mapping.
8: create a workflow for the mapping and then create a workflow variable $$wf_count with double datatype and enable persistent option.
9: create an assignment task and in the expression tab for user-defined variable choose $$wf_count and for expression write $$wf_count+50.
ex: $$wf_count=$$wf_count+50
10: now create the session for the mapping and go to session properties then select components tab, go to pre-session variable assignment column then open value and then there select mapping variable $$m_count and parent workflow variable $$wf_count
ex: $$m_count=$$wf_count.
11: save the workflow and execute.
That's it.......

Is This Answer Correct ?    0 Yes 0 No

A flatfile contains 200 records.I want to load first 50 records at first time running the job,seco..

Answer / lakshmi

i think using scheduling proces in server jobs.

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More Data Stage Interview Questions

What is the difference between validate and compile?

1 Answers   CTS,


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

2 Answers   L&T,


What are the benefits of datastage?

0 Answers  


A flatfile 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 the job?pls give the steps?

3 Answers   TCS,


j1,j2,j3 jobs r runing iwant to run j1,j3 after j2 how to do this using sequencer? 2)j1,j2,j3 jobs r runing iwant to run j1,j2,j3 how to do this?

1 Answers   Wipro,






Why do we use exception activity in Datastage?

0 Answers  


how to design the change capture stage in(data stage parallel jobs) type 2

2 Answers   IBM,


job locking methods? How can we unlock the job?

3 Answers   IBM,


how to get sum of sal based on dept_no and then sum of all sal irrespective of dept_no in same sql. output:- 10, 200(sum of sal for dept_no 10), 5000(sum of all sal)

0 Answers  


what is mapping lookup

1 Answers  


Nls stands for what in datastage?

0 Answers  


1)s.key generate 1 to 700 records today. tomorrow another 400 will updated how to update the records using s.key generator? 2)source is like :-- DB --> T/F stage1 --> seq1file T/f 1 is linking with T/F2 ---> seq 2 how to load the data? in source i given some conditions those r going in seq1. The another data will going to seq2 how to do this ?

0 Answers   Wipro,


Categories