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 the difference between structured cobol programming and object alternativelyiented cobol programming?
What are literals?
What is the utilization of copybook in cobol?
What are the different types of condition in cobol and write their forms.
How to print 10 to 1 if the input have only 10 digit number?
How do you define a variable of comp-1 and comp-2?
What rules are followed by the search verb.
Define static linking and dynamic linking.
How can you get the ksds file records into your cobol program?
Differentiate between structured cobol programming and object-oriented cobol programming.
Why would you use find and get rather than to obtain?
What kind of error is trapped by on size error option?
Can you please let me know the centre name of INS certification in Kolkata.
What is the LINKAGE SECTION used in COBOL?
Explain about different table spaces.