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 / thavasi
The answer is:
move each record to WS-REC PIC X(04).
then write the below statment to be executed for each rec.
INSPECT WS-REC REPLACING LEADING '3' by '5'.
why am i using LEADING instead of FIRST is that the
requirement says that 'STARTING with 3 by 5'
| Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
what is search and searchall?what is the diffrence between them?give an best example?
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
What are the different open modes available in cobol?
How you can characterize tables in cobol?
What rules are followed by the search verb.
What is report-item in 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.
Write some characteristics of cobol as means of business language.
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?
What is Pic 9v99 Indicates in COBOL?
What is amode(31)
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?
what is s000 u4087 error? please give the all error codes in cobol,jcl.
How to know whether the module is dynamical or statistical?