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 / dinesh kumar gaddam

Packed Decimal fields (COMP-3):
the sign is stored in the last nibble (4 bits).
If sign S is not used then last nibble will contain X'F'.
If sign S is used and value is positive then it will contain X'C'
if sign S is used and value is negative then it will contain X'D'

Example:
PIC S9(04) COMP-3 VALUE 2345. -> X’02345C’
PIC S9(04) COMP-3 VALUE -2345. -> X’02345D’
PIC 9(04) COMP-3 VALUE 2345. -> X’02345F’

Zoned Decimal fields (DISPLAY):
The data is stored in zoned decimal as:
1 is represented as X’F1’
2 is represented as X’F2’ etc.
If the data is declared as signed S then sign is over punched with numeric value of last byte in zoned decimal.
If the value is positive then last bytes first nibble will be X’C’ instead of X’F’ and if the value is negative then last bytes first nibble will be X’D’ instead of X’F’.

Example:
PIC 9(04) VALUE 1234. -> X’F1F2F3F4’
PIC S9(04) VALUE -1234. -> X’F1F2F3D4’
PIC S9(04) VALUE 1234. -> X’F1F2F3C4’

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?

2283


How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?

1177


What is the problem of ordered sequential files access?

1170


I have a File that has duplicate records. I need only those records that occur more than thrice.?

9901


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

1261


Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc

1261


How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

5377


When is inspect verb is used in cobol?

1258


What is the utilization of copybook in cobol?

1200


Write a cobol program making use of the redefine clause.

1189


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

2381


Why would you use find and get rather than to obtain?

1193


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

2115


can you please let me know if there is any walkins for COBOL/PLI/DB2/IMS/JCL in pune other than IBM and ITC infotech

2435


) How do u handle errors in BMS macro

2058