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
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 |
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 |
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 |
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 |
Answer / siva
i thing we can solve this problem using mapping paraeter,workflow variable
Is This Answer Correct ? | 0 Yes | 0 No |
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 |
Answer / lakshmi
i think using scheduling proces in server jobs.
Is This Answer Correct ? | 1 Yes | 4 No |
How can i approach to write datastage 7.5 Certification? and how much they will charge for examination .What exactly should i do? Can anyone guide me plz?
in sequtial file 2 columns avaliable, i want only one column load the target. for this we can do by modify and copy stage. But here when using modify stage (in property drop column1) until it is ok. if target is data set How to view the data. with out using data management. what is the reason for this. if any body know this answer plz tel me. thanks.
What is exact difference between Parallel Jobs and server Jobs..
source file contains 100 records, i want 10 records in target file how it possible in datastage
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.
HOW U CAN ABORT THE JOB IF THE DATA IS DUPLICATE?
Input Data is: Emp_Id, EmpInd 100, 0 100, 0 100, 0 101, 1 101, 1 102, 0 102, 0 102, 1 103, 1 103, 1 I want Output 100, 0 100, 0 100, 0 101, 1 101, 1 Means Indicator should either all ZEROs or all ONEs per EmpId. Impliment this using SQL and DataStage both.
What is usage analysis in datastage?
when we have to go for a sequential file stage & for a dataset in datastage?
what is Audit table?Have u use audit table in ur project?
how to configure databases through datastage
what are fact tables and dimension tables? give example assuming one table.