WORKING-STORAGE SECTION.
01 A PIC X(3) VALUE 'ABC'
01 B PIC 9(3).
PROCEDURE DIVISION.
MOVE A TO B.
STOP RUN.

OUTPUT IS: AB3
WHY AND HOW THIS IS HAPPENING.

Answer Posted / chandrababu

We will get 123 not AB3..why because

A = +1 J = -1
B = +2 K = -2
C = +3 L = -3
D = +4 M = -4
E = +5 N = -5
F = +6 O = -6
G = +7 P = -7
H = +8 Q = -8
I = +9 R = -9

So will get 123 for ABC..

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Whats the difference between search & search ALL?

5236


What is report-item in COBOL?

702


How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

693


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

668


What is the utilization of copybook in cobol?

648






I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......

10542


What are declaratives and what are their uses in cobol?

699


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.

3706


) How do u handle errors in BMS macro?

1418


What are the different rules to perform a Search?

610


What are the different data types in cobol?

778


how do you reference the printer file formats from cobol programs

643


How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

1915


i want a program using by if, evaluate , string, unstring, perform, occurs?

4033


What is the difference between binary search and sequential search?

632