About the numeric edited type



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

About the numeric edited type

Postby Pumpkin » Sat Mar 12, 2011 6:00 pm

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!
-------------------
Pumpkin
Pumpkin
 
Posts: 55
Joined: Sat Mar 05, 2011 9:12 am
Has thanked: 0 time
Been thanked: 0 time

Re: About the numeric edited type

 

Re: About the numeric edited type

Postby BillyBoyo » Sat Mar 12, 2011 6:31 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: About the numeric edited type

Postby NicC » Sat Mar 12, 2011 7:30 pm

And the answer is in the manual, any good book and any course notes.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: About the numeric edited type

Postby Pumpkin » Sun Mar 13, 2011 5:51 am

Thanks for your reply!
-------------------
Pumpkin
Pumpkin
 
Posts: 55
Joined: Sat Mar 05, 2011 9:12 am
Has thanked: 0 time
Been thanked: 0 time

Re: About the numeric edited type

Postby Quasar » Sun Mar 13, 2011 1:18 pm

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.
Quasar Chunawala,
Software Engineer, Lives at Borivali, Mumbai
User avatar
Quasar
 
Posts: 102
Joined: Wed Nov 10, 2010 7:11 pm
Location: Borivali, Mumbai
Has thanked: 13 times
Been thanked: 2 times

Re: About the numeric edited type

Postby BillyBoyo » Sun Mar 13, 2011 3:24 pm

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
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post