Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mapping issue

Status
Not open for further replies.

sonalimss

IS-IT--Management
Dec 7, 2005
24
0
0
IN
Hai all,

iam using mercator 8.0 with window NT i got the following issue
iam having 10 records in input file each record looks like

"Eno,Ename,Esal,Edept"

I would like to map the input to two output files like Records with salary greater that 5000 should map to outfile1 and Records with Esal less that 5000 should map to outfile2..
can any one sugest me
 
Create two output cards check the condition before execution the functional map

Card-1
if(Esal>5000),f_grt_5000(object)
Output: you will get the outputs only records with greater than 5000.


Card-2
if(Esal<5000),f_lsd_5000(object)
Output: you will get the outputs only records Esal with less than 5000.

Note: different way you will find the sol. one of them.
 
A neater solution would be

Card-1
f_output(extract(object where Esal>5000))
Output: you will get the outputs only records with greater than 5000.


Card-2
f_output(extract(object where Esal<5000))
Output: you will get the outputs only records Esal with less than 5000.

It calls the same functional map but passes in different source set based on the Extract function.
 
Just glad I don't work for company where salary could be < 5000 :)



BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
Hai ,
Its not working, In output card1 iam trying to map records with Esal greater that 5000 ,once a record with Esal less that 5000 encounters it shows error "input type contain errors" Iam getting records with Esal>5000 in output1 second card unable to map records with Esal less that 5000

can any guys try this..

 
Input type contains errors needs to be cleared up to continue with mapping. Turn on input trace and see where the errors occur.


BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
hi,

As explained by Tim you can create two output cards and in the first card you can write the below rule.

=f_map_sal1(extract(Detail Record:input,Empsal Elements:Detail Record:input < 5000))

and in the second card you can write the below rule.

=f_map_sal2(extract(Detail Record:input,Empsal Elements:Detail Record:input >= 5000))

This will work!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top