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 amode(31)
What is the usage of comp fields in cobol?
What is cobol?
How do get the result of your program directly on your pc?
What are various search techniques in cobol? Explain.
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
How to know whether the module is dynamical or statistical?
Can a Search can be done on a table with or without Index?
what are decleratives in cobol?
What is inspect in cobol ?
What rules are to be followed while using the corresponding options?
How do you get the data to code the BMS macro?
write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc
What do you understand by psb and acb?
how can i see junk values in dclgen or in hostvariable of comp ?