I have the file which is having the extension no as records.
sample file will look like below.
2310
3410
3256
4350
3781
5408
I need to replace the record which is starting with 3 to 5
(i.e) 3410 to 5410. How can we do it through cobol
and cobol-db2 program? I need the possible logic?
Answer Posted / pa
read the record to the WS varible defined below
01 ws-var1.
05 ws-var2 pic x(1).
05 ws-var3 pic x(2).
if ws-var2 = '3'
inspect ws-var replacing first '3' by '5'
end -if
read the next record.
Hope it works
| Is This Answer Correct ? | 5 Yes | 2 No |
Post New Answer View All Answers
Can a Search can be done on a table with or without Index?
What are the different rules to perform a Search?
What is the default value(s) for an initialize? What keyword will allow for an override of the default?
Why occurs cannot be used in 01 level in COBOL?
IF I mention stop run in CICS what happens?
For rewrite, why is it mandatory that file needs to be opened?
Explain the configuration section of a cobol program with examples of syntax.
What is a report item?
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.
What rules are to be followed while using the corresponding options?
What rules are followed by the search verb.
Difference between cobol and cobol-ii?
What is an in line perform? When would you use it? Anything else you wish to say about it.
Differentiate between structured cobol programming and object-oriented cobol programming.
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?