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


Please Help Members By Posting Answers For Below Questions

How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?

744


Difference between cobol and cobol-ii?

706


Discuss about changing dataset name in proc.

761


What is the difference between PIC 9.99 and PIC9v99?

781


What is the difference between perform … with test after and perform … with test before?

883






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?

700


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

2118


How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)

2723


how do you reference the variable block file formats from cobol programs

686


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

689


How do we get current date from system with century in COBOL?

805


What is static and dynamic call in cobol?

597


Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

676


what are decleratives in cobol?

1827


Why occurs cannot be used in 01 level in COBOL?

719