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



Thanks Barbara. I hate to admit it but I hadn't considered negative numbers yet. I'll take a look at LBCPYNV. The decimal positions shouldn't be an issue.

-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Barbara Morris
Sent: Thursday, February 24, 2011 6:01 PM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: cvthc not converting all values

On 2/24/2011 5:44 PM, Mark Murphy/STAR BASE Consulting Inc. wrote:
I would expect 12345F if the rick had specified 6 nibbles, but 12345
if only 5 nibbles were requested. Now that I think about it more, 'X'
works like MOVEL, so should strip even the implied decimal, but I
don't think it changes negative numbers to letters, or it could.
That will have to be tested.


Rick doesn't have a packed variable that he can use with %EDITC. He has a string with a packed value in it, where the length (and decimals) are not known at compile time.

Rick, if you know that you will never get a value with more than 31 digits, you could define a packed(63,31) variable in your program, and use LBCPYNV to assign the packed value in your string to that packed variable. Then you could use %CHAR on the packed variable. That would handle negatives correctly. You'd probably want to trim off trailing zeros if the input value has decimals.

http://archive.midrange.com/rpg400-l/200605/msg00738.html
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.



Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.

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.