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...

Hi All,
how is sign is stored in S9(17) comp-3 variable.
Answer with an Example will be of great help.

Answer Posted / viswanathan

Hi,

suppose s9(3)v9(4) comp 3 is the data type then
3+4 = 7 half bytes will be used for data.
the last half byte will be used for sign

in this example number of digits is odd(7).
so total size occupied will be 7/2 + 1/2 =4 bytes

first seven half bytes from left will have data part. so the
right most half byte will have sign value.
if this right most half byte value is D (1101) then it is -ve
if it is C (1100) or F (1111) then it is considered as +ve.

example 2
S9(4)v(2) comp 3

here number of digits is even (4+2=6),so number of bytes
used will be 6/2 +1 =4 bytes.
in this example first half byte will be having 0000 value
this will be ignored while reading from data. the next six
half bytes will be having the six digits of data. and then
the last half byte will be having the sign value as said in
the example 1.

example 3
s9(4) comp3

4-even
first half byte no data(0000). next 4 half bytes data. the
last half byte will have sign value

Thanks
Viswanathan

Is This Answer Correct ?    3 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to refer the data field?

2317


What is the difference between structured cobol programming and object alternativelyiented cobol?

1294


What is the local-storage section?

1189


Why did you choose to work with ibm mainframe cobol programming?

1153


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

1174


How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that

3276


what are decleratives in cobol?

2303


What are the rules of the move verb?

1318


What are literals?

1183


how to move the records from file to array table. give with code example

2726


) how do u code after getting data?

2206


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

10004


i need a small 3d program using inline and outline.

2251


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

1395


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

1239