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 do u code after getting data?
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.
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.
What is the difference between structured cobol programming and object alternativelyiented cobol?
What is the local-storage section?
what is search and searchall?what is the diffrence between them?give an best example?
What is comp-1 and comp-2?
How to print 10 to 1 if the input have only 10 digit number?
What are various search techniques in cobol? Explain.
How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?
how do you reference the fixed unblock file formats from cobol programs
What are the different rules for performing sort operation?
Write a program that uses move corresponding.
What guidelines should be followed to write a structured cobol prgm?
Are you comfortable in cobol or jcl?