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 guidelines should be followed to write a structured cobol prgm?
Explain how to differentiate call by context by comparing it to other calls?
What is the local-storage section?
Can you please let me know the centre name of INS certification in Kolkata.
2 input fles: 2 flat files, with different number of records. both are having unique key for each record and already sorted in ascending order . match these files using unique key and in output only matching key value has to be written. please procide cobol logic
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
How do you define a variable of comp-1 and comp-2?
How to know whether the module is dynamical or statistical?
What are the pertinent COBOL
Write a cobol program making use of the redefine clause.
how we sort two input files based on a common column and giving one o/p file please send me the coding logic?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
When is inspect verb is used in cobol?
Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.
input 1 input2 ouput1 output2 output 3 1 re 300 1 re 200 1 re 300 3 rc 500 1 re 200 2 rr 400 1 re 300 2 rr 400 1 rc 400 3 rc 500 1 rc 400 2 rr 700 2 rr 700 5 tt 900 5 tt 900 2 inputs r in flat file and output 1 is matched records,ouptput2 is unmatched of input1,output3 is unmatched of input2! how vl u get the output files using sequential order and to check with each and every records! let me know the procedure division ?