Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello. I'm very new at this. Do y

Status
Not open for further replies.

lerosey

Programmer
Dec 13, 2002
2
US
Hello. I'm very new at this. Do you know of a reference that can tell me how Cobol packs a number to S9(18) COMP and vice versa?

How many chars does it occupy if I read the file one char at a time ?

Thank you so much.
 

Code:
 Digits in PICTURE   Clause Storage Occupied                 
 1 through 4         2 bytes                          
 5 through 9         4 bytes 
 10 through 18       8 bytes
 
lerosey -

Watch out for big/little endian issues (i.e. byte order). It differs depending on your platform. A google search for "COBOL big little endian COMP" will turn up some good references.

Glenn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top