|
Yes, the XLATE opcode. From the manual: ¦ ¦ *...1....+....2....+....3....+....4....+....5....+....6....+....7...+.... ¦ CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq.... ¦ * ¦ * The following translates the blank in NUMBER to '-'. The result ¦ * in RESULT will be '999-9999'. ¦ * ¦ C MOVE '999 9999' Number 8 ¦ C ' ':'-' XLATE Number Result 8 Figure 301. XLATE Operation ¦ *...1....+....2....+....3....+....4....+....5....+....6....+....7...+.... ¦ DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++++++ ¦ D Up C 'ABCDEFGHIJKLMNOPQRS- ¦ D 'TUVWXYZ' ¦ D Lo C 'abcdefghijklmnopqrs- ¦ 'tuvwxyz' ¦ CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq.. ¦ * ¦ * In the following example, all values in STRING are translated to ¦ * uppercase. As a result, RESULT='RPG DEPT'. ¦ * ¦ C MOVE 'rpg dept' String 8 ¦ C Lo:Up XLATE String Result ¦ * ¦ * In the following example only part of the string is translated ¦ * to lowercase. As a result, RESULT='RPG Dept'. ¦ * ¦ C Up:Lo XLATE String:6 Result Figure 302. XLATE Operation With Named Constants Dan Bale IT - AS/400 Handleman Company 248-362-4400 Ext. 4952 -------------------------- Original Message -------------------------- Good morning from the Cobol guy. Is there an RPG IV equivalent to the Cobol statement: INSPECT fielda REPLACING "," WITH " ". I've tried to find it in all sorts of manuals to no avail. Gord Royle Cott Corporation +--- | 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 +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.