hi All,
i have one scenario like if
source--->transformer-->2 target sequential files
the 1 st target sequential file is loads the data from
source
and 2nd target sequntial file contain the 1st target total
record count,and file name of 1 st target seq file and
timestamp seperated by delimeter
for example if source have 10 record the 1st target seq
file hav 10 records
and
2nd target seq file example
10|xyz.txt|20101110 00:00:00
could you please help me out how can i implement in
datastage job.
Answer Posted / kirill lychagin
I managed to make such job in IIS 8.5, but i think it can be reproduced in all 8.* versions/
Main question is how to get rows count in transformer. In general it can't be done. But we have sequential file stage as target.
So my solution:
1) name of 1st target file is job parameter.
2) on link to 2nd target file we add to columns:
FNAME=#FIRSTTARGETFILE# - name of 1st target file
ROW_NUM=@INROWNUM - number of input row
3) on input link to 2snd sequntial file set Collector Type=Ordered and set ROW_NUM as sort key column
4) Then in 2nd Sequntial File Stage at tab Properties add "Filter" in Options category and write there "head -n 1"
Profit!
SO the idea is to get column num in transformer and apply unix style filter (mks on Windows) on output to Seq File.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All 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 ?
What is the difference between datastage and datastage tx?
What is a merge in datastage?
What is the project in datastage?
what is the use of skid in reporting?
what are .ctl(control files) files ? how the dataset stage have better performance by this files?
What are the different common services in datastage?
What are the partitioning techniques available in link partitioner?
What is developer responsibilities in UAT (user acceptance testing and Post implementation phase?
What is the difference between hashfile and sequential file?
What are the functionalities of link partitioner and link collector?
What is the difference between account and directory options ?
What is the use of datastage designer?
What is the precedence of stage variables,derivations, and constraints?
Explain the datastage parallel extender (px) or enterprise edition (ee)?