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
How do you import and export data into datastage?
how to read 100 records at a time in source a) hw is it fr metadata Same and b) if metadata is nt same?
What are the different kinds of views available in a datastage director?
Differentiate between hash file and sequential file?
How to RD using transformer?
Define Job control?
Define meta stage?
Which warehouse using in your datawarehouse
Can you explain engine tier in information server?
What is the purpose of pivot stage?
Which is the best institute in Hyderabad to learn OBIEE and DataStage?Please tell me faculty name also
Difference between data warehousing and olap?
What are the job parameters?
What is the difference between in process and inter process?
create a job that splits the data in the Jobs.txt file into
four output files. You will direct the data to the
different output files using constraints. • Job name:
JobLevels
• Source file: Jobs.txt
• Target file 1: LowLevelJobs.txt
− min_lvl between 0 and 25 inclusive.
− Same column types and headings as Jobs.txt.
− Include column names in the first line of the output file.
− Job description column should be preceded by the
string “Job
Title:” and embedded within square brackets. For example, if
the job description is “Designer”, the derived value
is: “Job
Title: [Designer]”.
• Target file 2: MidLevelJobs.txt
− min_lvl between 26 and 100 inclusive.
− Same format and derivations as Target file 1.
• Target file 3: HighLevelJobs.txt
− min_lvl between 101 and 500 inclusive.
− Same format and derivations as Target file 1.
• Rejects file: JobRejects.txt
− min_lvl is out of range, i.e., below 0 or above 500.
− This file has only two columns: job_id and reject_desc.
− reject_desc is a variable-length text field, maximum
length
100. It should contain a string of the form: “Level out of
range: