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,
Can anyone tell me how we can MOVE value of a X(19)
variable to a S9(17) COMP-3 variable?
Answer with an Example will be of great help.

Answer Posted / nk

05 MY-NUM-ALPHA PIC X(9).
05 MY-NUM REDEFINES MY-NUM-ALPHA PIC S9(17) COMP-3.
MOVE 'ABCDEFGHI' to MY-NUM-ALPHA.
note that comp-3 stores 2 numbers per byte so 17 digits
takes 9 bytes (half of one byte stores the sign.) So you
could move a 19-character variable to a 9-byte field but it
will be truncated.

Is This Answer Correct ?    5 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is static and dynamic call in cobol?

1115


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?

2325


Why occurs cannot be used in 01 level in COBOL?

1204


Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

1391


How do u write test cases?

2110


How do define dynamic array in cobol.

1185


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

1229


What is the default value(s) for an initialize and what keyword allows for an override of the default?

1265


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

2515


How do we get current date from system with century in COBOL?

1423


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

1217


What are declaratives and what are their uses in cobol?

1257


Explain the configuration section of a cobol program with examples of syntax.

1257


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

3317


how do you reference the printer file formats from cobol programs

1278