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



How about this micro improvement to one calculation, two definitions and no additional DS storage?

D rpltxtptr s * Inz( %Addr( rpltxt ) )
D rpltxtnum s 11S 2 Based( rpltxtptr )

/free

V3 = %Char( rpltxtnum );

/end-free

This might not work with negative numbers if they are not stored as zoned negative.

Paul

Principal Programmer Analyst
IS Supply Chain/Replenishment


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Jon Paris
Sent: Thursday, December 09, 2010 10:24 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Re: Converting char to numeric for editing

This (not tested) should work just fine. Personally I'd wrap it up in
a subprocedure so that subsequent programmers don't have to try and
understand it - but I'd have done the same with your original code too.

d transform ds
d charNum11 11a
d num11 11s 2 Overlay(charNum11)

d v3 s 50a varying
d rplTxt s 80a

/Free
charNum11 = rplTxt;
V3 = %Char(num11);

Jon Paris

www.Partner400.com
www.SystemiDeveloper.com



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.