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

) how do u code after getting data?

1580


Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

2058


Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.

5063


What is the difference between structured cobol programming and object alternativelyiented cobol?

755


What is the local-storage section?

681






what is search and searchall?what is the diffrence between them?give an best example?

5558


What is comp-1 and comp-2?

764


How to print 10 to 1 if the input have only 10 digit number?

811


What are various search techniques in cobol? Explain.

650


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

708


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

712


What are the different rules for performing sort operation?

761


Write a program that uses move corresponding.

673


What guidelines should be followed to write a structured cobol prgm?

673


Are you comfortable in cobol or jcl?

643