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
What is the difference between binary search and sequential search?
Can we redefine the field of x(200) to less than 200?
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?
Give some examples of command terminators?
1.Is it possible to move the data from 99.99 to 99v99? 2.What is the CICS-vsam Compilation process? 3.In My GDG 5 generation will be there GDG3 got an abend what will happen? 4.In my GDG first generation is +1 And I want to add the new generation what will happen previous generation? 5.How can you give the PIC clause below conditions A). s9 (reddy), B). s9 (5) occurs 5 times? 6.How override the proc from a particular step? and what is symbolic and override Procs?
Can you please let me know the centre name of INS certification in Kolkata.
What is the difference between next sentence and continue in cobol programing language?
Write the code implementing the perform … varying.
Why do we code s9 (4) comp. Inspite of knowing comp-3 will occupy less space?
What guidelines should be followed to write a structured cobol prgm?
Is it possible that the redefines clause has different picture clauses compared to the one it redefined?
What is cobol?
how do you define single dimensional array and multidimensional array in your cobol?
Have you used comp and comp-3 in your project? And how?
What is a SSRANGE and NOSSRANGE?