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 to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?
Difference between cobol and cobol-ii?
Discuss about changing dataset name in proc.
What is the difference between PIC 9.99 and PIC9v99?
What is the difference between perform … with test after and perform … with test before?
How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
how do you reference the variable block file formats from cobol programs
What are INPUT PROCEDURE and OUTPUT PROCEDURE?
How do we get current date from system with century in COBOL?
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?
what are decleratives in cobol?
Why occurs cannot be used in 01 level in COBOL?