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


Please Help Members By Posting Answers For Below Questions

how to use self join using datastage ? can u tell me using stage how can we implemnet the self join

4553


Name the third party tools that can be used in datastage?

605


How do you reject records in a transformer?

622


how to write server Routine coding?

1654


What is the difference between in process and inter process?

661






There are two file are there .1st file contains 5 records and 2nd file contain 10 records in target they want 50 records.how can achieve this

1797


AGGREGATOR default datatype

925


Can you filter data in hashed file?

3337


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

607


Define repository tables in datastage?

695


how to delete one row in target dataset

2582


What could be a data source system?

571


In work load management there are three options of Low priority, Medium priority and High Priority Jobs which can be used for resource management. why this feature is developed when there is already jobs prescheduled by scheduler or autosys. what will be the use of workload management then?

1038


What is datastage?

642


i WANTED TO USE THE RANGE LOOKUP SCENARIO IN DATASTAGE 7.5.2 SRVER JOB.i HAVE A DATE FIELD IN SOURCE AND I SHOULD MATCH IT WITH A FIELD IN LOOKUP FILE.BUT,THE FIELDS SHOULD MATCH EVEN THOUGH THERE IS SOME RANGE.CAN SOMEONE TELL ME HOW CAN I DO THAT. THANKS

3309