How to get EVEN & ODD numbers separately?

Answers were Sorted based on User's Feedback



How to get EVEN & ODD numbers separately?..

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

How to get EVEN & ODD numbers separately?..

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

How to get EVEN & ODD numbers separately?..

Answer / tejeya

By using the Sequence generator and Mod() in Expression tfn.

Is This Answer Correct ?    9 Yes 6 No

How to get EVEN & ODD numbers separately?..

Answer / krishnakanth.ch

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

How to get EVEN & ODD numbers separately?..

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

How to get EVEN & ODD numbers separately?..

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

How to get EVEN & ODD numbers separately?..

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

How to get EVEN & ODD numbers separately?..

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

Post New Answer

More Informatica Interview Questions

which one is costliest transformation? costliest means occupying more memory. which one Aggregator,sorter,filter,etc..

7 Answers   TCS,


what type of documents you receiving from client later wt can you do? what type of documents have to prepare?

2 Answers   CGI,


3,if our source containing 1 terabyte data so while loading data into target what are the thing we keep in mind?

7 Answers   TCS,


 Informatica Checkpoints

0 Answers   DELL,


what is the drillup & drill down?and use of the drill up and drill down?

1 Answers   IBM,






Hi I have a source (flat file) like ID Name Attachments 101 abc [07012005072902]_CMM27-11-01 Page106 (2).pdf 102 bcd "[19012005124259]_Anfrage-Vendors.doc [19012005124336]_Anfrage.xls" 103 def "[19012006092602]_IMG_0310.JPG 19012006092631]_IMG_0311.JPG [19012006092702]_IMG_0312.JPG [19012006092727]_IMG_0313.JPG" But I need to generate duplicate records based on attachments column. Target (Table) like ID Name Attachments 101 abc [07012005072902]_CMM27-11-01 Page106 (2).pdf 102 bcd 19012005124259]_Anfrage-Vendors.doc 102 bcd [19012005124336]_Anfrage.xls 103 def [19012006092602]_IMG_0310.JPG 103 def [19012006092631]_IMG_0311.JPG 103 def [19012006092702]_IMG_0312.JPG 103 def [19012006092727]_IMG_0313.JPG 103 def [19012006092750]_IMG_0314.JPG 103 def [19012006092814]_IMG_0315.JPG Here no. of Attachments we can't decide because it is dynamic. It will be great if somebody help me on this. Thanks in Advance. ganga

2 Answers  


What is the difference between source qualifier transformations source filter to filter transformation?

0 Answers  


What happens to map if we alter the datatypes between source and its corresponding source qualifier?

0 Answers  


If you done any modifications for a table in back end does it reflect in informatca warehouse or maping?

2 Answers  


Difference between Data and Index Caches?

0 Answers   Informatica,


i having mapping emp---> sq_emp--->target using this mapping i have to load dept table values into target... (condition assume there is no primary and foreign key relation between emp(table x) and dept (table Y))

5 Answers   Cap Gemini,


Enterprise data warehouse your projects phase by phase explain?

0 Answers   Cap Gemini,


Categories