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.

Answers were Sorted based on User's Feedback



hi All, i have one scenario like if source--->transformer-->2 target sequential files ..

Answer / bharath

Hi,
in derivation for seq2 give as follows,
for file name give job parameter as file name and datatype is char..
for timestamp give Current CurrentTimestamp()
for count rows it is not not possible by using transformer
it can be achieved by adding another stage
that is aggregation stage..

Is This Answer Correct ?    8 Yes 2 No

hi All, i have one scenario like if source--->transformer-->2 target sequential files ..

Answer / ankita, cgi

Hi,
I have tried to get this output, i got the idea upto some
extent,
Could you please Elaborate your solution? how to get this
exact output, i.e., (10|xyz.txt|20101110 00:00:00), except
count.

Thanks in Advance.

Is This Answer Correct ?    0 Yes 0 No

hi All, i have one scenario like if source--->transformer-->2 target sequential files ..

Answer / 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

hi All, i have one scenario like if source--->transformer-->2 target sequential files ..

Answer / akila

Pass the name of the file in a parameter, say p1.If your
count of rows flowing through the transformer is not huge,
the run the transformer in sequential stage and pass
@INROWNUM:'|':p1:'|':DSJobStartTimeStamp as a value of a
field. Add a tail stage in between the transformer and the
2nd file. In the tail stage, input 1 as the count of
records.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Stage Interview Questions

I have a input as: Col 1 1 2 2 3 I want 3 output as: Output1: 1 1 Output2: 2 2 Output3: 3 i.e. same duplicates should be in one target, other duplicate values should be in another target and so on.. Pls help

9 Answers   IBM,


What is aggtorec restructure operator?

0 Answers  


How to implement complex jobs in data stage?

0 Answers  


What are transforms and what is the differenece between routines and transforms?

0 Answers  


What are the some differences between 7.x and 8.x version of datastage?

0 Answers  






WHAT IS FORCE COMPILE?

3 Answers   FIS, HCL, Polaris,


what is time dimension? and how to populate time demension

2 Answers   TCS,


Difference between ‘validated ok’ and ‘compiled’ in data stage?

0 Answers  


Hi All, I have a file. i need to fetch the records between first and last records by using transform stage. EX:- Source: EMPNO EMPNAME 4567 shree 6999 Ram 3265 Venkat 2655 Abhi 3665 Vamsi 5852 Amit 3256 Sagar 3265 Vishnu Target: EMPNO EMPNAME 6999 Ram 3265 Venkat 2655 Abhi 3665 Vamsi 5852 Amit 3256 Sagar I dont wan't to Shree and vishnu records.we can fetch another way also but How can I write the function in transform stage?

2 Answers   TCS,


how can u handle null values in transformer stage.

7 Answers  


tell me 5 situations when we r using oracle db stages like orecle connector, oracle enterprise

0 Answers   IBM,


eno ename 1 qaz 1 wsx 1 edc 2 zxc 2 asd 3 qwe 3 wer 3 tru 4 rgj Output: eno ename count 1 qaz,wsx,edc 3 2 zxc,asd 2 3 qwe,wer,tru 3 4 rgj 1 I want the above output to be solved by DataStage as well and I have to write SQL query for the same output.

4 Answers   Wipro,


Categories