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 a scope terminator give example?

1052


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

1049


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

1281


What is redefines clause in COBOL?

1250


What are the different rules for performing sort operation?

1156


Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?

1116


i have 10 names in an array and my name is one of them also array is not in sorted order i need to display my name using index how will i do this

1470


Explain about different table spaces.

1049


There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

1386


i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com

2173


Can a Search can be done on a table with or without Index?

1237


How do you reference the fixed block file formats from cobol programs

1159


What is the difference between comp and comp-3 usage?

1132


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

1083


What rules are followed by the search verb.

1051