01 xxx pic 9(4).
01 yyy pic 9(6).

move 123456 into yyy.
move yyy to xxx.

display yyy.

what would be the value of yyy

Answers were Sorted based on User's Feedback



01 xxx pic 9(4). 01 yyy pic 9(6). move 123456 into yyy. move yyy to xxx. display yyy. wha..

Answer / jaganmohanreddy

HAI ALL U R WRITING DIFFERENT ANSWERS BUT THEY ARE ASKING
FOR YYY VALUE IT WONT BE CHANGED IT HAS VALUE OF 123456
BECAUSE ITS PIC CLAUSE IS 9(6) OK THEN DISPLAY YYY IT WIL
DISPLAY 123456 OK ANY DOUBTS

Is This Answer Correct ?    55 Yes 3 No

01 xxx pic 9(4). 01 yyy pic 9(6). move 123456 into yyy. move yyy to xxx. display yyy. wha..

Answer / jaganmohanreddy

answer is 123456

Is This Answer Correct ?    38 Yes 4 No

01 xxx pic 9(4). 01 yyy pic 9(6). move 123456 into yyy. move yyy to xxx. display yyy. wha..

Answer / v@m$i

YYY VALUE NOT CHANGE.
ie 123456

Is This Answer Correct ?    29 Yes 1 No

01 xxx pic 9(4). 01 yyy pic 9(6). move 123456 into yyy. move yyy to xxx. display yyy. wha..

Answer / siba

In numeric number alingment is right to left
truncation is done in left side
the datatype size of y is 6
so value of y is 123456

Is This Answer Correct ?    14 Yes 2 No

01 xxx pic 9(4). 01 yyy pic 9(6). move 123456 into yyy. move yyy to xxx. display yyy. wha..

Answer / adithya

YYY : 123456

XXX : 3456

Is This Answer Correct ?    12 Yes 0 No

01 xxx pic 9(4). 01 yyy pic 9(6). move 123456 into yyy. move yyy to xxx. display yyy. wha..

Answer / gangadhara.m

numeric number alingment is right to left
truncation is done in left side
the datatype size of y is 6
so value of y is 123456

Is This Answer Correct ?    8 Yes 2 No

01 xxx pic 9(4). 01 yyy pic 9(6). move 123456 into yyy. move yyy to xxx. display yyy. wha..

Answer / mahaveer

Here if u display YYY it will 123456
and if u display xxx it will 3456

Hope its clear

Is This Answer Correct ?    4 Yes 0 No

01 xxx pic 9(4). 01 yyy pic 9(6). move 123456 into yyy. move yyy to xxx. display yyy. wha..

Answer / vishal

12345

Is This Answer Correct ?    8 Yes 9 No

01 xxx pic 9(4). 01 yyy pic 9(6). move 123456 into yyy. move yyy to xxx. display yyy. wha..

Answer / vjay

we cannot move yyy to xxx ....see the data length

Is This Answer Correct ?    2 Yes 3 No

01 xxx pic 9(4). 01 yyy pic 9(6). move 123456 into yyy. move yyy to xxx. display yyy. wha..

Answer / v@m$i

OUTPUT:
----------
3456

Is This Answer Correct ?    9 Yes 15 No

Post New Answer

More COBOL Interview Questions

how to access vsam files in cobol and how to differentiate that this is ESDS file

1 Answers   EDS,


What is IMPACT analysis?

2 Answers   IBM,


I have two sequential files, FILE-1 and FILE-2. FILE-1 contains 2 columns(A,B) and FILE-2 contains 3 columns (C,D,E).I want an output file, FILE-3 which has all five columns with duplicates eliminated from column A.

3 Answers  


file status 00 is checked after opening the file or reading the file

4 Answers   John Deere,


What is an index for tables?

2 Answers  






what are the isolation levels and where we use it in the db2 program

3 Answers   TCS,


If we put three reads in COBOL in the same para one after the other, to read a PS file,will it read the same record thrice or it will read three records sequentially? For example : Input File 01 02 03 Para 900 Read infile Display Infile rec Read infile Display infile rec Read infile Display infile rec. What will be the output?

2 Answers  


What is file status 92?

3 Answers  


What are the differences bitween cobol and cobol-2?

1 Answers   Wipro,


what happens if we dont close cursor in db2-cobol pgm?

6 Answers  


In file1 have 80 records are like d1,d2,d3......D80. File2 have 1000records are like a1d1,a1d2,a3d3.....Etc. I want matching records in file3 ? Plse tell me the matching logic???I want answer only in cobol ?Not using any tool or jcl?

1 Answers   CSC,


Read filea And file b write the same records in both files? Records in a but not in b record in b but not in a

3 Answers   TCS,


Categories