Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Can any body help -IGYPA3074-S-"TOTAL-OUT (NUMERIC-EDIT
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: 1452
Location: Chicago, IL

PostPosted: Mon Jul 11, 2005 3:20 pm    Post subject: Re: Can any body help -IGYPA3074-S-"TOTAL-OUT (NUMERIC-
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    Post subject: Re: Can any body help -IGYPA3074-S-"TOTAL-OUT (NUMERIC-
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    Post subject:
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: 1452
Location: Chicago, IL

PostPosted: Tue Jul 12, 2005 3:00 pm    Post subject: Re: Can any body help -IGYPA3074-S-"TOTAL-OUT (NUMERIC-
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    Post subject: Thanks
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts Amount field is getting corrupted whe... thesumitk SYNCSORT 5 Tue Oct 18, 2016 8:20 pm
No new posts Reading data from PS file and send it... rajatbagga All Other Mainframe Topics 18 Fri Sep 23, 2016 12:51 pm
No new posts hot to get details when "EXEC CI... Andi1982 CICS 11 Tue Sep 20, 2016 5:01 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us