Im trying to move numeric data of a variable which is of length S9(7)V99 to different variable with length S9(7)V99 COMP-3. Its giving me Data Exception Error.
Im just accepting the data from the user and moving it to COMP-3 variable inorder to store it in a file.
Joined: 20 Oct 2006 Posts: 6968 Location: porcelain throne
it has been stated many times and many ways that display numeric data
will accept anything.
you need to prove that the data contained in the display numeric variable is numeric.
search the cobol forum; there have been many threads.
read the documentation - cobol programmers guide and cobol reference.
button at top of page - IBM Manuals - 2nd from left, will guide you to reference material for your vsn of cobol.
Joined: 14 Jan 2008 Posts: 2504 Location: Atlanta, Georgia, USA
After the signed display-numeric field is packed (internally by the compiler) and then moved (via an MVC) into the receiving packed-field, the compiler issues a ZAP of the packed-field into itself and this is where you can get a S0C7. You won't get a S0C7 on a PACK instruction.