Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MCH1202 1

Status
Not open for further replies.

saphyr

Programmer
Sep 26, 2002
5
US
I WOULD APPRECIATE ANY HELP ON THIS.

FD
01 CUSTOMER-RECORD.
05 SALESPERSON-NO-IN PIC 999.
05 SALES-AMT-IN PIC 999V99.

WS
01 DETAIL-LINE.
05 SP-NO-OUT PIC 999.
05 SALES-AMT-OUT PIC 999.99.

IN THE PROCEDURE DIVISION THE LINES THAT SEEM TO
CAUSE THE MCH1202 IS:

MOVE SALEPERSON-NO-IN TO SP-NO-OUT.
MOVE SALES-AMT-IN TO SALES-AMT-OUT.

IF YOU NEED ANYMORE INFO, I WOULD BE HAPPY TO PROVIDE IT!

SAPHYR
 
I think the error lies here

WS
01 DETAIL-LINE.
05 SP-NO-OUT PIC 999.
05 SALES-AMT-OUT PIC 999.99.

Shouldn't it be:

WS
01 DETAIL-LINE.
05 SP-NO-OUT PIC 999.
05 SALES-AMT-OUT PIC 999V99.


Niki.

 
MCH1202 is an AS/400 error message, reading "Decimal Data error"
 
This program works:
WORKING-STORAGE SECTION.
01 items.
05 item-1 PIC 999V99 VALUE 9.95.
05 item-2 PIC 999.99.
PROCEDURE DIVISION.
1000-start.
DISPLAY item-1
MOVE item-1 TO item-2
DISPLAY item-2
STOP RUN.

009.95
009.95


Is there something I missed?

Dimandja


 
I did try the implied decimal in the output, no go.
I want the output to be an edited field, it really should not be an issue because this is a simple read, write and count program. There are no calculations in the program other than counting records and occurances, so that decimal should not matter.

I can read the data-in (with a PIC X(80)) and move it with a read into the write-line statement and it runs without the MCH1202. I then break the input into individual fields, it still runs, no error (also no moves occurred). Then I insert the moves and the error occurs.

Any other suggestions?

 
Hi saphyr,

1. Are these two statements the only changes you made before getting the error?

2. When you "read the data-in (with a PIC X(80)) and move it with a read into the write-line statement and it runs without the MCH1202", do you get the numeric edited fields correctly edited on the output?

3. Could you post the full DETAIL-LINE layout?

Dimandja
 
I took baby steps. I used the read into with a detail-line defined as with a pic X(80). And it worked fine. This is the detail-line I need

FD CUSTOMER-DATA
LABEL RECORDS ARE STANDARD.
01 CUSTOMER-RECORD.
05 CUST-NO-IN PIC 9999.
05 CUST-NAME-IN PIC X(26).
05 STORE-NO-IN PIC 9.
05 SALESPERSON-NO-IN PIC 999.
05 SALES-AMT-IN PIC 999V99.

FD ERROR-REPORT
LABEL RECORDS ARE OMITTED.
01 PRINT-LINE PIC X(132).

WORKING-STORAGE SECTION.

01 DETAIL-LINE.
05 FILLER PIC X(5).
05 DL-RECORD-NO PIC 999.
05 FILLER PIC X(5).
05 DL-CUST-NO PIC 9999.
05 FILLER PIC X(5).
05 DL-CUST-NAME PIC X(26).
05 FILLER PIC X(5).
05 DL-STORE-NO PIC 9.
05 FILLER PIC X(5).
05 DL-SP-NO PIC 999.
05 FILLER PIC X(5).
05 DL-SALES-AMT PIC 999.99.


I have done each move individually these are the two that cause the data decimal error. Could it be the data file?

move SALESPERSON-NO-IN to DL-SP-NO.

move SALES-AMT-IN to DL-SALES-AMT.

Thanks so much . . . Saphyr

 
Saphyr,

It has been a long time since I worked on an AS/400 (14 years) but I have many memories of getting calls in the middle of the night from the computer operator telling me that the night run died with an MC1202.

Are you absolutely positively sure that those two numeric fields you are reading in have numeric data (i.e. no spaces or nulls).

-Rob
 
Rob~

No I am not certain that the data is numeric.

I will try validating the input fields.

This is a new toy to me, when the MCH1202 occurs (I am assuming it will still occur while I validate) I use G to continue, should this complete the run or just the next record?

I have had both happen.

Thanks to all . . . Saphyr %-)
 
BINGO!!!!

Validating the fields and not moving them if they failed ran the program to the end of the data.

I appreciate everyone's help!!!

Thanks ~ Saphyr

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top