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 happens if parmparameter passes zero bytes to the program

2082


Name the sections present in data division.

1175


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

1131


how do you define single dimensional array and multidimensional array in your cobol?

1046


How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

1108


What are different data types in cobol?

1228


What is the Purpose of POINTER Phrase in STRING command in COBOL?

1196


here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?

7733


Write a program that uses move corresponding.

1073


1.give the details about WHEN OTHER. 2. how many form are available in evaluate.

2060


Write some characteristics of cobol as means of business language.

1079


what is the difference between COBOL2 AND COBOL390?

2987


How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

2394


What is the local-storage section?

1103


What are literals?

1074