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


  • Subject: Re: parsing a numeric field
  • From: "Charlie Massoglia" <cmassoglia@xxxxxxxxxxx>
  • Date: Thu, 19 Apr 2001 15:51:51 -0400

What are you trying to do?  If you want to edit the numeric field try the
following (taken from RPG IV for the RPG/400 Programmer):

 RPG IV Sample

*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords.............................
 * Copyright 2000, MPH, Inc., All Rights Reserved
D text            S             50A
D startbal        S             11P 2 INZ(1000000)
D payment         S             11P 2 INZ(250000)
D endbal          S             11P 2

CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
C                   eval      text = 'New customer balance is ' +
C                             %EDITC(startbal - payment:J) + ' now'
 * text = 'New customer balance is     750,000.00  now       '

C                   eval      text = 'New customer balance is ' +
C                             %TRIM(%EDITC(startbal - payment:J)) +
C                             ' now'
 * Need to trim result to eliminate extra leading and trailing blanks.
 * text = 'New customer balance is 750,000.00 now'

C                   eval      text = 'New customer balance is ' +
C                             %TRIM(%EDITC(startbal-payment:J:*ASTFILL)) +
C                             ' now'
 * text = 'New customer balance is ****750,000.00 now'

C                   eval      text = 'New customer balance is ' +
C                             %TRIM(%EDITC(startbal-payment:J:*CURSYM)) +
C                             ' now'
 * Assume no CURSYM keyword in H-spec and default $ in effect.
 * text = 'New customer balance is $750,000.00 now'


Charles L.Massoglia, President
Massoglia Technical Consulting, Inc.
cmassoglia@voyager.net
In MI 517-676-9700 or in NC 919-363-9395


----- Original Message -----
From: <
saustad@deltadentalwi.com>
To: <
rpg400-l@midrange.com>
Sent: Thursday, 19 April, 2001 13:54
Subject: parsing a numeric field


> Is there a way to parse a numeric field without using a data structure?
We
> have a dollar amt, which is P(7,2), that we need to split into dollars and
> cents.  It seems to me I saw something that used an op code or a BIF to
> accomplish this, but I can't remember where I saw it.
> Thanks for any info.


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.