How to get EVEN & ODD numbers separately?
Answers were Sorted based on User's Feedback
Answer / amedela chandra sekhar
By using the condition in router transformation
drop the required ports into router t/r
add one group
even mod(empno,2)=0 ------Target1
defaultgroup -------------Target2
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / raghava
data one;
input number 10.;
datalines;
10
11
12
13
14
15
16
17
18
19
20
;
run;
data two;
set one;
if mod(number,2)=0 Then A=number; else B=number;
/* number=mod(number);*/
run;
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / tejeya
By using the Sequence generator and Mod() in Expression tfn.
| Is This Answer Correct ? | 9 Yes | 6 No |
There are many ways....
1) Using the sql override in the source qualifier. To find
the even and odd. Add another column to flag the even and
odd.Like
select ID,decode( id/2,0,'E','O') FLAG FROM TABLE_NAME;
Using the router we can send them into two seperate target
tables.
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / amedela chandra sekhar
for above answer
Remember empno should be like
1
2
3
4
5
6
7
8
9
other wise drag nextval port from sequence generator to
union t/r give condition like mod(nextval,2)0
| Is This Answer Correct ? | 3 Yes | 0 No |
Answer / prasad
no
1
2
3
4
5
6
7
8
9
10
i wrote a condition in transformer if mod(no,2)=0 Then B else A
Target
A
1
3
5
7
9
Target
B
2
4
6
8
10
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / vali
by using the condition in expression transformation
mod(empno) .the output given torouter t/r. if the o.p is
zero given to one group and if one given to default group..
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / usha
by using Sequence Generator transformation we can get even
to one target and odd to other target
end valu=2
cycle should enable
start val=1
curr value=1
s-->sq-->seq-->RTR-->t1-->t2
| Is This Answer Correct ? | 1 Yes | 2 No |
What if the source is a flat-file? Then how can we remove the duplicates from flat file source?
Hi Friends, How i could convert a cobol file (VSAM) into the flat file? How i could edit a cobol source file (VSAM)? I want to introduce few columns in the source file and finally the target should be in the Cobol itself. Kindly suggest me friends. Thanks in Advance, Innai
In joiner, how to load Master table in Target?
hi i want to install latest informatica software in my pc..can anybody help me where should i get the infomatica software..plz help me
what is the -ve test case in your project.
What are the issues u have faced in ur project? Guys pls answer to dis question.Due to this question I have failed in 3 interviews.
what is the difference between copy object import objects using repositery manager which one is best
What is a look up function? What is default transformation for the look up function?
Describe the scenarios where we go for joiner transformation instead of source qualifier transformation?
How we can confirm all mappings in the repository simultaneously?
Hello, I have the below table: CityID CityName CostOfLiving 1 Mumbai 5000 1 Bangalore 4500 1 Chennai 4800 2 Vapi 6000 3 New Delhi 8000 I am passing the rows of the above table through the aggregator transformation in Informatica What happens in the following conditions: 1) I specify no group-by ports? 2) I specify a group-by on CityID without making any separate post for aggregation? Which city and costofliving will this eventually take for CityID=1? 3) Rest being same as point 2,I take the sum of cost of living.Which city will be returned for ID=1? Thanks for your help!
What is decode in static cache?