|
Hi Kiran, With RPG (III or IV) you can use the SCAN opcode. In the following code "Find" is the string you wish to search for, "W" is the length of the string, and #Data" is the string you want to search through. "FoundPos" is an array of numeric positions that are returned to you on successful scans. The array is needed because the string could exist multiple times in the same string. Indicator 75 turns on for a successful find. For example: * *** Find matching string in the data, if "Find" requested. * C IF Find <> *BLANKS C Find:W SCAN #Data FoundPos 75 C ENDIF Hope this helps, William K. Reger Senior Project Manager Levitz Furniture Corporation Phone: (561) 994-5114 E-mail: breger@levitz.com > -----Original Message----- > From: Kahn, David [JNJFR] [mailto:DKahn1@JNJFR.JNJ.com] > Sent: Monday, August 09, 1999 6:03 AM > To: 'RPG400-L@midrange.com' > Subject: RE: > > > Kiran, > > Post this question in midrange-l and I'm sure you'll get some > excellent > answers. > > Dave Kahn > Johnson & Johnson International (Ethicon) France > Phone : +33 1 55 00 3180 > Email : dkahn1@jnjfr.jnj.com (work) > dkahn@cix.co.uk (home) > > > > -----Message d'origine----- > De: ks_kiran@tkm.satyam.net.in [mailto:ks_kiran@tkm.satyam.net.in] > Date: 09 August 1999 09:59 > À: RPG400-L@midrange.com > Objet: > > > Hello All, > > How do i find a particular string > +--- > | This is the RPG/400 Mailing List! > | To submit a new message, send your mail to RPG400-L@midrange.com. > | To subscribe to this list send email to RPG400-L-SUB@midrange.com. > | To unsubscribe from this list send email to > RPG400-L-UNSUB@midrange.com. > | Questions should be directed to the list owner/operator: > david@midrange.com > +---END > +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---END
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.