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
how can i see junk values in dclgen or in hostvariable of comp ?
What is the difference between comp and comp-3?
Explain how you can characterize tables in cobol?
What is the Purpose of Pointer in the string?
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?
What are various search techniques in cobol? Explain.
Explain what you understand by passing by value.
Write some characteristics of cobol as means of business language.
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
Define cobol?
What are all the divisions of a COBOL program?
What are the different data types in cobol?
how do you reference the variable unblock file formats from cobol programs
What is difference between static and dynamic call in cobol?
What rules are to be followed while using the corresponding options?