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

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

808


I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

1234


how to refer the data field?

1812


How you can characterize tables in cobol?

723


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1908






There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

934


what happens if parmparameter passes zero bytes to the program

1668


Define static linking and dynamic linking.

669


What are the pertinent COBOL

2046


i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc

2108


Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.

2061


How do u write test cases?

1641


how can i see junk values in dclgen or in hostvariable of comp ?

2546


i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

897


How do get the result of your program directly on your pc?

1886