source file having the data like aabbccc, i want target file
result like a1a2b1b2c1c2c3.
Answer Posted / srinivas
We can do this with below major steps.
i)First split the data into rows each character as one row this can be done by below function in basic trnsformer
Convert(@TM,@FM,Fmt('aabbccddee', "1T"))
ii)Then next step take four stage variables in next transformer apply below logics
stg1----> Outputcolumn of first transfermer.
stg2----> 1
stge3----> if stg4=stg1 then stg3+1 else stg2
stg4----> stg1
stge5----> stg1:stge3
now we will get the below ansr
o/p column
a1
a2
b1
b2
c1
c2
d1
d2
iii)Then convert the rows into one single column.
Thanks
Srini
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Which is the best institute in Hyderabad to learn OBIEE and DataStage?Please tell me faculty name also
What are the features of datastage flow designer?
What is difference between symmetric multiprocessing and massive parallel processing?
How you Implemented SCD Type 1 & Type 2 in your project?
What are some different alternative commands associated with "dsjob"?
What is a merge in datastage?
Hi , Can anyone give few examples of scenarios and there corresponding design in datastage..i am new to this tool...confused in design while my manager asking to design the job.. Please post the URL if there..so i can go through it.. Thanks in advance...
how to abort the job its matain duplicates?
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:
What is meta stage?
how to implement scd2 in datastage 7.5 with lookup stage
Explain how a source file is populated?
Difference between server jobs & parallel jobs?
What are stage variables, derivations and constants?
Differentiate between Join, Merge and Lookup stage?