So how does the data get into the field? Changing to a 9(10)V9(2) won't help if the source field is 9(12). The move will simply realign based on the implied decimal place.

RPG would do exactly the same thing.

Using the "redefines" approach I mentioned in the earlier post would "cure" the problem as long as you move to the edited field from the new 9(10)V9(2) name and not the old field.

However you really need to understand how the data gets into the field in the first place - the simple answer is to define the field correctly (i.e. with two decimals) at its source whether that is a file or ...


Jon Paris

www.Partner400.com
www.SystemiDeveloper.com

On 15-Nov-08, at 1:31 PM, Mike Apice wrote:

Jon

Thanks for the quick response. This is still driving me crazy.

I tried your suggestion and it is stlil not riight.

WS-DEPOSITAMT-E PIC 9(10)V9(2) VALUE 0.
WS-DEPOSITAMT-W PIC 9(10)V9(2) VALUE 0.
WS-DEPOSITAMT-D PIC 9(10)V9(2) VALUE 0.

AMTCHKESTU 12 2 40EDTCDE(3)
AMTCHKWACH 12 2 57EDTCDE(4)
AMTCHKDIFF 12 2 74EDTCDE(K)

Results:
AMT/BATCH AMT/BATCH
FROM ESTUB FROM BANK
============== ===============
60000.00 60000.00
110000.00 110000.00
152525.00 152525.00
50000.00 50000.00
50000.00 50000.00
50000.00 50000.00






-- On Sat, 11/15/08, Jon Paris <Jon.Paris@xxxxxxxxxxxxxx> wrote:

From: Jon Paris <Jon.Paris@xxxxxxxxxxxxxx>
Subject: Re: [COBOL400-L] Cobole edtcde help
To: "COBOL Programming on the iSeries/AS400" <cobol400-l@xxxxxxxxxxxx>
Date: Saturday, November 15, 2008, 12:28 PM

On 15-Nov-08, at 11:36 AM, Mike Apice wrote:

WS-DEPOSITAMT-E DETAIL = 000000060000
DETA01-O A = 000010000200001000006000000

The ws field has 7 zeroes and then 60000, the output has 5 zeroes
and then 6000000
The Ws field is correct, The amount is 600.00

Both fields are correct. The WS field has no implied decimal point,
so to use the notation of the DETA field it is a 12 0 - not a 12 2 as
the DETA field is.

You have two options - either define the WS field correctly - in this
case it should be PIC 9(10)V9(2). If for some reason that is not
possible, then redefine the field i.e. WS-With-Decimals redefines WS-
DEPOSIT... Pic 9(10)V9(2).

Jon Paris

www.Partner400.com
www.SystemiDeveloper.com





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