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



First, are there any embedded blanks within the numeric portion of the pro
number?

If so, that is another piece of the problem to deal with, and in that case
I would probably load the pro number into a 20 element array and then do a
for-loop through each element of the array and pick off each numeric
element.

The built-in-functions %DEC/%DECH and %INT/%INTH ignore/remove embedded
blanks.
That means the following examples work:

D String S 50A
D Num S 15P 5
/Free
String = ' 123.45 ';
Num = %Dec(String: 15: 5) //Num = 123.45000
String = ' 12 345. 67 ';
Num = %Dec(String: 15: 5); //Num = 12345.6700

String = ' + 123 456, 12 345 ';
Num = %Dec(String: 15: 5) //Num = 123456.12345

String = ' 1 3 5 . 7 9 - ';
Num = %Dec(String: 15: 5) //Num = - 135.79

String = *Blanks;
Num = %Dec(String: 15: 5) //--> Operation fails!!!

/End-Free


Mit freundlichen Grüßen / Best regards

Birgitta Hauser

"Shoot for the moon, even if you miss, you'll land among the stars." (Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
Auftrag von Booth Martin
Gesendet: Friday, 02. October 2009 01:17
An: RPG programming on the IBM i / System i
Betreff: Re: RPGLE string to number

First, are there any embedded blanks within the numeric portion of the
pro number?

If so, that is another piece of the problem to deal with, and in that
case I would probably load the pro number into a 20 element array and
then do a for-loop through each element of the array and pick off each
numeric element.

If though there are no embedded blanks I would probably just xlate all
the non-numeric characters to blanks.

Whichever route, then I'd do a %dec().



EKovarik@xxxxxxxx wrote:
I have a bill of lading number left justified in a 20 byte alphanumeric
field.

Need to extract just the bill of lading number and put into a 20 byte
numeric field for chaining purpose.

Does anyone have an example of how to do this?

Thanks,
Ed
<><><><><><><><><><><><><><>
Ed Kovarik
ETHEX, Ther-Rx, and PDI Companies
EDI Coordinator
314-645-6600 ext. 3352
314-646-3707 fax
ekovarik@xxxxxxxx<mailto:ekovarik@xxxxxxxx>
<><><><><><><><><><><><><><>

From: Kovarik, Ed
Sent: Thursday, October 01, 2009 10:36 AM
To: 'rpg400-l@xxxxxxxxxxxx'
Subject: Attach two reports as one for one email attachment

RPGLE Support Request,

I have opened a print file and written content of new report 1 my RPGLE
program.

User request I generate a copy of shipment pack list report 2 and also
attach to same email.

Problem is my email command on iSeries allows for one attachment,
thus can I merge open spool file report 1 and attach report 2 spool file?
Thanks,
Ed
<><><><><><><><><><><><><><>
Ed Kovarik
ETHEX, Ther-Rx, and PDI Companies
EDI Coordinator
314-645-6600 ext. 3352
314-646-3707 fax
ekovarik@xxxxxxxx<mailto:ekovarik@xxxxxxxx>
<><><><><><><><><><><><><><>



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.