Conversion of non packed to packed in COBOL.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Guru
New Member
Posts: 6
Joined: Tue Jun 10, 2014 8:52 pm

Conversion of non packed to packed in COBOL.

Post 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.
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Conversion of non packed to packed in COBOL.

Post by nicc »

In the COBOL programming guide, on the internet, in any COBOL tutorial, in any COBOL book.
Regards
Nic
Guru
New Member
Posts: 6
Joined: Tue Jun 10, 2014 8:52 pm

Re: Conversion of non packed to packed in COBOL.

Post 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...
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1885
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Conversion of non packed to packed in COBOL.

Post 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.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”