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 / reena
Define the working storage variable in the following way:
01 ws-var1.
05 ws-var2 pic x(1).
05 ws-var3 pic x(3).
Read the database file.
Move the database field value to the working storage
variable (i.e. ws-var1)
Then preform the following
if ws-var2 = '3'
move '5' to ws-var2
move ws-var1 to the database field
rewrite database record
end -if
read the next record.
Preform the above routine till eof..
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Have you used comp and comp-3 in your project? And how?
System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..
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.
What is a scope terminator give example?
what is difference bt COND, REGION & TIME parameters at JOB & EXEC. give an exp.
Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning
Explain the configuration section of a cobol program with examples of syntax.
Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks
How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?
What is report-item in COBOL?
What is the difference between binary search and sequential search?
Write a program to explain size error.
What is a report item?
Write a cobol program making use of the redefine clause.
what is amode(24), amode(31), rmode(24) and rmode(any)?