Use STRSTR command in the extended rule.
example: #Fullname =  input field containing lastname, firstname
              #lastname = output field
              #firstname = output field

In the extend rule,

string[30] comma_loc; //temporary field or this rule only

comma_loc = STRSTR(Fullname, ",");
if comma_loc > 0 then
 Begin
  #last name = left(Fullname, comma_loc+1);
  #first name = right(Fullname, comma_loc+1);
 end

Michael Richards

  -----Original Message-----
  From: [email protected] [mailto:[email protected]]On Behalf Of
Mukesh Kumar
  Sent: Tuesday, February 22, 2011 9:58 AM
  To: [email protected]
  Subject: [EDI-L] How to put logic to search a pattern within an element in
Gentran



  Dear All,

  I have come across a requirement in which I have to search a particular
  character within an element.

  I am using Gentran v5.3 (visual map) on IBM-AIX platform.

  My requirement is: full name is coming in one source element of 70
  characters long and it consists first name as well as last name separated
by
  a comma (,)
  I have to look for comma and have to map first name in our destination
  element and last name in other.

  As far as I know I can use macro to search comma in the element but as the
  source element is 70 characters long, hence I have to put same logic for
all
  70 positions which I don't think will be a smart solution.

  Can any one suggests do we have any other way to write such logic.
  Will appreciate all solutions.

  Thanks
  Mukesh
  +91-9874320420

  [Non-text portions of this message have been removed]



  


[Non-text portions of this message have been removed]



------------------------------------

...
Please use the following Message Identifiers as your subject prefix: <SALES>, 
<JOBS>, <LIST>, <TECH>, <MISC>, <EVENT>, <OFF-TOPIC>

Job postings are welcome, but for job postings or requests for work: <JOBS> IS 
REQUIRED in the subject line as a prefix.Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/EDI-L/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/EDI-L/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to