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......

Answers were Sorted based on User's Feedback



77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value..

Answer / amarnath reddy

Hi,

That is wrong answer. we can get that result when we MOVE A
TO B. result is 1234.
because A is declared as alphanumeric and B is declared as
numeric but here A is intialized all numeric values(1234)
only and move to the B is also numeric So not possible to
get any abend.

Is This Answer Correct ?    5 Yes 0 No

77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value..

Answer / mithlesh

It is not possible to move alphanumaric to numaric data type
it will throw soc7 error at runtime.

Sco7 is the abend . which come when mismatch problem
occured.

Is This Answer Correct ?    4 Yes 1 No

77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value..

Answer / subra kondaveeti

Hello All, Move a alpha numeric field to Numeric fields doesn't necessarily gives a soc7 because it depends upon the what the alpha-numeric field contains.
for example value of 'ABCD' in teh alpha-numeric field ALSO MOVES 1234 to numeric field. if you look at the assembly instruction produced for the move statement is

moven which means ignore the zone portion of each byte and move the numeric value of the byte. but it can give soc7 if you move '----' to numeric field because it tries to move x'CACACACA' to numeric field. if you look at the numeric portion of every byte is 'A' and hence can't be moved

Is This Answer Correct ?    3 Yes 0 No

77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value..

Answer / 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

77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value..

Answer / amarnath reddy

Hi Vinod,

If we move to only numeric values but alphanumeric data
item into numeric data item, We not possible to get any
abend. If we move to alphabetic values (abcd) to numeric
data item we can get the abend soc7.

Is This Answer Correct ?    1 Yes 0 No

77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value..

Answer / vinodquestion

Hi Mr. Amar. Thank you for your answer. Then wat about 'abcd'..

Is This Answer Correct ?    0 Yes 0 No

77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value..

Answer / himanshu

Mr Amarnath,i would advise you to read and understand
question properly.And please dont mark ur answer correct
yourself.its irritating.

Is This Answer Correct ?    0 Yes 0 No

77 a pic x(4) value '1234' -----> instead of this 'abcd' 77 b pic 9(4) value..

Answer / amarnath reddy

Hi Himanshu,

you read and try to understand my answer. I posted my answer
is Those cases not possible only when we move 1234 to b data
item that is accepted otherwise move abcd to b data item
possible to get the abend soc7.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

How do you differentiate between cobol and cobol-ii?

0 Answers  


Explain complete concept of table handling in COBOL with an example?

2 Answers   IBM, TCS, Wipro,


Consider the following code: 77 A PIC 99V99 VALUE 55.35 77 B PIC 99V999 VALUE 32.754 ADD B TO A ON SIZE ERROR DISPLAY "ERROR!!!" What will be the result ? (a) A=88.10, B=32.754 (b) A=87.00 B=32.754 (c) A=87.10 B=32.754 (d) ERROR!!! will be DISPLAYed on the screen.

3 Answers   TCS,


please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?

0 Answers   EDS,


How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

0 Answers  






Hi All, how is sign is stored in S9(17) comp-3 variable. Answer with an Example will be of great help.

5 Answers   EDS,


how will you define vsam file in select clause?

3 Answers   Patni,


If there are two copybooks which have same variables and we are using both the copybooks in our program. will there be an error and if i move values to the variable which copybook varibales gets the values i move in.

3 Answers   CTS,


Consider the following: 77 A PIC 9(10) 77 B PIC 9(10) 77 C PIC 9(19) MULTIPLY AB BY B GIVING C Which of the following is true ? (a) The execution of the above may result in size error. (b) The execution of the above will result in size error. (c) The definition of C is invalid resulting in compilation error. (d) No error will be thee and the program would proceed correctly.

4 Answers   TCS,


in cobol i have one file it contains records like 10,4,23,98,7,90..... total records 100. iwant 10 to 20 in reverse order in cobol environ ment any one please give the answer......

2 Answers   IBM,


I have a Flat file in which certain records are present in a tabular format. I need to extract some of the records on some basis from it and copy them into a flat file...how it can be done ??

2 Answers   HCL,


Why there is no questions in this column?

6 Answers  


Categories