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
What is a scope terminator give example?
how do you define single dimensional array and multidimensional array in your cobol?
how do you reference the variable unblock file formats from cobol programs
What is redefines clause in COBOL?
What are the different rules for performing sort operation?
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
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
Explain about different table spaces.
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.
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
Can a Search can be done on a table with or without Index?
How do you reference the fixed block file formats from cobol programs
What is the difference between comp and comp-3 usage?
How to get the last record in vsam file in cluster? And how can you get the ksds file records into your cobol program?
What rules are followed by the search verb.