× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



The CAT operation in RPG III is very useful. I think George Farr wrote
the original code for it and then fixed it after I had a look at it
(just kidding George!).

Anyway... in RPG IV the only benefit of using CAT is one of blank
truncation. Meaning that there is no "free form" equivalent to the *BCAT
operation. However, the CAT operation does provide *BCAT capabilities to
RPGIII and RPG IV.

Eval  target = %TrimR(FieldA) + ' ' + FieldB)

This is similar to *BCAT so there again, CAT isn't really needed in most
cases.
In the rare instance when you need to do a concatenation of two values
and the number of blanks between the two values is something other than
Zero or One, then the CAT opcode excels! However, by simply counting out
the number of blanks in a literal you can achieve the same effect with
the plus sign on EVAL operations.

But what would be on my wish list, is to enhance the %TRIMx() built-in
functions to support a second parameter. The second parameter would be a
list of characters that are to be "trimmed" off the field's value.
Today, only blanks are trimmed, it would be nice to be able to trim of
any characters. And that second parameter should support a literal value
or a field name containing the characters to be trimmed.


Bob Cozzi
cozzi@rpgiv.com
Visit the new on-line iSeries Forums at: http://www.rpgiv.com/forum

> -----Original Message-----
> From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]
On
> Behalf Of Booth Martin
> Sent: Tuesday, December 11, 2001 11:58 AM
> To: rpg400-l@midrange.com
> Subject: Re: How do you move a text 30 char long to a field?
>
> --
> --
> [ Picked text/plain from multipart/alternative ]
> Hans, I can't agree more about moving to "Eval" land, but I am
discovering
> that sometimes people just need a poke to get going on a stumper.
>
> RPGIII also offers CAT in many varieties, but if a programmer doesn't
> already know the RPGIII CAT, then there's no valid reason to learn it
> because its cleaned up and useful in RPGIV.
>
>
>
> ---------------------------------------------------------
> Booth Martin   http://www.MartinVT.com
> Booth@MartinVT.com
> ---------------------------------------------------------
>
> -------Original Message-------
>
> From: rpg400-l@midrange.com
> Date: Tuesday, December 11, 2001 12:30:45 PM
> To: rpg400-l@midrange.com
> Subject: Re: How do you move a text 30 char long to a field?
>
> Booth wrote:
> >C MOVEL'Initial' TMP14 14
> >C MOVE ' Balanc'TMP14
> >C MOVELTMP14 IETEXT
> >C MOVEL'e - Eur' TMP14
> >C MOVE 'o Migra' TMP14
> >C MOVE 'tion' TMP18 18
> >C MOVELTMP14 TMP18
> >C MOVE TMP18 IETEXT
> >
> >I've counted wrong there somewhere, but you get the idea.
>
> You've just given Oscar a great reason to move to RPG IV!
>
> (Oh BTW, this can be done easier in RPG III using a compile-time
> array. But moving to RPG IV is definitely the best solution.)
>
> Cheers! Hans
>
> Hans Boldt, ILE RPG Development, IBM Toronto Lab, boldt@ca.ibm.com
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
>
> .
> --
> [ Content of type image/gif deleted ]
> --
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.