Consider the following COBOL entries
05 X PIC 99 VALUE 10.
ADD 40 X TO X.
COMPUTE X = 3 * X - 40.
The result in X is
Answer Posted / neelam
I agree with all of them who have answered 40.
It is a simple statement in cobol that
ADD A B TO C. (Means (A+B)+C moved in C)
Here,
ADD 40 X TO X ()
Value of X is 10
So, ADD 40 10 TO 10 (Gives 40+10+10 = 60)
Now, COMPUTE X = 3 * X - 40
Means X = 3 * 60 - 40 (Gives 180 - 40 = 140 )
Since PIC clause for X is 99, hence 140 can't be store in
variable X.
So answer is : 40
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic
Which Search verb is equivalent to PERFORM…VARYING?
What is report-item in COBOL?
How to change size of Initial number of records to *NOMAX for ALL PF files from perticular library, how can I do that
What are the rules of the move verb?
If you are current on the owner of a set, what is the difference between obtain next and obtain first?
What are the different rules to perform a Search?
EXPLAIN MAIN FRAME TESTING PROCESS...HOW TO FIX THE MAINFRAME BUGS?
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
What is the difference between next sentence and continue in cobol programing language?
Discuss about changing dataset name in proc.
How do u write test cases?
Explain how will you differentiate between an internal and an external sort, the pros and cons, internal sort syntax etc
What are the pertinent COBOL
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.