INTEGER d; d = strstr(#field,","); #field2 = left(#field,d); #field3 = right(#field,len(#field)-d);
Sincerely, Jason McMahon 8079 Village Drive Cincinnati, OH 45242-4315 [email protected] gutausse.weebly com/articles html gutausse.blogspot com http://www.linkedin.com/pub/jason-mcmahon/11/743/51b -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Samantha Scott Sent: Tuesday, February 22, 2011 12:15 PM To: Mukesh Kumar Cc: [email protected] Subject: Re: [EDI-L] How to put logic to search a pattern within an element in Gentran You don't say which version of gentran but look up the syntax for "strstr". Its a string search function that gives the position of the substring you seek, in this case a comma. With that position (or 0 if it does not appear) you can use a mid or left and right function to take the string portion before the comma or after the comma. On Tue, Feb 22, 2011 at 11:57 AM, Mukesh Kumar <[email protected]>wrote: > > > 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 ------------------------------------ ... 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/
