× 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.



Others have already suggested the use of %Char. Have you also considered using the QMHSNDPM API instead of SNDPGMMSG?

Brian.<https://www.ibm.com/docs/en/i/7.4?topic=interfaces-api-finder>

On 09/06/2021 11:00, Patrik Schindler wrote:
Hello,

I've created a CL program declaring a 4 char string variable. This is passed to an RPGLE program to fill in how many records have been processed. In it's D-specs I declare this as "4S 0", and MOVE a counter variable's contents to there before the program ends. After the RPG program is finished, I'm using SNDPGMMSG with a custom *MSGF to output the number of records processed. (This circuitous way is — to my knowledge — the only way to output a messages which stay in the message line even after the program itself has ended and the command line is appearing again.)

The MOVE creates a string with leading zeros. What would be the easiest/least-code/correct way to get rid of these?

I can't pass the number as number, because the CL compiler complains when the call to SNDPGMMSG is done using *DEC instead of *CHAR.

Thanks for your opinions!

:wq! PoC



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.