cancel
Showing results for 
Search instead for 
Did you mean: 

Need help on Mapping

former_member191435
Contributor
0 Kudos

Hi Folks,

I am working on file to File Scenario.

I hava 1 input field Name : Account Number

If Account Number is need to map with field1 of output. whcih has length 10.

First I need to check Account Number is starting with digit or alphabet. If it starts with digit i need to add leading Zeros to show Output length 10.

If it is start with alphabet I need to show Output with trailing spaces.

For this how would I do in Gaphical mapping with out UDF.

Example If Account Number is 1345 then I need output as 0000001345

If Account Number is ABCD then I need Output is : ABCD .

I want to know that is there any gaphical Function to check that if Field is Didit or not.

Thanks,

Enivass.

Accepted Solutions (1)

Accepted Solutions (1)

former_member518917
Participant
0 Kudos

Hey Enivass,

you can ckeck the input field "Account Number" whether it is numeric or Alphabet using *"Conversions ->Fixvalues"*

Steps:

1. Extract first character of input using *" Text -> substring"* -- start position 0 , char count 1

2. In Fix Value table you have to give following values:

Dafault value : Alphabet

key----


value

0----


Number

1----


Number

2----


Number

...

9----


Number

3. Write logic IF "number" than "Arithmatic -> FormatNumber (0000000000) -


// for leading zeros

ELSE

concat with extra space -


Thanks

former_member191435
Contributor
0 Kudos

Hi Ritu,

Thanks for your reply.

Now its working fine without UDF.

Enivass

Edited by: enivas on Jan 10, 2011 5:55 AM

Answers (4)

Answers (4)

srikanth_srinivasan3
Active Participant
0 Kudos

int count=0;

for(int i=0;i<input.length;i++)

{

String temp;

if (input<i>.length()>0)

temp = input<i>;

else

temp = input<i>;

for(int j=0;j<temp.length();j++){

if(count!=2){

if(Character.isDigit(input<i>.charAt(j)))

count = 1;

else

count = 2;

}

}

if(count==1)

result1.addValue("TRUE");

else

result1.addValue("FALSE");

}

-

Srikanth Srinivasan

rajasekhar_reddy14
Active Contributor
0 Kudos

Hi,

you can achive this requirement using graphical mapping it self,

use startswith standard function function with arithmentic or combination if then else it will work.

Regards,

Raj

Former Member
0 Kudos

Hi Enivas,

There is no standard function to check whether the input is integer / string. For your requirement, you need to write UDF.

Thanks,

Former Member
0 Kudos

Hi,

There is no standard function to validate if the string starts with alphabet or digit in PI mapping.

You will have to write a java UDF to perform the validation.

Regards,

Subbu

Former Member
0 Kudos

Hi nivas,

There are no functions in graphical editor that can check for digits and characters. All the other checks can be performed using graphical functions but for digit check , UDF is to be written.

Thanks