I'd appreciated if you could help me solve the following problem:
PROGRAM:
-----------------------------------------------------------------------
TEST2:PROCEDURE OPTIONS(MAIN);
DCL CNT DECIMAL FIXED;
DISPLAY('THIS IS TEST2');
GET LIST(CNT);
DISPLAY('INPUT='||CNT);
END TEST2;
-----------------------------------------------------------------------
after run it and then input any numbers, such as 3 in the console.
the error message show up:
---------------DOS screen------------------------------------------
THIS IS TEST2
3
IBM0032I ONCODE=0612 The CONVERSION condition was raised
because a conversion error occurred when converting from
character
to arithmetic.
At offset +000000CE in procedure with entry TEST2
---------------DOS screen------------------------------------------
any help will be appreciated!
Thanks in advanced!
Best regards,
kelvin
Compiler Messages
Message Line.File Message Description
IBM1047I I 2.1 ORDER option may inhibit optimization.
IBM1043I I 5.1 SYSIN is contextually declared as FILE.
IBM1058I I 6.1 Conversion from FIXED DEC to CHARACTER will be done by
library call.
File Reference Table
File Included From Name
1 E:\PLI\test247.pli
Component Return Code Messages (Total/Suppressed) Time
Compiler 0 3 / 0 0 secs
End of compilation of TEST2
IBM(R) Linker for OS/2(R), Version 01.02.03
(C) Copyright IBM Corporation 1988, 1995.
(C) Copyright Microsoft Corp. 1988, 1989.
- Licensed Material - Program-Property of IBM - All Rights Reserved.
ILink : warning LNK4071: application type not specified; assuming WINDOWCOMPAT
THIS IS TEST2
6
INPUT= 6
Hi James,
Thanks for your quickly response!
I thought it should be OK, but...
thanks anyway!
Best regards,
kelvin
TEST2:PROCEDURE OPTIONS(MAIN);
ON CONVERSION BEGIN;
DISPLAY('ERROR CONVERTING ''' || ONSOURCE() || '''');
STOP;
END;
DCL CNT DECIMAL FIXED;
DISPLAY('THIS IS TEST2');
GET LIST(CNT);
DISPLAY('INPUT='||CNT);
END TEST2;
--
John W. Kennedy
A proud member of the reality-based community.
You didn't say what compiler and version you were using.
Try running this agau\in, by typing 3 followed by a space,
then pressing ENTER.|
That was a known bug in early version with 64-bit integers.
Solve it as I said, by putting a space after the data and before
pressing ENTER.
Suggest you get an update for your compiler.
Hi Peter,
Sorry,I do not understand what your mean.
Thanks anyway!
Best regards,
kelvin
Hi John,
Thanks for your help!
the display as follow:
-----------------------------------------
THIS IS TEST2
1
ERROR CONVERTING '1
'
-----------------------------------------
Best regards,
kelvin
Hi Robin,
Thank you so much!
It works! according to your instruction.
Thanks!
Best regards,
kelvin