IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

[Solved]Can any body help -IGYPA3074-S-"TOTAL-OUT (NUMERIC-EDIT


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bhim_sb
Warnings : 1

New User


Joined: 31 Mar 2005
Posts: 24

PostPosted: Mon Jul 11, 2005 2:53 pm
Reply with quote

Can any body help to solve out the error coming in the program.

Program:
************************ Top of Data ***********************
IDENTIFICATION DIVISION.
PROGRAM-ID ACCTRANS.
**********************************************
*this program will calculate total amount and*
*amount due on customer. *
**********************************************
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. IBM-390.
OBJECT-COMPUTER. IBM-390.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT IN-ACCOUNT-DATA ASSIGN TO INFILE.
SELECT OUT-ACCOUNT-DATA ASSIGN TO OUTFILE.
DATA DIVISION.
FILE SECTION.
FD IN-ACCOUNT-DATA
LABEL RECORDS ARE STANDARD.
01 IN-ACCOUNT-REC.
05 ACCT-NO-IN PIC X(5).
05 PIC X(2).
05 CUST-NAME-IN PIC X(20).
05 PIC X(2).
05 AMT1-IN PIC 9(3)V99.
05 PIC X(2).
05 AMT2-IN PIC 9(3)V99.
05 PIC X(2).
05 DISCOUNT-AMT-IN PIC 9(3)V99.
FD OUT-ACCOUNT-DATA
LABEL RECORDS ARE OMITTED.
01 OUT-ACCOUNT-REC.
05 ACCT-NO-OUT PIC X(5).
05 PIC X(2).
05 CUST-NAME-OUT PIC X(20).
05 PIC X(2).
05 TOTAL-OUT PIC 9(4).99.
05 PIC X(3).
05 AMT-DUE-OUT PIC 9(4).99.
WORKING-STORAGE SECTION.
01 WS-AREAS.
05 ARE-THERE-MORE-RECORDS PIC X(3) VALUE 'YES'.
PROCEDURE DIVISION.
100-MAIN-MODULE.
OPEN INPUT IN-ACCOUNT-DATA
OUTPUT OUT-ACCOUNT-DATA
MOVE SPACES TO OUT-ACCOUNT-REC
PERFORM UNTIL ARE-THERE-MORE-RECORDS = 'NO'
READ IN-ACCOUNT-DATA
AT END
MOVE 'NO' TO ARE-THERE-MORE-RECORDS
NOT AT END
PERFORM 200-INITIALIZE-RTN
PERFORM 300-PROCESS-RTN
END-READ
END-PERFORM
CLOSE IN-ACCOUNT-DATA
OUT-ACCOUNT-DATA.
200-INITIALIZE-RTN.
MOVE ZERO TO AMT1-IN
MOVE ZERO TO AMT2-IN
MOVE ZERO TO TOTAL-OUT
MOVE ZERO TO AMT-DUE-OUT
MOVE ZERO TO DISCOUNT-AMT-IN.
300-PROCESS-RTN.
MOVE ACCT-NO-IN TO ACCT-NO-OUT
MOVE CUST-NAME-IN TO CUST-NAME-OUT
COMPUTE TOTAL-OUT = AMT1-IN + AMT2-IN
COMPUTE AMT-DUE-OUT = TOTAL-OUT - DISCOUNT-AMT-IN
WRITE OUT-ACCOUNT-REC.

Error:

68 IGYPA3074-S "TOTAL-OUT (NUMERIC-EDITED)" was not numeric, but was a sender in an arithmetic expression. The statement was discarded.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Mon Jul 11, 2005 3:20 pm
Reply with quote

Quote:
05 TOTAL-OUT PIC 9(4).99.


Make it like....05 TOTAL-OUT PIC 9(4)V99.

Regards,

Priyesh.
Back to top
View user's profile Send private message
bhim_sb
Warnings : 1

New User


Joined: 31 Mar 2005
Posts: 24

PostPosted: Tue Jul 12, 2005 2:09 pm
Reply with quote

priyesh.agrawal wrote:
Quote:
05 TOTAL-OUT PIC 9(4).99.


Make it like....05 TOTAL-OUT PIC 9(4)V99.

Regards,

Priyesh.



I did but in output file total-out record does not contain a decimal point

it is shown in output like 123456. while I need to put a decimal point in

record i.e. output should be 1234.56.

Thanks & Regards

Bhim.
Back to top
View user's profile Send private message
kvivek

New User


Joined: 09 May 2005
Posts: 51
Location: Singapore

PostPosted: Tue Jul 12, 2005 2:57 pm
Reply with quote

Use
Code:
05 TOTAL-OUT PIC 9(4)V99
for computation and use another variable for display
Code:
05 TOTAL-OUT-DISPLAY PIC 9(4).99

Code:
MOVE TOTAL-OUT TO TOTAL-OUT-DISPLAY
DISPLAY TOTAL-OUT-DISPLAY

Regards,
Vivek
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Tue Jul 12, 2005 3:00 pm
Reply with quote

Hi bhim_sb,

In a COMPUTE statement identifiers on the right side of the equals sign should be Numeric Elementry Items. On the left it can be either Numeric or Numeric edited.

This case is also with Arithmetic Expressions.

So If you want to have decimal point in diaplay. you can move TOTAL-OUT to some other variable TOTAL-OUT-TEMP (PIC 9(4).99) and get it displayed.

another way can be to use
COMPUTE AMT-DUE-OUT = AMT1-IN + AMT2-IN - DISCOUNT-AMT-IN

Corrections are wel come.

Regards,

Priyesh.
Back to top
View user's profile Send private message
bhim_sb
Warnings : 1

New User


Joined: 31 Mar 2005
Posts: 24

PostPosted: Thu Jul 14, 2005 11:31 am
Reply with quote

Thanks to all I have solved the problem.

Actualy i was using reporting fields in calculations.

i just created fields ws-total-out and ws-amt-due-out in storage section

then moved These fields

300-PROCESS-RTN.
MOVE ACCT-NO-IN TO ACCT-NO-OUT
MOVE CUST-NAME-IN TO CUST-NAME-OUT
COMPUTE WS-TOTAL-OUT = AMT1-IN + AMT2-IN
MOVE WS-TOTAL-OUT TO TOTAL-OUT
COMPUTE WS-AMT-DUE-OUT = WS-TOTAL-OUT - DISCOUNT-AMT-IN
MOVE WS-AMT-DUE-OUT TO AMT-DUE-OUT
WRITE OUT-ACCOUNT-REC.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts PuTTY - "User is not a surrogate... IBM Tools 5
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
Search our Forums:

Back to Top