01 ws-p pic 9(2).
01 ws-q pic 9(2) value 01.
01 ws-r pic 9(2) value 99.

p.d.

compute p = q + r
what will be result of p ans(00) but my question is that

how i got 10 on the place of 00.
(truncation will ocuure on right side not left).

please tell me ?


Answer Posted / minhaj

01 p pic 9(02) value zero.
01 q pic 9(02) value 99.
01 r pic 9(02) value 1.

p = q+r.
actual p value = 100. but p value is numeric so it writes
from right to left tuncations will be taken left side.
so p value = 00 if u want p = 10 then use justifications

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between Call and a Link?

700


For rewrite, why is it mandatory that file needs to be opened?

623


Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks

2337


What is the difference between structured cobol programming and object alternativelyiented cobol?

757


What the difference is between continue and next sentence?

665






What are the different rules of SORT operation?

700


Program A (Normal COBBAT) calling a B Program (DB2COBOL, COBBATDB which is using a VSAM file. its a dynamic call. How we will handle VSAM file decleration in our from JCL from where we are running A PGM. And should we have PLAN for A pGM also. if possible can some one post a sample JCL. Thanks for help in advance.

5065


What are all the divisions of a COBOL program?

665


What are the different open modes available in cobol?

722


What is the difference between binary search and sequential search?

643


What is the difference between external and global variables in COBOL?

815


What guidelines should be followed to write a structured cobol prgm?

673


Mention the guidelines to write a structured cobol program?

620


What are the pertinent COBOL

2045


What is the difference between a binary search and a sequential search what are the pertinent cobol?

736