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
how can i see junk values in dclgen or in hostvariable of comp ?
Name the sections present in data division.
What rules are to be followed while using the corresponding options?
which is Best IBM Mainframe Training and Placement Institute in Ameerpet Hyderabad
Explain how you can characterize tables in cobol?
How do you differentiate between cobol and cobol-ii?
Write a program to enter and display the names of students in a class using the occurs clause.
What is the Purpose of POINTER Phrase in STRING command in COBOL?
State the various causes of s0c1, s0c5 and s0c7.
When is inspect verb is used in cobol?
In which area will you utilize 88 level items in cobol?
Why is it necessary that file needs to be opened in I-O mode for REWRITE?
Difference between cobol and cobol-ii?
) How do u handle errors in BMS macro
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?