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
Difference between array and sub-script ?
Which mode is used to operate the sequential file?
I have a File that has duplicate records. I need only those records that occur more than thrice.?
How do you define a variable of comp-1 and comp-2?
What is the use of intialize verb?
What is a SSRANGE and NOSSRANGE?
How to remove 2 duplicate records and copy only one using job control language?
What are the rules of the move verb?
What are declaratives and what are their uses in cobol?
What is amode(31)
i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com
How do get the result of your program directly on your pc?
What is static and dynamic call in cobol?
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
How did the release of cobol/370 version 1.3 improve the performance of release 1.1?