77 a pic x(4) value '1234' -----> instead of this 'abcd'
77 b pic 9(4) value zeros.
move a to b
what is the answers for both cases?
IS it possible? Give me elementary move rules briefly......
Answer Posted / satish kumar
hello all, yes it is possible to move alphanumeric to
numeric but not numeric to alphanumeric.if we are moving
alphanumeric character "abcd" to numeric. The compiler
accepts the first three characters as same and the remaining
last character it takes ascii value/code of last character 'd'.
pgm1: 77 a pic x(4) value "abcd".
77 b pic 9(4) value zeros.
move a to b.
o/p: abc4
pgm2: 77 a pic 9(4) value 1234.
77 b pic x(4).
move a to b.
o/p: 1234
in this case the compiler can move the numeric values to
alphanumeric directly.
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
How do you differentiate between cobol and cobol-ii?
what is the use of outrecord?
Explain what you understand by passing by value.
What is report-item in COBOL?
In COBOL programming, what is PERFORM? What is VARYING?
Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?
How to find out the closest prime number of an input number? I believe it has something to do with SEARCH and COBOL Linear Array.
here is my requirement A1 is alphanumeric with value 'A1B2C3D4' as defined below 05 A1 PIC X(8) VALUE IS 'A1B2C3D4' but i need to have A2,A3 as ABCD & 1234 repectively...... A2 = ABCD A3 = 1234 Can you please explain me what are the different ways to do it?
How do you reference the following file formats from cobol programs?
) How do u handle errors in BMS macro
What rules are followed by the search verb.
)If there are 10 steps in GDG, if I want to refer the step2 after step5 . what should I do?
What is a scope terminator give example?
What are the different data types in cobol?
what is the difference between COBOL2 AND COBOL390?