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

Write the code to count the sum of n natural numbers.

911


What are declaratives and what are their uses in cobol?

921


How do you reference the fixed block file formats from cobol programs

901


if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.

6074


What is the default value(s) for an initialize? What keyword will allow for an override of the default?

852


how do you reference the rrds file formats from cobol programs

1124


Define cobol?

1060


Hi pls anybody tell me about " ANALYSIS DOCUMENT PREPARATION AND ESTIMATION OF TASK " (in real time project)."I want to update a sequential file in my project" for that purpose i need both structures i mean analysis document and estimation of task.

1870


How do you reference the following file formats from cobol programs?

899


What rules are to be followed while using the corresponding options?

822


What is the use of intialize verb?

957


What are the different data types in cobol?

1025


What is amode(24)?

867


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.

5404


Which Search verb is equivalent to PERFORM…VARYING?

846