Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How is sign stored in Packed Decimal fields and Zoned
Decimal fields?

Answer Posted / arjun k r

for packed decimal ,one or more bytes hold a decimal integer, where each of the two nibbles of each byte represent a decimal digit, with the more significant digit in the upper half of each byte, and with leftmost byte (residing at the lowest memory address) containing the most significant digits of the packed decimal value. The lower nibble of the rightmost byte is usually used as the sign flag.

Standard sign values are 1100 (hex C) for positive (+) and 1101 (D) for negative (&#8722;).

number &#8722;1,234,567 is 7 digits wide and is encoded as:
0001 0010 0011 0100 0101 0110 0111 1101
1 2 3 4 5 6 7 &#8722;

For Zoned Decimal, Each decimal digit is stored in one byte, with the lower four bits encoding the digit in BCD form. The upper four bits, called the "zone" bits, are usually set to a fixed value so that the byte holds a character value corresponding to the digit.
For signed zoned decimal values, the rightmost (least significant) zone nibble holds the sign digit.Thus a zoned decimal value encoded as the hex bytes F1 F2 D3 represents the signed decimal value &#8722;123:

F1 F2 D3
1 2 &#8722;3

Source : Wikipedia

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are 77 levels used for?

1106


how do you reference the ksds vsam file formats from cobol programs

1188


What is the compute verb? How is it used?

1147


i want a program using by if, evaluate , string, unstring, perform, occurs?

4722


What is the difference between PIC 9.99 and 9v99 in COBOL?

1331


How do you reference the following file formats from cobol programs?

1162


How do you differentiate between cobol and cobol-ii?

1209


) what is the difference between AID and HANDLE AID?

2152


What are the different rules for performing sort operation?

1224


What the difference is between continue and next sentence?

1166


Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks

2963


how do you reference the variable unblock file formats from cobol programs

1328


Which is not true about evaluate statement

2457


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

2472


What are the pertinent COBOL

2570