bharathi


{ City } bangalore
< Country > india
* Profession * project engineer
User No # 114050
Total Questions Posted # 0
Total Answers Posted # 3

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 1
Users Marked my Answers as Wrong # 0
Questions / { bharathi }
Questions Answers Category Views Company eMail




Answers / { bharathi }

Question { IBM, 28754 }

How to exclude first and last lines while reading data into a sequential file(having some 1000 records).I guess probably by using unix filter option but not sure which to use


Answer

In sequential file stage use the filter in the options

In filter use sed '1d;$d'

You can use sed ',d' to delete particular rows and use sed -n ',p' to keep particular rows

Is This Answer Correct ?    1 Yes 0 No

Question { IBM, 16825 }

i want send my all duplicate record one tar and all uniq
records one target how we will perfome explain
example:
input data
eid
251
251
456
456
951
985
out put/target1
251
251
456
456
out put/target2
951
985
how we will bring


Answer

- > Unique
Sq File - > Aggregate - > Transformer |
- > Duplicate

1. Read data in seq file stage.
2. In Aggregate stage group by EID and count the number of rows in Count column
3. In transformer stage create loop condition as @ITERATION<= DSLink6.Count and derivation as EID = EMPNO.
4. In unique output tab use constraint count<=1 and in duplicate output tab use constraint count>1

Is This Answer Correct ?    0 Yes 0 No


Question { Wipro, 6766 }

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.


Answer

Seq stg------>Sort stg--------> Trnsfrm stg-------->Tgt
1. read data in seq file stage.
2. In sort stage enable key column change as true.
3. In transformer stage define stage variable SV1 (if DSLink5.keyChange = 1 then 1 else SV1 +1) and SV2 (if DSLink5.keyChange = 1 then DSLink5.ENAME else SV2 : ',' : DSLink5.ENAME
) . In output tab link ENO, SV2 -> Ename and SV1 -> Count. Add a constraint LastRowInGroup(DSLink5.ENO) and mark the ENO as key in input column.

Is This Answer Correct ?    0 Yes 0 No