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.
Answers were Sorted based on User's Feedback
Answer / mahe
You won't get AB3 as Output,Job will abend with SOC7 as you
r moving Character to Numeric variable
| Is This Answer Correct ? | 22 Yes | 4 No |
Answer / kamaldeep
I got AB3 as out put, when ever we are moving X(3) to 9(3) then 1st 2 bytes will be moved right(i.e. AB) but last byte will have '3' as C=+3
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / 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 |
Answer / velu
Exactly maha!!!!......actually we won't move the pic x(3)
to pic 9(3)(that's we can't move the alphabet to numeric
data type).....it should shows the abed...
| Is This Answer Correct ? | 1 Yes | 4 No |
BY seeing a program how can we say that it is static call or dynamic call
which is better either static call or dynamic call? and why?
How to remove the spaces at end of each record in the output file Via COBOL program? note: The file has a VB length
What guidelines should be followed to write a structured Cobol program?
If I want to increase the Limit in GDG. What should I do?
How can i write a comp-3 variable into a sequential file should i declara the field in the file description as comp- 3?
How to read a 100 record from a file through cobol?
if i am reading a file with some 50000 records and moving to a DB2 table and suddenly the program abends in between, is there anyway i could restart from the exact record at which the job failed once the program restarts.
How to declare if emp-name = AAAAA""BBB in working-storage section. After display emp-name should print like AAAAA""BB
What is an in line perform? When would you use it? Anything else you wish to say about it.
How to read records in reverse order in flat file? I know we can do it by reading all records into an array.... Then read records in reverse order by using subscript or index but can any body give me the exact code.
Minimum how many Number of Paragraphs are there in ID- Divison?