Page 1 of 1

About the numeric edited type

PostPosted: Sat Mar 12, 2011 6:00 pm
by Pumpkin
Hi,
how to identify how many bytes numeric editde occupy(usage is display)?
for example,ZZ,ZZZ.99 it counts 7bytes or 9byte? does the "," and "." each occupy 1 byte?
And ZZ,ZZZ.99DB,does DB or CR occupy each 2 bytes?

thanks a lot!

Re: About the numeric edited type

PostPosted: Sat Mar 12, 2011 6:31 pm
by BillyBoyo
Pumpkin wrote:how to identify how many bytes numeric editde occupy(usage is display)?


To answer the question yourself for next time, you should be able to look at the "data map" on a Cobol compile output listing. This will tell you how long each data item is.

Pumpkin wrote:for example,ZZ,ZZZ.99 it counts 7bytes or 9byte? does the "," and "." each occupy 1 byte?
And ZZ,ZZZ.99DB,does DB or CR occupy each 2 bytes?


Yes, the "," and "." each occupy one byte, so the field is 9 bytes long.
Yes, the DB or CR each occupy 2 bytes.

Re: About the numeric edited type

PostPosted: Sat Mar 12, 2011 7:30 pm
by NicC
And the answer is in the manual, any good book and any course notes.

Re: About the numeric edited type

PostPosted: Sun Mar 13, 2011 5:51 am
by Pumpkin
Thanks for your reply!

Re: About the numeric edited type

PostPosted: Sun Mar 13, 2011 1:18 pm
by Quasar
Hi Pumpkin -

I declared NUM-EDITED Storage area in COBOL as ,ZZ,ZZZ.99. When I compile it, and look at the Data Division Map in the Compile Listing, this is what it'll show -

Image

As you can observe, the Hex Displacement of the next-field = 10. This implies, the NUM-EDITED is 10 Bytes in size.

Thank you very much.

Re: About the numeric edited type

PostPosted: Sun Mar 13, 2011 3:24 pm
by BillyBoyo
Hi Quasar,

,ZZ,ZZZ.99


I don't think Pumpkin intented the leading comma to be part of the picture. I wouldn't even have thought it valid, but it is (that's two "I didn't know that would work"s this week (I put a double dash in a dataname, and someone tried it out - it worked) and one, which might have been useful, which doesn't (trailing Z's).

Thanks for the Data Map, by the way. Now I know they've changed that as well!

Regards,

Bill