View previous topic :: View next topic
|
Author |
Message |
shoaib
New User
Joined: 20 Dec 2006 Posts: 5 Location: mumbai
|
|
|
|
Hi,
I have run down in a problem with the Edited Field being moved to a numeric value.
01 INPUT-REC.
05 P-AMOUNT PIC -9999.99 VALUE IS ZEROES.
05 R-RATE PIC ZZ.99 VALUE IS ZEROES.
05 N-YEAR PIC ZZ VALUE IS ZEROES.
01 INPUT-DEC.
05 P-AMOUNT2 PIC S9999V99 VALUE IS ZEROES.
05 R-RATE2 PIC 99V99 VALUE IS ZEROES.
05 N-YEAR2 PIC 99 VALUE IS ZEROES.
Procedure division.
...
2000-GET-INPUTS.
ACCEPT P-AMOUNT
ACCEPT R-RATE
ACCEPT N-YEAR.
MOVE P-AMOUNT TO P-AMOUNT2. ** This statement gives the error**
MOVE R-RATE TO R-RATE2.
MOVE N-YEAR TO N-YEAR2.
2000-ENDS.
EXIT.
When I run the code I get the run time error of IGZ0063S ...
I tried with the following things :
1. 05 P-AMOUNT PIC -ZZZZ.99 VALUE IS ZEROES.
2. 05 P-AMOUNT PIC -ZZZ9.99 VALUE IS ZEROES.
I tried all the following inputs :
1. //SYSIN DD *
+1000.00
10
4
/*
2. //SYSIN DD *
1000
10
4
/*
In Xpeditor , I checked and it shows: (for option 1 of SYSIN DD)
P-AMOUNT +1000.00
P-AMOUNT2 +0000.00
Just before the execution of this step .... but fails with the error IGZ0063S on the above indicated step.
Nothing seems to be working and I'm running into the same error again and again .... I appreciate you suggestions ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
At the top of the page is a link to "IBM Manuals".
In the COBOL Language Reference for your release of COBOL, look up NUMVAL and NUMVAL-C. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
If you DO have a "+" sign as the 1st char in your sending fld, that is the "invalid" char causing your problem.
Youu can correct it using Dick's suggestion or you can use this:
Code: |
IF P-AMOUNT(1:1) NOT = '-'
MOVE ' ' TO P-AMOUNT(1:1)
END-IF |
Either will work, but this is probably more efficient. |
|
Back to top |
|
|
shoaib
New User
Joined: 20 Dec 2006 Posts: 5 Location: mumbai
|
|
|
|
Thanks for the help |
|
Back to top |
|
|
|