Page 1 of 1

Conversion of non packed to packed in COBOL.

Posted: Thu Nov 13, 2014 5:13 pm
by Guru
Hi

i would like to convert non packed numeric data to packed numeric data in cobol. I've observed that this can help me:

Code: Select all

05 field-a pic 9(9). 
05 field-b pic s9(9) comp-3

move field-a to field-b. 
But I'm wondering wat happens when we do this move that it is converted to packad decimal. Where I can learn this? Please guide.

Re: Conversion of non packed to packed in COBOL.

Posted: Thu Nov 13, 2014 6:53 pm
by nicc
In the COBOL programming guide, on the internet, in any COBOL tutorial, in any COBOL book.

Re: Conversion of non packed to packed in COBOL.

Posted: Fri Nov 14, 2014 11:50 am
by Guru
I found the rules about what kind of variable can be moved to what kind of variable but could not find how a alphanumeric gets in the numeric declaration, without any error...

Re: Conversion of non packed to packed in COBOL.

Posted: Fri Nov 14, 2014 5:34 pm
by Robert Sample
Where did "alphanumeric" come from? You have not shown anything indicating alphanumeric data is involved, nor was your question about alphanumeric data.

Perhaps you should go back to the beginning and explain what you want to know.